PDA

View Full Version : scaling



fox
12-08-2000, 01:07 AM
what's the best way to determine the relative sizes of objects - say you are modelling objects in a room - also is there a way of finding the location you are in the scene relative to real-world coordinates

any examples?

pleopard
12-08-2000, 07:29 AM
You can get the coordinates of the last item you transformed from the modelview matrix as follows:

glMatrixMode(GL_MODELVIEW);
double mm[16];
glGetDoublev(GL_MODELVIEW_MATRIX,mm);
double x = mm[12];
double y = mm[13];
double z = mm[14];
double t = mm[15];

Hope that helps,
Paul Leopard

fox
12-11-2000, 03:02 AM
so where would the following code go - would have to set up an array?

glMatrixMode(GL_MODELVIEW);
double mm[16];
glGetDoublev(GL_MODELVIEW_MATRIX,mm);
double x = mm[12];
double y = mm[13];
double z = mm[14];
double t = mm[15];//what is this