DarkBASIC Professional Help Wiki
Advertisement


This command will set the light state of the specified object.

Syntax
SET OBJECT LIGHT Object Number, Flag
Parameters
Object Number

Integer
The object number Flag Integer
Setting the light to one will ensure the object is affected by any lights in the 3D scene

Returns

This command does not return a value.

Description

Setting the light to one will ensure the object is affected by any lights in the 3D scene. If the object uses diffuse based colour, deactivating the light source will also deactivate the ability of the object to show its colour as it uses the light to calculate the diffuse result.

Example Code
sync on : sync rate 60 : hide mouse:cls 0:color backdrop 0

fog on:fog color 0:set ambient light 50

ObjectNumber=2:ImageNumber=2

wire=0:trans=0:cull=0:fliter=0:light=0:fog=0:ambient=0

set global object creation 0

set dir "models"

load object "ast4.x",ObjectNumber

set object specular ObjectNumber,0

rotate object ObjectNumber,270,0,0

set dir ".."

while mouseclick()<>2

set cursor 0,0

print "press 1 to set object wireframe";wire:if inkey$()="1" then wire=1-wire:set object wireframe ObjectNumber,wire

print "press 2 to set object transparency";trans:if inkey$()="2" then trans=1-trans:set object transparency ObjectNumber,trans

print "press 3 to set object cull";cull:if inkey$()="3" then cull=1-cull:set object cull ObjectNumber,cull

print "press 4 to set object filter";filter:if inkey$()="4" then filter=1-filter:set object filter ObjectNumber,filter

print "press 5 to set object light";light:if inkey$()="5" then light=1-light:set object light ObjectNumber,light

print "press 6 to set object fog";fog:if inkey$()="6" then fog=1-fog:set object fog ObjectNumber,fog

print "press 7 to set object ambient";ambient:if inkey$()="7" then ambient=1-ambient:set object ambient ObjectNumber,ambient

while scancode()<>0:endwhile

if mouseclick()=1 then yrotate object ObjectNumber,wrapvalue(object angle y(ObjectNumber)+1)

sync

endwhile

while mouseclick()=1:endwhile

delete object ObjectNumber

end
Advertisement