Hi everybody,

I am using osgART for an AR project I'm currently working on, which joins osg 
and ARTookit -- but since my question is rather regarded to osg, I'm asking you 
folks...

In osgART the developers seem to create a custom camera they place inside the 
scenegraph, under a transform node which continuously gets updated regarding to 
ARToolkit tracking results.

Well, I'm using a CompositeViewer to create two views in seperate render 
windows rendering the same scene. Only one view is showing the scene updated 
from AR tracking, the other one is supposed to show the scene from a position I 
want to be able to modify in my code.

For consistency reasons I really want to create the camera for my second view 
the same way osgART does in the first view, this looks pretty straight forward 
in their code: 

Code:
osg::Camera* 
Calibration::createCamera() const
{
        osg::Camera* cam = new osg::Camera();
        cam->setRenderOrder(osg::Camera::NESTED_RENDER);
        cam->setProjectionMatrix(_projection);
        cam->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
        cam->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

        return cam;     
}


In the example code which is provided the so created camera simply gets added 
to the scene graph in some position (below this AR-transform node I mentioned 
above) and that's it. (Question aside: What happens to the default camera in 
this case? And: Can I get rid of it/replace it?)

If I do this the exactly same way my view seems to continue to render from the 
default camera created within the view instance. Do you have an idea what I am 
missing there? I debugged into osgART and couldn't find some view.addSlave() or 
something similar. 

Unfortunately I'm a little overstrained by the tremendous extent of osg, the 
available guides seem to be scattered about several websites, wikis, tutorials, 
etc. while the actual (doxygen) documentation is very sketchy and little 
illuminating. as you might know this makes it very difficult for beginners to 
get into it. I found examples using osgProducer::Viewer, or Producer::Camera, 
slave cameras and many funny things I wonder why there have to be so many 
different ways of implementing, but I really would like to keep my way of 
creating this cam consistent to the way it is done in osgART -- there really 
has to be a very simple way to do this in a clean way but I cannot find it. 

Thanks for reading through all of this, and thanks in advance for your help.

PS: A few weeks ago I tried to replace the default viewer camera by the custom 
camera to not have a camera that is not needed anyway but I failed finding a 
way to do this. Is this possible anyway?

PPS: What is it about this default camera anyway? It looks kind of weird to me 
that the default camera is not part of the scenegraph, after all it's a node 
like everyone else. Or did I get something wrong here? Maybe someone can point 
me to a place where this whole osg-architecture is explained in detail so this 
is clarified once and for all IN A COMPACT WAY? (If I had enough time, I would 
enjoy reading into everything I can find but unfortunately I haven't...) Every 
time I debug into osg::Viewer I wonder how this all works together...

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





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

Reply via email to