Re: [osg-users] Newbie Questions re: Camera control (I think)

2012-01-03 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Matthew,

Geodetic coordinates (lat,lon,alt) are typically mapped into some sort
of Cartesian coordinate system (x,y,z) (i.e. geocentric coordinates).
Setting the view matrix will operate in the latter CS.

The projection matrix does not control where you are looking. The view
matrix determines that. The projection matrix controls the viewing
frustum. Perhaps a review of the OpenGL transformation pipeline is
appropriate here.

Orientation (h,p,r) and position are concatenated together to form the
view matrix. This topic has been discussed on how to manually set the
view matrix to your liking.

If you need some code snippets to get started, that can be provided...:)

-Shayne 

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew
Runo
Sent: Monday, January 02, 2012 10:18 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Newbie Questions re: Camera control (I think)

Hi,

I found the CameraControl wiki page, but it has a warning that it's out
of date.. and I don't know how to update it to the osgViewer class
because I can't get to the documentation (that, and I'm reasonably new
to C++).

- Given a point in 3d space with World Coordinates (eg, Latitude,
Longitude, Altitude), how can I position the viewer at that point? I'm
thinking that I need to create a matrix with my points in it, and then
call camera.setViewMatrix(..). Is that correct? How do I convert my
world coordinates into coordinates that will work in the camera?

- Once I'm at that point, do I use camera.setProjectionMatrix to control
where I'm looking? For example, say I want to look due North at lat 26,
long -119, altitude 52.  

- Given a set of rotations that should happen to the camera (roll 3
degrees right, pitch 4 degrees up, etc), are those best handled by
looking at the examples from osgGA::FirstPersonManipulator and going
from there by building up a Matrix to use somewhere to rotate the
camera's view?

As of right now I've been tinkering with the code for the various
implementations of the osgGA::FirstPersonManipulator and learning quite
a bit - I just wanted to get these questions in my mind cleared up. I'm
sorry that they're so basic =\

Thank you very much for your help, and for this community full of
knowledge!

Thank you again,
Matthew

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44529#44529





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Newbie Questions re: Camera control (I think)

2012-01-03 Thread Matthew Runo
Hello -

I really appreciate your reply... part of my problem is not knowing the
proper terms to even be able to search for what I want... I think you're
correct in suggesting she reading about OpenGL as well. Do you happen to
have any suggestions?

I'll look around for converting the geodetic coordinates to cartesian
coordinates,  which I assume must be based on the GeoTIFF scale I used as
input.. That gives me something to search for!

I'll also look up the view matrix discussions you mentioned here.. thanks!

If course, any links to code, sample code, etc that you can provide would
be a great help for jumping off. Its much easier to search for class and
method names rather than abstract ideas..

Again, thank you!

Matthew
On Jan 3, 2012 7:19 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
shayne.tuel...@hill.af.mil wrote:

 Matthew,

 Geodetic coordinates (lat,lon,alt) are typically mapped into some sort
 of Cartesian coordinate system (x,y,z) (i.e. geocentric coordinates).
 Setting the view matrix will operate in the latter CS.

 The projection matrix does not control where you are looking. The view
 matrix determines that. The projection matrix controls the viewing
 frustum. Perhaps a review of the OpenGL transformation pipeline is
 appropriate here.

 Orientation (h,p,r) and position are concatenated together to form the
 view matrix. This topic has been discussed on how to manually set the
 view matrix to your liking.

 If you need some code snippets to get started, that can be provided...:)

 -Shayne

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew
 Runo
 Sent: Monday, January 02, 2012 10:18 AM
 To: osg-users@lists.openscenegraph.org
 Subject: [osg-users] Newbie Questions re: Camera control (I think)

 Hi,

 I found the CameraControl wiki page, but it has a warning that it's out
 of date.. and I don't know how to update it to the osgViewer class
 because I can't get to the documentation (that, and I'm reasonably new
 to C++).

 - Given a point in 3d space with World Coordinates (eg, Latitude,
 Longitude, Altitude), how can I position the viewer at that point? I'm
 thinking that I need to create a matrix with my points in it, and then
 call camera.setViewMatrix(..). Is that correct? How do I convert my
 world coordinates into coordinates that will work in the camera?

 - Once I'm at that point, do I use camera.setProjectionMatrix to control
 where I'm looking? For example, say I want to look due North at lat 26,
 long -119, altitude 52.

 - Given a set of rotations that should happen to the camera (roll 3
 degrees right, pitch 4 degrees up, etc), are those best handled by
 looking at the examples from osgGA::FirstPersonManipulator and going
 from there by building up a Matrix to use somewhere to rotate the
 camera's view?

 As of right now I've been tinkering with the code for the various
 implementations of the osgGA::FirstPersonManipulator and learning quite
 a bit - I just wanted to get these questions in my mind cleared up. I'm
 sorry that they're so basic =\

 Thank you very much for your help, and for this community full of
 knowledge!

 Thank you again,
 Matthew

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=44529#44529





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
 g
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Newbie Questions re: Camera control (I think)

