Using the mouse with Direct3D

I am trying to implement a sort of drag&drop with 3d primitives in Dirct3D, in fact D3DX. The problem is that i'm not too good with 3d transformations, especially those regarding vewing and projection. The screen coordinates of the cursor do not help me. What I need is vector that has the origin in the camera and points towards the space position of the cursor. After that i can intersect it with the primitives and find out which one is under the cursor from the camera's perpsective. If you can help me build this vector I think I'll handle the rest.
So if you know how to localize the mouse cursor in 3d space, please reply. Thanks!

Comments

  • : I am trying to implement a sort of drag&drop with 3d primitives in Dirct3D, in fact D3DX.

    There is a sample in the DirectX SDK called 'Pick', which implements this technique.
    --
    [italic][blue]Sunlight[/blue][/italic]


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion