how to get 2D position?

how to get 2D position?

Post by Jacek Pop?aws » Thu, 24 May 2001 23:44:04



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?

Post by Jacek Pop?aws » Fri, 25 May 2001 02:50:28



> 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?

Post by Robert A. Schmit » Fri, 25 May 2001 05:06:38


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?

Post by ZZ » Fri, 25 May 2001 06:27:55


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?

Post by Jacek Pop?aws » Fri, 25 May 2001 18:13:19



> 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

 
 
 

1. Getting Rotation/position data from Keyframer

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

2. Sony DSR-DU1 Hard Disk Recorder

3. Getting a ray from the camera through the mouse position

4. Raster/rle image to vector description algorithm/code needed

5. Getting the Mouse position at a click event

6. Printing Services

7. Getting the real translate positions

8. help to create realistic windows needed

9. Getting Mouse position in OnClick handler

10. I need basic functions for calculating positions of 2d points

11. please, help me for getting ray tracing code in 2D case

12. TEACHING POSITION, 2D, PRATT INSTITUTE, NYC

13. Getting a 3d distance from two 2d images?