2012-01-03 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Matthew,

Perhaps you can elaborate a bit more on what you're trying to accomplish with 
OSG. That way the community can be in a better position to offer some advice 
and help.

There are plenty of resources online that can help with understanding the 
OpenGL transformation pipeline. There's always the OpenGL redbook 
http://www.opengl.org/documentation/red_book/. Paul Martz has a great book as 
well that you can read for introduction http://www.opengldistilled.com/. This 
is a good place to start. 

If you google OpenGL transformation pipline, many hits and resources will 
come up that can help you.

As for converting geodetic to geocentric coordinates, OSG can help you with 
that. Take a look at the EllipsoidModel class in OSG...

Regards,
-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew Runo
Sent: Tuesday, January 03, 2012 8:32 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Newbie Questions re: Camera control (I think)

Hello - 

I really appreciate your reply... part of my problem is not knowing the proper 
terms to even be able to search for what I want... I think you're correct in 
suggesting she reading about OpenGL as well. Do you happen to have any 
suggestions?

I'll look around for converting the geodetic coordinates to cartesian 
coordinates,  which I assume must be based on the GeoTIFF scale I used as 
input.. That gives me something to search for!

I'll also look up the view matrix discussions you mentioned here.. thanks!

If course, any links to code, sample code, etc that you can provide would be a 
great help for jumping off. Its much easier to search for class and method 
names rather than abstract ideas..

Again, thank you!

Matthew

On Jan 3, 2012 7:19 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
shayne.tuel...@hill.af.mil wrote:


Matthew,

Geodetic coordinates (lat,lon,alt) are typically mapped into some sort
of Cartesian coordinate system (x,y,z) (i.e. geocentric coordinates).
Setting the view matrix will operate in the latter CS.

The projection matrix does not control where you are looking. The view
matrix determines that. The projection matrix controls the viewing
frustum. Perhaps a review of the OpenGL transformation pipeline is
appropriate here.

Orientation (h,p,r) and position are concatenated together to form the
view matrix. This topic has been discussed on how to manually set the
view matrix to your liking.

If you need some code snippets to get started, that can be provided...:)

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew
Runo
Sent: Monday, January 02, 2012 10:18 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Newbie Questions re: Camera control (I think)

Hi,

I found the CameraControl wiki page, but it has a warning that it's out
of date.. and I don't know how to update it to the osgViewer class
because I can't get to the documentation (that, and I'm reasonably new
to C++).

- Given a point in 3d space with World Coordinates (eg, Latitude,
Longitude, Altitude), how can I position the viewer at that point? I'm
thinking that I need to create a matrix with my points in it, and then
call camera.setViewMatrix(..). Is that correct? How do I convert my
world coordinates into coordinates that will work in the camera?

- Once I'm at that point, do I use camera.setProjectionMatrix to control
where I'm looking? For example, say I want to look due North at lat 26,
long -119, altitude 52.

- Given a set of rotations that should happen to the camera (roll 3
degrees right, pitch 4 degrees up, etc), are those best handled by
looking at the examples from osgGA::FirstPersonManipulator and going
from there by building up a Matrix to use somewhere to rotate the
camera's view?

As of right now I've been tinkering with the code for the various
implementations of the osgGA::FirstPersonManipulator and learning quite
a bit - I just wanted to get these questions in my mind cleared up. I'm
sorry that they're so basic =\

Thank you very much for your help, and for this community full of
knowledge!

Thank you again,
Matthew

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44529#44529





___
osg-users

Re: [osg-users] Newbie Questions re: Camera control (I think)

2012-01-03 Thread Matthew Runo
I'm just working on a project to learn OSG, etc. For now, I've written
a plugin for a flight simulator that will give me the GPS coords,
altitude, heading etc.. and I wanted to see if I could get OSG to
follow along with that data feed on my laptop.

