CreatePivot.bb 553 B

1234567891011121314151617181920212223242526272829303132
  1. ; CreatePivot Example
  2. ; -------------------
  3. Graphics3D 640,480
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. PositionEntity camera,0,0,-10
  7. light=CreateLight()
  8. RotateEntity light,90,0,0
  9. ; Create pivot. This is invisible.
  10. pivot=CreatePivot()
  11. ; Create planet (i.e. a sphere). Make the pivot the parent of the planet.
  12. planet=CreateSphere(16,pivot)
  13. ; Position planet so that it is offset from the pivot
  14. PositionEntity planet,5,0,0
  15. While Not KeyDown(1)
  16. ; Turn pivot, thus making planet spin around it
  17. TurnEntity pivot,0,1,0
  18. RenderWorld
  19. Flip
  20. Wend
  21. End