2
$\begingroup$

I am currently programming something, and I'm stuck on how to take a 3D vector, then project it on a screen. Say $X_s$ = the screen width and $Y_s$ = the screen height, Pa = pitch and $Y_a$ = yaw, $X_p$ and $Y_p$ are the positions, how would I achieve this effect?

For instance, say I want to draw a name directly above a 3D object.And the only function I have is to draw text on a screen. That means the only thing I need to know is how to calculate the $X$ and $Y$ positions.

Thanks in advance! :)

  • 0
    (concerning $a$ set it to $1$ first it is a overall 'zoom factor').2012-11-25

1 Answers 1

1

Are you using OpenGL? If that's the case, you may get the current projection matrix from opengl and multiply a position with the matrix

  • 0
    Nope, D3D. And even if it did, I probably wouldn't be able to access that, since I am programming this within a game. (I guess you could call it programming a plugin or tool.)2011-06-18