MeshesIntersect.bb 599 B

1234567891011121314151617181920212223242526272829303132
  1. ; MeshesIntersect Example
  2. ; -----------------------
  3. Graphics3D 640,480
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. light=CreateLight()
  7. RotateEntity light,90,0,0
  8. drum=LoadMesh("media/oil-drum/oildrum.3ds")
  9. PositionEntity drum,-20,0,100
  10. crate=LoadMesh("media/wood-crate/wcrate1.3ds")
  11. PositionEntity crate,20,0,100
  12. While Not KeyDown( 1 )
  13. TurnEntity drum,1,1,1
  14. TurnEntity crate,-1,-1,-1
  15. RenderWorld
  16. ; Test to see if drum and crate meshes are intersecting; if so then display message to confirm this
  17. If MeshesIntersect(drum,crate)=True Then Text 0,0,"Meshes are intersecting!"
  18. Flip
  19. Wend
  20. End