Converting vertexes to pixels

Hello, I’m wondering how to convert a world coordinate, with x, y and z values, to x and y pixel values. I’ve seen the gluProject/gluUnproject methods, but ive heard they’re slow. Please help!

Depends on what do you want as result… image or numbers?

Well first of all, what do you mean by an image result? I just want the mouse location that is projected to the screen (in pixels) by a specific point in 3d space

Multiply by the whole enchilada that takes you into screen space - wrong if you’re following the spec to the letter as GL applies the perspective division before the viewport transform whereas DX performs it last. Mathematically they’re equivalent but numerically they’re likely to be different (as Yooyo points out).

I tend to do it the wrong way… hangs head in shame

Here’s the source code

Why would it be slow if you just want to transform just 1 position?