View Full Version : converting between coordinate schemes...

11-17-2000, 12:34 AM
I am using a perspective transformation
as follows:



Under this scheme, I understand the plane of my screen is at z=0.1 and he origin lies at the centre of the screen....correct?

What I would like to do, is convert my game coordinates into screen pixels and vice versa.

does anyone have a formula for this?....
I currently have loads of bits of paper, littered with pytharous' theorum and
basic trig equations, but nothing which
clearly does what I want...

Basically, what I want, is a formula
which say that A pixels across the screen
represents Y world units, and
B pixels down the screen represents Z world units.

I need this for a utility class, which will
overlay 2d bitmaps onto my 3d stuff, drawing
them as 3d textured mapped quads in the plane z=0.0;


11-18-2000, 10:30 AM
I think that this is a job for gluProject() and gluUnproject(). It does all the useful linear algebra for you.