ScaleMesh.bb 1016 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ; ScaleMesh Example
  2. ; -----------------
  3. ; In this example we will demonstrate the use of the ScaleMesh command.
  4. ; Unlike ScaleEntity, ScaleMesh actually modifies the actual mesh structure.
  5. ; So whereas using ScaleEntity 2,2,2 would only double the size of an entity the first time it was
  6. ; used, ScaleMesh 2,2,2 will double the size of the mesh every time it is used.
  7. ; This is because ScaleEntity scales an entity based on a fixed mesh structure, whereas ScaleMesh
  8. ; 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 scale cube mesh by 1%. Also set syntax$ text.
  19. If KeyHit(57)=True Then ScaleMesh cube,1.01,1.01,1.01 : syntax$="ScaleMesh 1.01,1.01,1.01"
  20. RenderWorld
  21. Text 0,0,"Press space to scale mesh by 1%"
  22. Text 0,20,syntax$
  23. Flip
  24. Wend
  25. End