MeshesIntersect.htm 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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>MeshesIntersect (mesh_a,mesh_b )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. mesh_a - mesh_a handle <br />
  13. mesh_b - mesh_b handle
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Returns true if the specified meshes are currently intersecting. <br />
  22. <br />
  23. This is a fairly slow routine - use with discretion... <br />
  24. <br />
  25. This command is currently the only polygon->polygon collision checking routine available in Blitz3D.
  26. </td>
  27. </tr>
  28. </table>
  29. <h1><a href=../3d_examples/MeshesIntersect.bb>Example</a></h1>
  30. <table>
  31. <tr>
  32. <td>
  33. ; MeshesIntersect Example <br />
  34. ; ----------------------- <br />
  35. <br />
  36. Graphics3D 640,480 <br />
  37. SetBuffer BackBuffer() <br />
  38. <br />
  39. camera=CreateCamera() <br />
  40. <br />
  41. light=CreateLight() <br />
  42. RotateEntity light,90,0,0 <br />
  43. <br />
  44. drum=LoadMesh("media/oil-drum/oildrum.3ds") <br />
  45. PositionEntity drum,-20,0,100 <br />
  46. <br />
  47. crate=LoadMesh("media/wood-crate/wcrate1.3ds") <br />
  48. PositionEntity crate,20,0,100 <br />
  49. <br />
  50. While Not KeyDown( 1 ) <br />
  51. <br />
  52. TurnEntity drum,1,1,1 <br />
  53. TurnEntity crate,-1,-1,-1 <br />
  54. <br />
  55. RenderWorld <br />
  56. <br />
  57. ; Test to see if drum and crate meshes are intersecting; if so then display message to confirm this <br />
  58. If MeshesIntersect(drum,crate)=True Then Text 0,0,"Meshes are intersecting!" <br />
  59. <br />
  60. Flip <br />
  61. <br />
  62. Wend <br />
  63. <br />
  64. End
  65. </td>
  66. </tr>
  67. </table>
  68. <br>
  69. <a target=_top href=../index.htm>Index</a><br>
  70. <br>
  71. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=MeshesIntersect&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  72. </html>