ArcBasicDocs

samples/mak/fakelight

fakelight.abs

51 lines of ArcBasic. Words in colour that are commands link to their help page. To run it, download ArcBasic, open the file and press F5.

Download fakelight.absAll files in this folder

fakelight.abs
Global info1$="Fakelighting demo"Global info2$="Hit <return> to toggle real/fake lighting"Include "../start.abs"AmbientLight 0,0,0cube=CreateSphere( 32 )tex=LoadTexture( "brick.bmp" )EntityTexture cube,texrange#=5For k=1 To 6	Read lx#,ly#,lz#,lr#,lg#,lb#	light=CreateLight(2,cube)	LightRange light,range	LightColor light,lr,lg,lb	PositionEntity light,lx,ly,lz	LightMesh cube,lr,lg,lb,range,lx,ly,lzNextcamera=CreateCamera()PositionEntity camera,0,0,-5fake=0While Not KeyHit(1)	TurnEntity cube,.1,.2,.3	If KeyHit(28)		fake=3-fake		EntityFX cube,fake	EndIf	UpdateWorld	RenderWorld	If fake t$="Y" Else t$="N"	Text 0,0,"Fake light:"+t$	FlipWendEndData -2,0,0,255,0,0Data +2,0,0,0,255,0Data 0,+2,0,255,255,0Data 0,-2,0,255,0,255Data 0,0,-2,0,255,255Data 0,0,+2,255,255,255