RE: [Flightgear-devel] Screen to cartesian co-ords?

2004-11-05 Thread Paul Surgeon
On Friday, 5 November 2004 15:16, Aaron Wilson wrote:
> Paul,
>  You may want to look into the
gluUnProject(...) function.
> Aaron

Thanks Aaron.

I have it all working nicely with glReadPixels and
gluUnProject.
Not sure exactly how the Z cursor component is
determined but it seems to work just fine and the
resulting lat and lon values look correct.
I think I'll just leave the blackbox alone and get
back to writing the taxiway code.

Paul






___ALL-NEW Yahoo! Messenger - 
all new features - even more fun! http://uk.messenger.yahoo.com

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


RE: [Flightgear-devel] Screen to cartesian co-ords?

2004-11-05 Thread Aaron Wilson
Paul,
You may want to look into the gluUnProject(...) function.
Aaron
At 04:29 PM 11/4/2004, you wrote:
Thanks, that makes a lot more sense to me now.
I'll see what I can glean from the PPE code.
On Thursday, 4 November 2004 23:06, Norman Vine wrote:
> RE: [Flightgear-devel] Screen to cartesian co-ords?
> If you have enabled DepthBuffer operations in OpenGL
> the rasterizing process keeps track of the depth
component
> of each pixel in the ZBuffer.
>
> Note this won't work to well with wireframe and that
the
> Z component is the distance from the eyepoint
>
> =
>
> For an example that does this using SSG
>
> PPE keeps track of the position for a 3d Cursor
>
> $PPE_SRC / src / viewer / ppeViewerDraw.cxx /
ppeViewer::update_3D_cursor()
>
> Note I am quite swamped with work and won't have
time
> to explain the PPE code but you have the source :-)
>
> http://prettypoly.sourceforge.net/
>
> Norman


___ALL-NEW Yahoo! 
Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


RE: [Flightgear-devel] Screen to cartesian co-ords?

2004-11-04 Thread Paul Surgeon
Thanks, that makes a lot more sense to me now.
I'll see what I can glean from the PPE code.


On Thursday, 4 November 2004 23:06, Norman Vine wrote:
> RE: [Flightgear-devel] Screen to cartesian co-ords?
> If you have enabled DepthBuffer operations in OpenGL
> the rasterizing process keeps track of the depth
component
> of each pixel in the ZBuffer.
>
> Note this won't work to well with wireframe and that
the
> Z component is the distance from the eyepoint
>
> =
>
> For an example that does this using SSG
>
> PPE keeps track of the position for a 3d Cursor
>
> $PPE_SRC / src / viewer / ppeViewerDraw.cxx /
ppeViewer::update_3D_cursor()
>
> Note I am quite swamped with work and won't have
time
> to explain the PPE code but you have the source :-)
>
> http://prettypoly.sourceforge.net/
>
> Norman






___ALL-NEW Yahoo! 
Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


RE: [Flightgear-devel] Screen to cartesian co-ords?

2004-11-04 Thread Norman Vine
Paul Surgeon writes:
> 
> On Thursday, 4 November 2004 22:02, Aaron Wilson
> wrote:
> > Paul,
> >  NeHe has a good example of how to convert
> the screen coordinates
> > into OpenGL coordinates.
> >
> http://nehe.gamedev.net/data/articles/article.asp?article=13
> >
> > Aaron
> 
> I found that article very helpful.
> 
> The part I don't understand is how the glReadPixels
> get's the winZ co-ordinate.
> I mean I'm looking at a wireframe ellipsoid from an
> odd angle - how does it know how to return the Z
> co-ordinate of the surface of the ellisoid?
> Surely I have to tell it where the surface is so that
> it knows how to intercept the surface and not try to
> pick a point into infinity (in front of and behind my
> cursor)?
> 
> That is what is not explained anywhere I look.

If you have enabled DepthBuffer operations in OpenGL
the rasterizing process keeps track of the depth component
of each pixel in the ZBuffer. 

Note this won't work to well with wireframe and that the
Z component is the distance from the eyepoint

=

For an example that does this using SSG

PPE keeps track of the position for a 3d Cursor

$PPE_SRC / src / viewer / ppeViewerDraw.cxx / ppeViewer::update_3D_cursor()

Note I am quite swamped with work and won't have time
to explain the PPE code but you have the source :-)

http://prettypoly.sourceforge.net/

Norman

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Screen to cartesian co-ords?

2004-11-04 Thread Paul Surgeon
On Thursday, 4 November 2004 22:02, Aaron Wilson
wrote:
> Paul,
>  NeHe has a good example of how to convert
the screen coordinates
> into OpenGL coordinates.
>
http://nehe.gamedev.net/data/articles/article.asp?article=13
>
> Aaron

I found that article very helpful.

The part I don't understand is how the glReadPixels
get's the winZ co-ordinate.
I mean I'm looking at a wireframe ellipsoid from an
odd angle - how does it know how to return the Z
co-ordinate of the surface of the ellisoid?
Surely I have to tell it where the surface is so that
it knows how to intercept the surface and not try to
pick a point into infinity (in front of and behind my
cursor)?

That is what is not explained anywhere I look.

Paul






___ALL-NEW Yahoo! Messenger - 
all new features - even more fun! http://uk.messenger.yahoo.com

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Screen to cartesian co-ords?

2004-11-04 Thread Aaron Wilson
Paul,
NeHe has a good example of how to convert the screen coordinates 
into OpenGL coordinates. 
http://nehe.gamedev.net/data/articles/article.asp?article=13

Aaron
At 01:13 PM 11/4/2004, you wrote:
I've built a WGS84 model of the world using SimGear
routines and need some way of being able to click and
draw on the surface of the ellipsoid.
Does anyone know an "easy" way to transform a screen
co-ordinate into an OpenGL cartesian co-ordinate?
(Which I can then convert to polar co-ordinates)
Thanks
Paul


___ALL-NEW Yahoo! 
Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d