That's why I was asking about positioning the camera in space - I
wanted to look at the same thing I was looking at in XPlane.  I
figured this would be a fun way to combine my interest in programming
and aviation, while learning OpenGL/C++/OSG in the process.

For now, I'll check out the EllipsoidModel. At first glance, it looks
like I'll be good friends with this method by the end of things:

void osg::EllipsoidModel::convertLatLongHeightToXYZ

Going from the little I know, I could take those XYZ coords and place
them into a matrix and then use that in the Viewer. I just need to
work backwards from the input to Camera-setViewMatrix to find the
APIs for creating that matrix..

--Matthew

On Tue, Jan 3, 2012 at 8:01 AM, Tueller, Shayne R Civ USAF AFMC 519
SMXS/MXDEC shayne.tuel...@hill.af.mil wrote:
 Matthew,

 Perhaps you can elaborate a bit more on what you're trying to accomplish with 
 OSG. That way the community can be in a better position to offer some advice 
 and help.

 There are plenty of resources online that can help with understanding the 
 OpenGL transformation pipeline. There's always the OpenGL redbook 
 http://www.opengl.org/documentation/red_book/. Paul Martz has a great book as 
 well that you can read for introduction http://www.opengldistilled.com/. This 
 is a good place to start.

 If you google OpenGL transformation pipline, many hits and resources will 
 come up that can help you.

 As for converting geodetic to geocentric coordinates, OSG can help you with 
 that. Take a look at the EllipsoidModel class in OSG...

 Regards,
 -Shayne

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew Runo
 Sent: Tuesday, January 03, 2012 8:32 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Newbie Questions re: Camera control (I think)

 Hello -

 I really appreciate your reply... part of my problem is not knowing the 
 proper terms to even be able to search for what I want... I think you're 
 correct in suggesting she reading about OpenGL as well. Do you happen to have 
 any suggestions?

 I'll look around for converting the geodetic coordinates to cartesian 
 coordinates,  which I assume must be based on the GeoTIFF scale I used as 
 input.. That gives me something to search for!

 I'll also look up the view matrix discussions you mentioned here.. thanks!

 If course, any links to code, sample code, etc that you can provide would be 
 a great help for jumping off. Its much easier to search for class and method 
 names rather than abstract ideas..

 Again, thank you!

 Matthew

 On Jan 3, 2012 7:19 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
 shayne.tuel...@hill.af.mil wrote:


        Matthew,

        Geodetic coordinates (lat,lon,alt) are typically mapped into some sort
        of Cartesian coordinate system (x,y,z) (i.e. geocentric coordinates).
        Setting the view matrix will operate in the latter CS.

        The projection matrix does not control where you are looking. The view
        matrix determines that. The projection matrix controls the viewing
        frustum. Perhaps a review of the OpenGL transformation pipeline is
        appropriate here.

        Orientation (h,p,r) and position are concatenated together to form the
        view matrix. This topic has been discussed on how to manually set the
        view matrix to your liking.

        If you need some code snippets to get started, that can be 
 provided...:)

        -Shayne

        -Original Message-
        From: osg-users-boun...@lists.openscenegraph.org
        [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
 Matthew
        Runo
        Sent: Monday, January 02, 2012 10:18 AM
        To: osg-users@lists.openscenegraph.org
        Subject: [osg-users] Newbie Questions re: Camera control (I think)

        Hi,

        I found the CameraControl wiki page, but it has a warning that it's out
        of date.. and I don't know how to update it to the osgViewer class
        because I can't get to the documentation (that, and I'm reasonably new
        to C++).

        - Given a point in 3d space with World Coordinates (eg, Latitude,
        Longitude, Altitude), how can I position the viewer at that point? I'm
        thinking that I need to create a matrix with my points in it, and then
        call camera.setViewMatrix(..). Is that correct? How do I convert my
        world coordinates into coordinates that will work in the camera?

        - Once I'm at that point, do I use camera.setProjectionMatrix to 
 control
        where I'm looking? For example, say I want to look due North at lat 26,
        long -119, altitude 52

Re: [osg-users] Newbie Questions re: Camera control (I think)

2012-01-03 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Do you have a database to fly around in? If not, take a look at 
VirtualPlanetBuilder to build one...:)

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew Runo
Sent: Tuesday, January 03, 2012 9:37 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Newbie Questions re: Camera control (I think)

I'm just working on a project to learn OSG, etc. For now, I've written
a plugin for a flight simulator that will give me the GPS coords,
altitude, heading etc.. and I wanted to see if I could get OSG to
follow along with that data feed on my laptop.

