## how to get 2D position?

### how to get 2D position?

I draw object, or just one vertex in 3D. Is it a way to _get_ from OpenGL it 2D
screen position? (I don't want to calculate it, just get)

--
Turn round slowly
Tell us what you see
Oh no - The fly got the spider
And now he's chasing me                        "Otherworld" - Ronnie James Dio

### how to get 2D position?

> But I repeat: That's all really * stuff... (Arrrgh... )

so in conclusion - if I glVertex3f(x,y,z) - there is no GL function which
returns me xscreen and yscreen ?

--
Well it's a cold world  And I'm in the middle
Caught in the in-between  I don't belong here
So I'm writing to you  It's wrong here                     "Letters From Earth"
Where I'm sending you some  Letters from Earth              - Ronnie James Dio

### how to get 2D position?

It's not hard. Look at gluProject. It will project a 3D point into 2D space
given modelview, projection, and viewport values. From the
MSDN Library:

gluProject
The gluProject function maps object coordinates to window coordinates.

int gluProject(
GLdouble objx,
GLdouble objy,
GLdouble objz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *winx,
GLdouble *winy,
GLdouble *winz
);
Parameters
objx, objy, objz  The object coordinates.
modelMatrix The current modelview matrix (as from a glGetDoublev call).
projMatrix The current projection matrix (as from a glGetDoublev call).
viewport The current viewport (as from a glGetIntegerv call).
winx, winy, winz The computed window coordinates.

Remarks
The gluProject function transforms the specified object coordinates into window coordinates using modelMatrix, projMatrix, and
viewport. The result is stored in winx, winy, and winz. A return value of GL_TRUE indicates success, and GL_FALSE indicates failure.

> > But I repeat: That's all really * stuff... (Arrrgh... )

> so in conclusion - if I glVertex3f(x,y,z) - there is no GL function which
> returns me xscreen and yscreen ?

> --
> Well it's a cold world  And I'm in the middle
> Caught in the in-between  I don't belong here
> So I'm writing to you  It's wrong here                     "Letters From Earth"
> Where I'm sending you some  Letters from Earth              - Ronnie James Dio

Bob
--
Robert A. Schmitt
RESolution Graphics Inc.

### how to get 2D position?

use gluProject(..)

--
lets hear it 4 billy bollux and his AMAZING bouuuncing balls
zed zeek - big bollucked king of the world , messiah , and all round nice guy.
GET IT HERE http://www.veryComputer.com/;FREE BOLLUX

> > But I repeat: That's all really * stuff... (Arrrgh... )

> so in conclusion - if I glVertex3f(x,y,z) - there is no GL function which
> returns me xscreen and yscreen ?

> --
> Well it's a cold world  And I'm in the middle
> Caught in the in-between  I don't belong here
> So I'm writing to you  It's wrong here                     "Letters From
Earth"
> Where I'm sending you some  Letters from Earth              - Ronnie James Dio

### how to get 2D position?

> It's not hard. Look at gluProject.

thanks! I will read about it

Quote:> From the MSDN Library:

there is no MSDN on my Linux workstation :-d

--
You've seen them walking on the water
You've seen flying through the sky
They were frightening in the darkness               "Egypt (The Chains Are On)"
They had rainbows in their eyes                             - Ronnie James Dio

I've been trying to get rotation and position information from 3DS's Keyframer.
I've used the Keyscripter to make a script that uses the GetXForm command
to pull data for each frame.  I haven't had success with it -- when I process
the data into my (Sony PSX) program, the objects appear to be oriented
incorrectly.  Has anyone done something like this before? Could you post the
script file / ipas module you used? (I wish!)

Dave