MeierLink
Thanks!
Well I'm doing something like this, but when some transformations are applied, the picking is not accurate in Orthogonal projection. However, the PerspectiveFOV is perfect.
That's Exactly what I'm doing:
D3DD.GetViewport(VP);
D3DD.GetTransform(D3DTS_PROJECTION, PM);
D3DD.GetTransform(D3DTS_VIEW, VM);
D3DXVec3Unproject(VOut1,
D3DXVector3(X, Y, 0.0),
VP,
PM, VM, WorldMatrix);
D3DXVec3Unproject(VOut2,
D3DXVector3(X, Y, 1.0),
VP,
PM, VM, WorldMatrix);
//WorldMatrix is the world transformation matrix for the tested mesh
//The same is if it is got like this: D3DD.GetTransform(D3DTS_WORLD, VM);
//I test with the IntersectTriangle function as it is in the Picking demo from the DXSDK. D3DXIntersect function does the same result.
IntersectTriangle(VOut1,
VOut2,
v0, v1, v2,
fDist, fBary1, fBary2)
Sorry for reviving this thread, but there seems to be immeasurably difficult to find a woking piece of code for ortho-picking. I found people that had the exactly same problem, but found no answer :/ I still need this, and I think it would be nice and very helpful to have a practically working solution here. Well has anyone some working code