if i set m = 2, and l = 1, there is no longer directional light. point light does not show, either.
rem settings
setVirtualResolution( 640.0, 480.0 )
rem camera
setCameraPosition(1, 0.0, 0.0, -7.9)
setCameraLookat(1, 0.0, 0.0, 0.0, 0.0)
rem objects
// wall
a = loadObject( "wall.obj" )
i=loadImage( "walls.jpg" )
setObjectImage( a, i, 0 )
setObjectTransparency( a, 0 )
// tunnel
b = loadObject( "tunnel.obj" )
i=loadImage( "muddy.JPG" )
setObjectImage( b, i, 0 )
setObjectTransparency( b, 0 )
// ground
c = loadObject( "grass.obj" )
i=loadImage( "weeds.jpg" )
setObjectImage( c, i, 0 )
setObjectTransparency( c, 0 )
// box
d = createObjectBox( 2.5, 2.5, 2.5 )
setObjectPosition( d, 0.0, 0.0, -5.0 )
ib = loadImage( "transparency.png" )
setobjectImage( d, ib, 0 )
setObjectTransparency( d, 1 )
//loadShader( 1, "shader.vs", "shader.ps" )
//setoBJECTShader( c, 1 )
rem sun
m = 3
createLightDirectional( m, 0.0, -1.0, 0.0, 255.0, 255.0, 128.0 )
rem lantern
l = 2
createLightPoint( l, 0.0, 0.0, 0.0, 10000.0, 0.0, 255.0, 255.0 )
setObjectLightMode(a, 1)
setObjectLightMode(b, 1)
setObjectLightMode(c, 1)
setObjectLightMode(d, 1)
rem input
j=1
k=2
addVirtualJoystick( j, 300, 400, 64 )
addVirtualJoystick( k, 400, 400, 64 )
do
rem move camera
x# = getVirtualJoystickX( j )
y# = getVirtualJoystickY( j )
moveCameraLocalX( 1, x# * 0.25 )
moveCameraLocalZ( 1, -y# * 0.25 )
rem move point light
setLightPointPosition( l, getCameraX(1), getCameraY(1), getCameraZ(1))
rem point camera
x# = getVirtualJoystickX( k )
y# = getVirtualJoystickY( k )
rotateCameraLocalX( 1, y# )
rotateCameraLocalY( 1, x# )
rem sync
print( getCameraX(1) )
print( getCameraY(1) )
print( getCameraZ(1) )
sync()
loop