vertex.bb 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ; Vertex Control ***
  2. ; By Paul Gerfen (www.gamecoding.co.uk)
  3. Graphics3D 800,600
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. CameraViewport camera,0,0,800,600
  7. light=CreateLight()
  8. plane=LoadMesh("plane.3ds")
  9. PositionEntity plane,0,0,25
  10. EntityFX plane,2
  11. surface=GetSurface(plane,CountSurfaces(plane))
  12. VertexColor surface,0,255,0,0
  13. VertexColor surface,1,0,255,0
  14. VertexColor surface,2,0,0,255
  15. VertexColor surface,3,255,0,255
  16. While Not KeyHit(1)
  17. TurnEntity plane,0,0,.3
  18. counter=counter+1
  19. If counter<500 Then
  20. x1#=-.01
  21. y1#=-.01
  22. x2#=+.01
  23. EndIf
  24. If counter>499 Then
  25. x1#=+.01
  26. y1#=+.01
  27. x2#=-.01
  28. EndIf
  29. xx#=VertexX(surface,0)
  30. yy#=VertexY(surface,0)
  31. zz#=VertexZ(surface,0)
  32. VertexCoords surface,0,xx+x1,yy+y1,zz
  33. xx#=VertexX(surface,2)
  34. yy#=VertexY(surface,2)
  35. zz#=VertexZ(surface,2)
  36. VertexCoords surface,2,xx+x2,yy+y1,zz
  37. If counter=1000 Then
  38. counter=0
  39. VertexColor surface,0,Rnd#(0,255),Rnd#(0,255),Rnd#(0,255)
  40. VertexColor surface,1,Rnd#(0,255),Rnd#(0,255),Rnd#(0,255)
  41. VertexColor surface,2,Rnd#(0,255),Rnd#(0,255),Rnd#(0,255)
  42. VertexColor surface,3,Rnd#(0,255),Rnd#(0,255),Rnd#(0,255)
  43. EndIf
  44. UpdateWorld
  45. RenderWorld
  46. Text 350,500,"Vertex Control"
  47. Flip
  48. Wend
  49. End