I'm not sure whether there's a bug with DeltaPitch or I'm doing something wrong but to me it only seems to half work. The following code works fine if the spot is on the left but has problems when it is on the right.
I've done the same code using DeltaYaw and that works perfectly. Does DeltaPitch work slightly differently or is it a bug?
Graphics3D 800, 600 SetBuffer BackBuffer() camera=CreateCamera() ; Position and rotate camera so we have overhead (top-down) view PositionEntity camera,0,0,-10 ; Create red cone (the arrow) arrow=CreateCone() RotateMesh arrow,90,0,0 TurnEntity arrow,0,90,0 EntityColor arrow,255,0,0 ; Create blue sphere (the spot) spot=CreateSphere() EntityColor spot,0,0,255 PositionEntity spot,-5,0,0 While Not KeyDown(1) ; If w,a,s,d pressed then move spot If KeyDown(17)=True Then MoveEntity spot,0,0.1,0 ; w - up If KeyDown(30)=True Then MoveEntity spot,-0.1,0,0 ; a - left If KeyDown(31)=True Then MoveEntity spot,0,-0.1,0 ; s - down If KeyDown(32)=True Then MoveEntity spot,0.1,0,0 ; d - right ; Rotate arrow using delta yaw value. Arrow will point at spot. TurnEntity arrow,DeltaPitch(arrow, spot),0,0 RenderWorld Text 0,0,"Note: Camera view is overhead. The arrow will x-rotate using DeltaPitch value." Text 0,20,"Use w,a,s,d to move spot." Flip Wend End
I've done the same code using DeltaYaw and that works perfectly. Does DeltaPitch work slightly differently or is it a bug?