B3D's Entity Rotation

Blitz3D Forums/Blitz3D Programming/B3D's Entity Rotation

This seems to work...
Graphics3D 640, 480, 0, 2

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

c = CreateCube()

Repeat
	cr =cr+1
	RotateEntity c, 0, cr, 0
	
	RenderWorld
	Text 0, 20, EntityYaw(c)
	Text 0, 0, TEntityYaw(c)
	Flip
Until KeyHit(1)
End

Function TEntityYaw#(entity)
	ey# = EntityYaw(entity)
	If ey>=-180 And ey <=0
		ey = (360+ey)
		DebugLog ey
		Return ey
	ElseIf ey >= 0 And ey <=180
		Return ey
	EndIf
End Function