Original Post
i got some weird problem when i used LPARAM variable of winproc CALLBACK function to obtain x and y screen coordinate of mouse (it's to check intersect of my Terrain (MeshFvF) using RAY), when I click on the terrain the result of D3DXIntersect return correct face index, But the problem appear when I try using : POINT pt; GetCursorPos( &pt ); // pt.x as mouse x coord. // pt.y as mouse y coord. when i click on terrain, for example in face 0, i got face index result larger than 0, and i for make sure, i click on empty space left of triangle face 0, i got face index result = 0 or above. so it's like the vertices of terrain and the loaded vertices of vertexbuffer are not in the same position. i have check all code...but nothing wrong... So..can somebody please explain to me what's the different between those two method above of gaining mouse coordinate......?? Do you have another better method to get mouse xy position ???? Thanx