PositionMesh.bb 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ; PositionMesh Example
  2. ; --------------------
  3. ; In this example we will demonstrate the use of the PositionMesh command.
  4. ; Unlike PositionEntity, PositionMesh actually modifies the actual mesh structure.
  5. ; So whereas using PositionEntity 0,0,1 would only move an entity by one unit the first time it was
  6. ; used, PositionMesh 0,0,1 will move the mesh by one unit every time it is used.
  7. ; This is because PositionEntity positions an entity based on a fixed mesh structure, whereas
  8. ; PositionMesh actually modifies the mesh structure itself.
  9. Graphics3D 640,480
  10. SetBuffer BackBuffer()
  11. camera=CreateCamera()
  12. light=CreateLight()
  13. ; Create cube mesh
  14. cube=CreateCube()
  15. ; Position cube in front of camera so we can see it
  16. PositionEntity cube,0,0,5
  17. While Not KeyDown(1)
  18. ; If space bar pressed then position mesh 1 unit along the z axis. Also set syntax$ text.
  19. If KeyHit(57)=True Then PositionMesh cube,0,0,1 : syntax$="PositionMesh 0,0,1"
  20. RenderWorld
  21. Text 0,0,"Press space to position the mesh 1 unit along the z axis"
  22. Text 0,20,syntax$
  23. Flip
  24. Wend
  25. End