Martin,

I needed something similar and I was able to achieve it quite well with
the SphericalManipulator.

So far, I have 3 'home' positions and I move to them by pressing x, y,
or z.. Pressing one of the buttons aims the camera to the center of the
model along a vector parallel to the x, y, or z axis (depending on what
was pressed). If the center of the model is at (0,0,0), then the camera
will lie on one of the axis and point towards the origin. I didn't put
this in the manipulator though -- I put it in an EventHandler.

When the handler detects an x,y, or z keypress, it figures out the
current camera position and the desired camera positions. It then
calculates a path between the two and breaks it up into a number of
discrete steps. These intermediate positions are stored in a vector. On
each FRAME event, I pop_back() a position and set the camera to it. The
result is a pretty slick effect where the camera glides from the current
location to the desired 'home' position.

Cory

Martin Beckett wrote:
> When I get back I'll take another look at Spherical manipulator and see if it 
> can be extended to do everything I need.
>
> The important points were to be able to have front/left/right/plan 'home' 
> positions and the ability to lock rotation around each axis.
> Mainly for people using real world (CAD/GIS) data that has a definite UP - it 
> gets confusing if they can't see anything because they have the terrain 
> upside down, or they go to look at a detail and throw the model off into the 
> distance.
>
> I think I needed to have access to a calculated home in matrix manipulator 
> that wasn't public. I don't have the code here
>
>
> Cheers
> Martin
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=12550#12550
>
>
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>   
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to