EntityPitch.bb 633 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. ; EntityPitch Example
  2. ; -------------------
  3. Graphics3D 640,480
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. light=CreateLight()
  7. cone=CreateCone( 32 )
  8. PositionEntity cone,0,0,5
  9. While Not KeyDown( 1 )
  10. pitch#=0
  11. yaw#=0
  12. roll#=0
  13. If KeyDown( 208 )=True Then pitch#=-1
  14. If KeyDown( 200 )=True Then pitch#=1
  15. If KeyDown( 203 )=True Then yaw#=-1
  16. If KeyDown( 205 )=True Then yaw#=1
  17. If KeyDown( 45 )=True Then roll#=-1
  18. If KeyDown( 44 )=True Then roll#=1
  19. TurnEntity cone,pitch#,yaw#,roll#
  20. RenderWorld
  21. Text 0,0,"Use cursor/Z/X keys to turn cone"
  22. ; Return entity pitch angle of cone
  23. Text 0,20,"Pitch: "+EntityPitch#( cone )
  24. Flip
  25. Wend
  26. End