That's why I was asking about positioning the camera in space - I
wanted to look at the same thing I was looking at in XPlane.  I
figured this would be a fun way to combine my interest in programming
and aviation, while learning OpenGL/C++/OSG in the process.

For now, I'll check out the EllipsoidModel. At first glance, it looks
like I'll be good friends with this method by the end of things:

void osg::EllipsoidModel::convertLatLongHeightToXYZ

Going from the little I know, I could take those XYZ coords and place
them into a matrix and then use that in the Viewer. I just need to
work backwards from the input to Camera-setViewMatrix to find the
APIs for creating that matrix..

--Matthew

On Tue, Jan 3, 2012 at 8:01 AM, Tueller, Shayne R Civ USAF AFMC 519
SMXS/MXDEC shayne.tuel...@hill.af.mil wrote:
 Matthew,

 Perhaps you can elaborate a bit more on what you're trying to accomplish with 
 OSG. That way the community can be in a better position to offer some advice 
 and help.

 There are plenty of resources online that can help with understanding the 
 OpenGL transformation pipeline. There's always the OpenGL redbook 
 http://www.opengl.org/documentation/red_book/. Paul Martz has a great book as 
 well that you can read for introduction http://www.opengldistilled.com/. This 
 is a good place to start.

 If you google OpenGL transformation pipline, many hits and resources will 
 come up that can help you.

 As for converting geodetic to geocentric coordinates, OSG can help you with 
 that. Take a look at the EllipsoidModel class in OSG...

 Regards,
 -Shayne

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew Runo
 Sent: Tuesday, January 03, 2012 8:32 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Newbie Questions re: Camera control (I think)

 Hello -

 I really appreciate your reply... part of my problem is not knowing the 
 proper terms to even be able to search for what I want... I think you're 
 correct in suggesting she reading about OpenGL as well. Do you happen to have 
 any suggestions?

 I'll look around for converting the geodetic coordinates to cartesian 
 coordinates,  which I assume must be based on the GeoTIFF scale I used as 
 input.. That gives me something to search for!

 I'll also look up the view matrix discussions you mentioned here.. thanks!

 If course, any links to code, sample code, etc that you can provide would be 
 a great help for jumping off. Its much easier to search for class and method 
 names rather than abstract ideas..

 Again, thank you!

 Matthew

 On Jan 3, 2012 7:19 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
 shayne.tuel...@hill.af.mil wrote:


        Matthew,

        Geodetic coordinates (lat,lon,alt) are typically mapped into some sort
        of Cartesian coordinate system (x,y,z) (i.e. geocentric coordinates).
        Setting the view matrix will operate in the latter CS.

        The projection matrix does not control where you are looking. The view
        matrix determines that. The projection matrix controls the viewing
        frustum. Perhaps a review of the OpenGL transformation pipeline is
        appropriate here.

        Orientation (h,p,r) and position are concatenated together to form the
        view matrix. This topic has been discussed on how to manually set the
        view matrix to your liking.

        If you need some code snippets to get started, that can be 
 provided...:)

        -Shayne

        -Original Message-
        From: osg-users-boun...@lists.openscenegraph.org
        [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
 Matthew
        Runo
        Sent: Monday, January 02, 2012 10:18 AM
        To: osg-users@lists.openscenegraph.org
        Subject: [osg-users] Newbie Questions re: Camera control (I think)

        Hi,

        I found the CameraControl wiki page, but it has a warning that it's out
        of date.. and I don't know how to update it to the osgViewer class
        because I can't get to the documentation (that, and I'm reasonably new
        to C++).

        - Given a point in 3d space with World Coordinates (eg, Latitude,
        Longitude, Altitude), how can I position the viewer at that point? I'm
        thinking that I

Re: [osg-users] Newbie Questions re: Camera control (I think)

2012-01-03 Thread Matthew Runo
I already built one using VirtualPlanetBuilder and some GeoTIFF files
I got from the USGS Seamless server. I've been looking at that using
the example programs, trying to learn what's what.. VPB makes things
so simple, it's pretty amazing.

--Matthew

