PDA

View Full Version : problems with objectwidth in pixels



elimin8tor
02-16-2002, 02:58 AM
Hi, I asked how to find out how wide an object is in pixels, and somebody said that I should use gluProject, but I simply can't work out how to use that.
// Set the clipping volume
gluPerspective(90,ratio,0.1,1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0, 1.75, 5,
0,1.75,4,
0.0f,1.0f,0.0f);

that is my code in the change size function, and the object which pixel width I'm trying to find out looks like this: (it is an isometric tile)
glVertex3f(0.0,0 ,0.0f);
glVertex3f(0.5,0.25 ,0.0f);
glVertex3f(1 ,0 ,0.0f);
glVertex3f(0.5,-0.25,0.0f);

Can anybody explain to me how to use gluProject in this case or just tell me how to calculate the pixel width with another method?
thx

PS. My program runs with glut full screen mode at 1024x768

[This message has been edited by elimin8tor (edited 02-16-2002).]