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

D3DXIntersect point

Started by mickeyren Oct 7, 2008 at 11:16 AM 1 replies 550+ views
Original Post
mickeyren
mickeyren
Hi So i use a mouse to select a mesh in a scene, i need to exactly get the mouse ray intersection point. If i have a box, and i point the mouse cursor to the right side, i wish to "push" that box on that specific point so then the box would tend to rotate to the right. If i point the mouse cursor to the left, then the box should tend to rotate to the left. Thanks!
Evil Steve
Evil Steve
Ok - what's your actual question? D3DXIntersect will give you the intersection point (Ray origin + Tay direction * intersection distance), how you use that is up to your code.
mickeyren
mickeyren
Oh i guess your reply pretty much answer my question, hope it works!

strange that i find other posts here that do something like this:

V1 = Face-coord 1 ( you get the face which is collided with )
V2 = Face-coord 2 ( so you are able to calculate or look them up )
V3 = Face-coord 3 ( and find there vertices )
IntersectCoord = V1 + pU*(V2-V1) + pV*(V3-V1);

http://www.gamedev.net/community/forums/topic.asp?topic_id=113947 (last post)

to calculate the intersection point.

Topic Locked

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

Sign in to reply to this topic.