gluProject help

Moderator
Posts: 608
Joined: 2002.04
Post: #1
How do I get the model, view and projection matrix for calling gluProject?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Code:
GLdouble modelviewMatrix[16];
GLdouble projectionMatrix[16];
GLint viewport[4];

glGetDoublev(GL_MODELVIEW_MATRIX, modelviewMatrix);
glGetDoublev(GL_PROJECTION_MATRIX, projectionMatrix);
glGetIntegerv(GL_VIEWPORT, viewport);
Quote this message in a reply
Member
Posts: 196
Joined: 2002.04
Post: #3
Hmm I don't know, but I looked in the command line (typed in "man gluProject"). Try glGet maybe?? I'm not sure so type in "man glGet" in the command line to get the details. I've been looking for something to output the current verticies like something below. If any one can help me out too that would be nice.

glTranslatef(x,y,z);
glRotate(angle, 0.0, 0.0, 1.0);
// print out what x and y equal after they're rotated by "angle".

Iceman

Update: Dang OSC got his post out before I was done typing!
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #4
Is this a record? OSC answered a question in 12 minutes.


Thanks!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
Nah I'm usually much faster.

Iceman, you can multiply by the modelview matrix to figure out where your vertices are getting transformed to, not sure if that's really what you want to do, though.
Quote this message in a reply
Member
Posts: 196
Joined: 2002.04
Post: #6
Faster?!!LOL I guess that's what I feared about using OpenGL to get the transformation; it would be way over my head with matrices and suchWacko. I'm using another method for now anyway; I just use radians, cosine, and sine to calculate it.

Thanks,
Iceman
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Two gluProject points? mikey 5 4,950 Jan 5, 2012 01:03 PM
Last Post: mikey
  Hierarchy, gluProject and collision detection lemtoo 3 4,651 Nov 30, 2007 09:26 AM
Last Post: lemtoo
  gluProject <-> gluUnproject help please szgezu 9 7,152 Feb 26, 2006 11:50 AM
Last Post: szgezu