So, my new test code is:
//Plane with Z = objectZCoordfloat A = 0.0f;float B = 0.0f;float C = -1.0f;float D = objectZCoord;D3DXVECTOR3 R0 = rayStart;D3DXVECTOR3 Rd = rayEnd;//Already tested and they're okD3DXVECTOR3 Pn = D3DXVECTOR3(A, B, C);float Vd = D3DXVec3Dot(&Pn, &Rd);float V0 = - ( D3DXVec3Dot(&Pn, &R0) + D);float t = V0 / Vd;float Xi = R0.x + Rd.x * t;float Yi = R0.y + Rd.y * t;float Zi = R0.z + Rd.z * t;
rayStart and rayEnd were calculated using D3DXVec3Unproject() already posted previously. I *think* (but now I've no more certainties) that they're ok.
The Zi value is equal (except for a little approximation) to the objectZCoord.
But the Xi and Yi values aren't correct. For "correct" I mean that they are not under my mouse icon on screen...
Am I missing something??
If you want I can post some real values to play with.