EntityColor

Blitz3D Forums/Blitz3D Programming/EntityColor

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ok, this shows that floats are being used by Blitz. Modified example from floyd's code.

The sphere on the left is incrementing the RED colour value by 1.

The sphere on the right is incrementing the RED colour value by 0.01.

You can clearly see the sphere on the left is stepping quite a bit.

Graphics3D 640, 480, 0, 2

cam = CreateCamera()
PositionEntity cam, 0,0,-5 

e1 = CreateSphere()
e2 = CreateSphere()

PositionEntity e1,  1,0,0
PositionEntity e2, -1,0,0

light = CreateLight()
LightColor light, 6000, 0, 0

Global count#=0
Global dir#=0.01

Global count1#=0
Global dir1#=0.01


While Not KeyHit(1)
	
	EntityColor e1, 1+count, 0, 0
	count=count+dir:If count> 100 Or count<0 Then dir=dir*-1

	EntityColor e2, Int(1+count1), 0, 0
	count1=count1+dir1:If count1> 100 Or count1<0 Then dir1=dir1*-1
	
	RenderWorld
	Text 0,0," red left="+(Int(1+count1))+"  red right="+(1+count)
	Flip
	Delay 20
Wend
End