Skip to main content
GameDev.net gamedev.net
🔒 Locked

how to use Mesh.Intersect

Started by The Pentium Guy Apr 21, 2004 at 5:32 PM 2 replies 550+ views
Original Post
The Pentium Guy
The Pentium Guy
does anyone know how to use Mesh.Intersect? i have no idea what they mean by rayPos, rayDir..etc..
neneboricua19
neneboricua19
The function is meant to test to see if a ray intersects your mesh. A ray has two components: an origin and a direction. If there is an intersection between the ray and th emesh, the function will return the face that was intersected, along with the barycentric coordinates of the intersection point.

If this sound like Greek to you, then you probably aren''t in a situation where you need this function.

Are you trying to do something specific or was this just a general question?

neneboricua
jimmynelson
jimmynelson
If you are trying to test collisions between a wall mesh and a car mesh you wouldn''t even be using mesh intersect. Look into bounding volumes. The idea is using a simple type object to contain your mesh and depending on how it collides, the results will effect your mesh.

Also collisions are one of the more, if not most, difficult aspects of game development. So if you don''t know about ray direction. You still have years ahead of you, including a course in college level linear algebra and a couple years of physics.

Also I am almost done with ellipsiod collisions based off of this link. Smart guys, the quadratic equation for finding line to point and line to line distances (including point of closest intersection) is a must.

http://www.peroxide.dk/papers/collision/collision.pdf

If anyone would like all my source is open, just email me.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.