ScaleEntity.bb 894 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ; ScaleEntity 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. ; Set scale values so that cone is default size to begin with
  10. x_scale#=1
  11. y_scale#=1
  12. z_scale#=1
  13. While Not KeyDown( 1 )
  14. ; Change scale values depending on the key pressed
  15. If KeyDown( 203 )=True Then x_scale#=x_scale#-0.1
  16. If KeyDown( 205 )=True Then x_scale#=x_scale#+0.1
  17. If KeyDown( 208 )=True Then y_scale#=y_scale#-0.1
  18. If KeyDown( 200 )=True Then y_scale#=y_scale#+0.1
  19. If KeyDown( 44 )=True Then z_scale#=z_scale#-0.1
  20. If KeyDown( 30 )=True Then z_scale#=z_scale#+0.1
  21. ; Scale cone using scale values
  22. ScaleEntity cone,x_scale#,y_scale#,z_scale#
  23. RenderWorld
  24. Text 0,0,"Use cursor/A/Z keys to scale cone"
  25. Text 0,20,"X Scale: "+x_scale#
  26. Text 0,40,"Y Scale: "+y_scale#
  27. Text 0,60,"Z Scale: "+z_scale#
  28. Flip
  29. Wend
  30. End