Airplane movement

Blitz3D Forums/Blitz3D Beginners Area/Airplane movement

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.

It rotates the entity differently. Turnentity is fine if you only want to turn your entity along the Y axis. It's pretty much useless for multiaxis turning i say. Try the examples below.

ROTATEENTITY

Graphics3D 800,600
SetBuffer BackBuffer()


Global camera = CreateCamera()
PositionEntity camera,0,2,-10

Global light = CreateLight()

Global cube = CreateCube()
ScaleEntity cube,1,1,5


While Not KeyHit(1)


	If KeyDown(200) Then RotateEntity cube,EntityPitch(cube)+1,EntityYaw(cube),EntityRoll(cube)
	If KeyDown(208) Then RotateEntity cube,EntityPitch(cube)-1,EntityYaw(cube),EntityRoll(cube)
	If KeyDown(203) Then RotateEntity cube,EntityPitch(cube),EntityYaw(cube)+1,EntityRoll(cube)
	If KeyDown(205) Then RotateEntity cube,EntityPitch(cube),EntityYaw(cube)-1,EntityRoll(cube)
	
	UpdateWorld
	RenderWorld
	Flip
Wend
End


TURNENTITY

Graphics3D 800,600
SetBuffer BackBuffer()


Global camera = CreateCamera()
PositionEntity camera,0,2,-10

Global light = CreateLight()

Global cube = CreateCube()
ScaleEntity cube,1,1,5


While Not KeyHit(1)


	If KeyDown(200) Then TurnEntity cube,1,0,0
	If KeyDown(208) Then TurnEntity cube,-1,0,0
	If KeyDown(203) Then TurnEntity cube,0,1,0
	If KeyDown(205) Then TurnEntity cube,0,-1,0
	
	UpdateWorld
	RenderWorld
	Flip
Wend
End