Transforming a 3d point onto screen space

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
PumpkinPieman
Posts: 13
Joined: Fri Apr 20, 2007 4:35 pm

Transforming a 3d point onto screen space

Post by PumpkinPieman »

I've been recently been having problems getting this going. Basically what I'm trying to do is take a 3d point with the camera applied and transform that point to screen space. I'm going to use this for calculating an offset for drawn screen space sprites on an isometric grid (2.5d).

From the things I've been looking at it seems as simple as multiplying
A= World*View*Proj*ViewPointScaleMat
b= vector(x, y, z);
v[4] = Ab
for i 0..2
v /= v[3];

I've also tried many variations but I can't seem to get this working. All the values I get are way off screenspace, so I'm not sure how to approach this.

Thanks. :)
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

You can use ISceneCollisionManager::getScreenCoordinatesFrom3DPosition for this
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply