Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setLightPos()

Purpose

Set the position of a light source

Description

Set the position of a light source to the specified value

Syntax

setLightPos( light, position )

Arguments

light handle of the light source

position A position vector in 3 dimensional space { x, y, z } where the light source is located

Example

obj = placeObject( cube, { 0, 0, 0 }, { 4, 0.1, 4 } )
lightpos = { 0, 0, 0 }
light = pointLight( lightpos, white, 50 )
setCamera( { 0, 4, 8 }, { 0, 0, 0 } )

loop
    clear()
    c = controls( 0 )
    // Move the light position using the joysticks
    lightpos += { c.lx, c.ry, -c.ly } * 0.1
    // Restrict height control of light position
    lightpos.y = clamp( lightPos.y, 0.1, 10 ) 
    setLightPos( light, lightPos )   
    drawObjects()
    printAt( 0, 0, "Use Joy-Con Control Sticks to adjust light position" )
    printAt( 0, 1, "Light X Position: " + str( lightPos.x ) )
    printAt( 0, 2, "Light Y Position: " + str( lightPos.y ) )
    printAt( 0, 3, "Light Z Position: " + str( lightPos.z ) )
    update()
repeat

Associated Commands

pointLight(), pointShadowLight(), removeLight(), setAmbientLight(), setLightBrightness(), setLightColour(), setLightDir(), setLightSpread(), spotLight(), worldLight(), worldShadowLight()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.