PointEntity and Quad Roll

Blitz3D Forums/Blitz3D Programming/PointEntity and Quad Roll

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.

Hi :)

It was a long time that i have post a blitz3d problem :)

But i become crazy with quad roll. Trye this code and press
key UP, you will see the sprite made a unwanted roll

And want only a camera facing, but without roll !! it is
possible ? I have search many solutions and informations
on the forum or code archive but i find nothing to help me ?
or i'm idiot and i have not very well search ? (possible)

I think that the POINTENTITY command is the problem, but
i don't understand how make some quad => camera/facing
without this function ?

Cheers

Graphics3D 640,480,32,0
SetBuffer BackBuffer()

Type character
	Field sprite
	Field rot#
End Type

pivot=CreatePivot()
camera=CreateCamera(pivot)

PositionEntity camera,0,3,-5 : RotateEntity camera,30,0,0

ground=CreatePoly(-5,5,10,10) : RotateEntity ground,90,0,0 : EntityAlpha ground,0.5 : EntityOrder ground,1

; Create 5 characters
For i=-4 To 4 Step 2
	c.character=New character
	c\sprite=CreatePoly(-0.5,0.5,1,1) : PositionEntity c\sprite,i,0,0
	EntityFX c\sprite,1
	c\rot#=0
Next



;-------------------
;Main Game Loop     --------------
;-------------------

While Not KeyDown(1)

For a.character=Each character
	PointEntity a\sprite,camera
Next

;Keyboard Control
If KeyDown( 208 )=True Then pitch#=pitch#-1 
If KeyDown( 200 )=True Then pitch#=pitch#+1
If KeyDown( 203 )=True Then yaw#=yaw#-2
If KeyDown( 205 )=True Then yaw#=yaw#+2

RotateEntity pivot,pitch#,yaw#,0

RenderWorld

Flip

Wend

End

;Functions
;------------

Function CreatePoly(xpos#,zpos#,x#,z#) ;Create a backless Square (sprite)
	sprite=CreateMesh()
	he=CreateBrush(255,255,255)
	v=CreateSurface(sprite,he)
	FreeBrush he
	AddVertex (v,xpos#,zpos#,0,      1,0)
	AddVertex (v,xpos#+x#,zpos#,0,   0,0)
	AddVertex (v,xpos#+x#,zpos#-z#,0,0,1)
	AddVertex (v,xpos#,zpos#-z#,0,   1,1)
	AddTriangle(v,2,1,0)
	AddTriangle(v,0,3,2)
	AddTriangle(v,0,1,2)
	AddTriangle(v,2,3,0)
	Return sprite
End Function