• Create Account

### #ActualFXACE

Posted 14 May 2012 - 12:05 PM

So, what you need to do is:
1. To project the vertex of your icon's position in 3d-space (you can use gluProject, for example)
2. Now you have got a position in window space. Go to orthogonal projection and draw it:
glOrtho(0,vp[2],0,vp[3],0,1); // NOTE: vp - is "int viewport[4]" which you used in gluProject
//double  wpos[3] - output from gluProject (window position)
//double iconSize; - in pixels
glVertex3d(wpos[0] - 1 * iconSize, wpos[1] - 1 * iconSize, wpos[2]);
glVertex3d(wpos[0] + 1 * iconSize, wpos[1] - 1 * iconSize, wpos[2]);
glVertex3d(wpos[0] + 1 * iconSize, wpos[1] + 1 * iconSize, wpos[2]);
glVertex3d(wpos[0] - 1 * iconSize, wpos[1] + 1 * iconSize, wpos[2]);
glEnd();
// this would draw quadratic at 3D position with fixed size in pixels

That's little example on how to do that.

Best wishes, FXACE.

### #1FXACE

Posted 14 May 2012 - 12:05 PM

So, what you need to do is:
1. To project the vertex of your icon's position in 3d-space (you can use gluProject, for example)
2. Now you have got a position in window space. Goto to orthogonal projection and draw it:
glOrtho(0,vp[2],0,vp[3],0,1); // NOTE: vp - is "int viewport[4]" which you used in gluProject
//double  wpos[3] - output from gluProject (window position)
//double iconSize; - in pixels