translation/rotation of a HUD against a camera using vectors in Euclidian 3D space

Posted by Jakob on Stack Overflow See other posts from Stack Overflow or by Jakob
Published on 2010-03-27T13:10:14Z Indexed on 2010/03/27 13:13 UTC
Read the original article Hit count: 370

Filed under:
|
|

i've got 2 points in 3D space: the camera position and the camera lookAt.

the camera movement is restricted akin to typical first person shooter games. you can move the cam freely, tilt horizontally and up to 90 degrees vertically, but not roll.

so now i want to draw a HUD to the screen, on which i can move the mouse freely, with the position of the cursor correctly translating into 3D space.

the easy part was to draw something directly in front of the camera.

V0 = camPos;
V1 = lookAt;
V2 = lookAt-camPos;
normalize V2;
mutiply V2 according to camera frustum
V3 = V0+V2
draw something at V3

now the part i don't get: i could use V3 and add to that the rotations of the cam combined with the x/y of the mouse cursor, somehow, right? that's what i want.

© Stack Overflow or respective owner

Related posts about 3d

Related posts about camera