I'm trying to model a application where a 3d object is loaded from a .x file and I need to get the user input specifying which part of the object the user clicked on.
something like image map in 2d..... I need it in a 3d object (where it can be rotated...etc)
does anyone have ideas how to map between 3d sub meshes and get on which sub msh the user clicked on
Thanks in advance

how to detect a 3d sub mesh where the mouse is on
to_hitesh
Joe Pontes
Thanks very much friend
Womster
I think u should only unproject vectors to do fustrum culling and stuff.
For mouse on mesh i would use the camera information.
You set your view transform using camera position (vEye) and camera target (vLookAt)
So i guess it would be better if u substract the camera target and position to use as ray for the intersect. u should also normalize the ray direction (result of substract). Using the far and near plane, hasnt any use i think cause a ray intersect will check if the ray is before or behind the object u want to intersect.
vDir = Microsoft.DirectX.Vector3.Subtract(vLookat, vEye)
vDir.normalize()
If mesh.Intersect(vEye, vDir, ClosestHit) = True Then
...
end if
William the Armadillo
It could be that one or more of those matrices is identity, but odds are if that is the case you understand the purpose of all those matrices well enough that you wouldn't be asking this question.
JoshSommers
These function return information about the face intersected with the ray.
Look at the mesh function in the SDK docs, there are several ray intersection function.
Sridevi113347
scolbath
http://dotnetforums.net/showthread.php t=88480
Joe Bilbro
Yes pretty much, though in a 3rd person shooter you have to take into account the position of walls etc, to make sure you didn't succesfully shoot someone behind an object. Also using the screen coordinates is only useful for the player character. Other characters shooting each other need to set up their own ray to project and you can obviously do all of that in world space, requiring only a projections from world into object space for the mesh.intersection.