Cube inside to mesh
Blitz3D Forums/Blitz3D Programming/Cube inside to mesh
| ||
I need to check if a cube is inside of a mesh. How i can do? Aza |
| ||
look up meshesintersect() The another good idea is to create textlabels that print at the mesh's axis location on the screen using cameraprojectX / Y which returns a 3d position in screen coords, so you can use the text command at that location. I find this a very useful way of finding things. Even if the mesh is off the screen it still prints on that edge, giving you a clue where its gone. |
| ||
MeshesIntersect will not tell you if the cube is completely encapsuled inside the outer mesh. There is one method that relative reliably checks this: do a linepick in all 6 directions, then FLipMesh the outer mesh, do the 6 linepicks again and OR it with the prev. results. Now, if the outer mesh was picked at every side at least once then the cube is inside, encapsuled. |
| ||
if your doing simply cube vs cube you can use this func i wrote to check whether cubes intersect or are in each other here http://open-web-page.info/index.php?q=aHR0cDovL3d3dy5ibGl0emJhc2ljLmNvbS9jb2RlYXJjcy9jb2RlYXJjcy5waHA%2FY29kZT0yMTM2 |
| ||
I need for a pathfinding, if a cube (node) is in a building mesh then donět use that cube (node). Something like this.. Aza |