On Tue, Jan 3, 2012 at 9:33 AM, Tueller, Shayne R Civ USAF AFMC 519
SMXS/MXDEC shayne.tuel...@hill.af.mil wrote:
 Do you have a database to fly around in? If not, take a look at 
 VirtualPlanetBuilder to build one...:)

 -Shayne

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew Runo
 Sent: Tuesday, January 03, 2012 9:37 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Newbie Questions re: Camera control (I think)

 I'm just working on a project to learn OSG, etc. For now, I've written
 a plugin for a flight simulator that will give me the GPS coords,
 altitude, heading etc.. and I wanted to see if I could get OSG to
 follow along with that data feed on my laptop.

 That's why I was asking about positioning the camera in space - I
 wanted to look at the same thing I was looking at in XPlane.  I
 figured this would be a fun way to combine my interest in programming
 and aviation, while learning OpenGL/C++/OSG in the process.

 For now, I'll check out the EllipsoidModel. At first glance, it looks
 like I'll be good friends with this method by the end of things:

 void osg::EllipsoidModel::convertLatLongHeightToXYZ

 Going from the little I know, I could take those XYZ coords and place
 them into a matrix and then use that in the Viewer. I just need to
 work backwards from the input to Camera-setViewMatrix to find the
 APIs for creating that matrix..

 --Matthew

 On Tue, Jan 3, 2012 at 8:01 AM, Tueller, Shayne R Civ USAF AFMC 519
 SMXS/MXDEC shayne.tuel...@hill.af.mil wrote:
 Matthew,

 Perhaps you can elaborate a bit more on what you're trying to accomplish 
 with OSG. That way the community can be in a better position to offer some 
 advice and help.

 There are plenty of resources online that can help with understanding the 
 OpenGL transformation pipeline. There's always the OpenGL redbook 
 http://www.opengl.org/documentation/red_book/. Paul Martz has a great book 
 as well that you can read for introduction http://www.opengldistilled.com/. 
 This is a good place to start.

 If you google OpenGL transformation pipline, many hits and resources will 
 come up that can help you.

 As for converting geodetic to geocentric coordinates, OSG can help you with 
 that. Take a look at the EllipsoidModel class in OSG...

 Regards,
 -Shayne

 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org 
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Matthew Runo
 Sent: Tuesday, January 03, 2012 8:32 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Newbie Questions re: Camera control (I think)

 Hello -

 I really appreciate your reply... part of my problem is not knowing the 
 proper terms to even be able to search for what I want... I think you're 
 correct in suggesting she reading about OpenGL as well. Do you happen to 
 have any suggestions?

 I'll look around for converting the geodetic coordinates to cartesian 
 coordinates,  which I assume must be based on the GeoTIFF scale I used as 
 input.. That gives me something to search for!

 I'll also look up the view matrix discussions you mentioned here.. thanks!

 If course, any links to code, sample code, etc that you can provide would be 
 a great help for jumping off. Its much easier to search for class and method 
 names rather than abstract ideas..

 Again, thank you!

 Matthew

 On Jan 3, 2012 7:19 AM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC 
 shayne.tuel...@hill.af.mil wrote:


        Matthew,

        Geodetic coordinates (lat,lon,alt) are typically mapped into some sort
        of Cartesian coordinate system (x,y,z) (i.e. geocentric coordinates).
        Setting the view matrix will operate in the latter CS.

        The projection matrix does not control where you are looking. The view
        matrix determines that. The projection matrix controls the viewing
        frustum. Perhaps a review of the OpenGL transformation pipeline is
        appropriate here.

        Orientation (h,p,r) and position are concatenated together to form the
        view matrix. This topic has been discussed on how to manually set the
        view matrix to your liking.

        If you need some code snippets to get started, that can be 
 provided...:)

        -Shayne

        -Original Message-
        From: osg-users-boun...@lists.openscenegraph.org
        [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of 
 Matthew
        Runo
        Sent: Monday, January 02, 2012 10:18 AM
        To: osg-users@lists.openscenegraph.org
        Subject: [osg-users] Newbie Questions re: Camera control (I think)

        Hi,

        I found the CameraControl

[osg-users] Newbie Questions re: Camera control (I think)

2012-01-02 Thread Matthew Runo
Hi,

I found the CameraControl wiki page, but it has a warning that it's out of 
date.. and I don't know how to update it to the osgViewer class because I can't 
get to the documentation (that, and I'm reasonably new to C++).

- Given a point in 3d space with World Coordinates (eg, Latitude, Longitude, 
Altitude), how can I position the viewer at that point? I'm thinking that I 
need to create a matrix with my points in it, and then call 
camera.setViewMatrix(..). Is that correct? How do I convert my world 
coordinates into coordinates that will work in the camera?

- Once I'm at that point, do I use camera.setProjectionMatrix to control where 
I'm looking? For example, say I want to look due North at lat 26, long -119, 
altitude 52.  

- Given a set of rotations that should happen to the camera (roll 3 degrees 
right, pitch 4 degrees up, etc), are those best handled by looking at the 
examples from osgGA::FirstPersonManipulator and going from there by building up 
a Matrix to use somewhere to rotate the camera's view?

As of right now I've been tinkering with the code for the various 
implementations of the osgGA::FirstPersonManipulator and learning quite a bit - 
I just wanted to get these questions in my mind cleared up. I'm sorry that 
they're so basic =\

Thank you very much for your help, and for this community full of knowledge!

Thank you again,
Matthew

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44529#44529





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Newbie questions...

2010-04-07 Thread Ku Krapox
Hi Ulrich ,

Thanks for your reply!

My problems with callbacks are solved.

As for the keyboard handling, well, I think you're right, the addFunction 
method doesn't seem to belong to any osg class... but it's not part of my 
framework either!
Actually I just followed the official Keyboard Handler tutorial...
(Talking about this, I don't know if it's me but I find these tutorials quite 
poor and confusing... :?)


Anyway, if you have any idea... :) 


Cheers,
Ku

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26525#26525





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Newbie questions...

2010-04-07 Thread Ku Krapox
(the link of the tutorial)

http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/KeyboardHandler

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26526#26526





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Newbie questions...

2010-04-05 Thread Ulrich Hertlein
Hi,

On 1/04/10 20:47 , Ku Krapox wrote:
 Callbacks My problem is : I can get back the nodes of a geode if it's a 
 loaded model
 (like the tank), but I can't do the same for my own objects, such as simple 
 osg::Sphere
 loaded in an osg::Geode. What I do is I set the Geode's name to earth and I 
 call :
 
 Code: _earthNode = dynamic_cast \ osgSim::DOFTransform* \ 
 (findEarth.getFirst());
 
 ... which results in a NULL value in _earthNode. I've found out that the 
 dynamic_cast
 fails when the returned named object is a geode, but I don't know what object 
 should be
 named in my hierarchy to be handled sucessfully by a DOFTransform? Or should 
 I use
 something else than a DOFTransform??

If the node you found isn't derived from DOFTransform then the dynamic_cast 
will fail.
Since you mention osg::Geode maybe you should cast to that instead, if that is 
what it is?

 Code: _KEH-addFunction(' ', buildGraph);
... 
 Im doing exactly what is in the tutorial, except that everything is in a 
 class, but it
 fails to build with the following error :
 
 1.\CGraph.cpp(49) : error C3867: 'graphs::CGraph::buildGraph': function 
 call missing
 argument list; use 'graphs::CGraph::buildGraph' to create a pointer to 
 member

Is 'addFunction' an osg function or is it from your framework?  I can't find 
any reference
to that in the soruce.

Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Newbie questions...

2010-04-01 Thread Ku Krapox
Hi everyone,

As I'm new to OSG and the community i'm not sure if this is an appropriate 
place for a newbie's questions, but i'm having much difficulty to learn some 
specifics... :-* 
In particular, I'm stucked with callback functions and keyboard handling.


Callbacks
My problem is : I can get back the nodes of a geode if it's a loaded model 
(like the tank), but I can't do the same for my own objects, such as simple 
osg::Sphere loaded in an osg::Geode. What I do is I set the Geode's name to 
earth and I call :

Code:
_earthNode = dynamic_cast \ osgSim::DOFTransform* \ (findEarth.getFirst());


... which results in a NULL value in _earthNode. I've found out that the 
dynamic_cast fails when the returned named object is a geode, but I don't know 
what object should be named in my hierarchy to be handled sucessfully by a 
DOFTransform? Or should I use something else than a DOFTransform??


Keyboard Events Handling
Here's the kind of code I'm writing :

Code:
_KEH-addFunction(' ', buildGraph);


buildGraph() beeing declared in the .h and beeing defined just below in the .cpp

Code:
void buildGraph();


 Im doing exactly what is in the tutorial, except that everything is in a 
class, but it fails to build with the following error :

 1.\CGraph.cpp(49) : error C3867: 'graphs::CGraph::buildGraph': function call 
 missing argument list; use 'graphs::CGraph::buildGraph' to create a pointer 
 to member

Is anyone familiar with this compilation error?... I don't see what argument 
list is missing, since my function doesn't take any...


Any help on any of these topics would be greatly appreciated!
Thanks in advance!  :) 

Cheers,
Ku

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26347#26347





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org