CreateSurface.htm 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>CreateSurface ( mesh[,brush] )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. mesh - mesh handle <br />
  13. brush (optional) - brush handle
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Creates a surface attached to a mesh and returns the surface's handle. <br />
  22. <br />
  23. Surfaces are sections of mesh which are then used to attach triangles to. You must have at least one surface per mesh in order to create a visible mesh, however you can use as many as you like. Splitting a mesh up into lots of sections allows you to affect those sections individually, which can be a lot more useful than if all the surfaces are combined into just one.
  24. </td>
  25. </tr>
  26. </table>
  27. <h1><a href=../3d_examples/CreateSurface.bb>Example</a></h1>
  28. <table>
  29. <tr>
  30. <td>
  31. Graphics3D 640,480 <br />
  32. SetBuffer BackBuffer() <br />
  33. <br />
  34. mesh = CreateMesh() <br />
  35. surf = CreateSurface(mesh) <br />
  36. <br />
  37. v0 = AddVertex (surf, -5,-5,0, 0 ,0) <br />
  38. v1 = AddVertex (surf, 5,-5,0, 1 ,0) <br />
  39. v2 = AddVertex (surf, 0, 5,0, 0.5,1) <br />
  40. <br />
  41. tri = AddTriangle (surf,v0,v2,v1) <br />
  42. <br />
  43. cam = CreateCamera() <br />
  44. MoveEntity cam, 0,0,-7 <br />
  45. <br />
  46. RenderWorld <br />
  47. Flip <br />
  48. <br />
  49. WaitKey <br />
  50. End
  51. </td>
  52. </tr>
  53. </table>
  54. <br>
  55. <a target=_top href=../index.htm>Index</a><br>
  56. <br>
  57. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CreateSurface&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  58. </html>