Hi Raqin,

I'm afraid I just don't understand the what you are trying to do and
why.  I'm just getting more confused.  Perhaps others can spot what
you are trying to do and how to do it.

Robert.

On Thu, Feb 12, 2009 at 5:48 PM, Ruqin Zhang <ruzh...@gmail.com> wrote:
> Hi Robert,
>
> Unfortunately it is. I set the object's geometry center as dragger position.
> And I tried to
> Add the dragger to the master camera, it works fine except I cannot make it
> post rendering
> this way. I even tried this: ("camera" is the slave camera for dragger)
>
>        change: _viewer->addSlave(camera.get(), false);
>                 to:_viewer->addSlave(camera.get(), true);
>
> Here I am supposed to get the sceneData rendered in both master and slave
> cameras. If
> these two cameras are identical to each other, such two renderings should
> overlap to each
> other perfectly. While, I can see some separation between them. Since the
> sceneData's for
> each camera is the same. I think the problem is only about the cameras. What
> you think?
> Thanks!
>
> Ruqin
>
>
> On Thu, Feb 12, 2009 at 11:07 AM, Robert Osfield <robert.osfi...@gmail.com>
> wrote:
>>
>> HI Ruqin,
>>
>> Is this an issue of position of the dragger and not cameras?  It looks
>> lie the cameras are doing just fine to me.
>>
>> Robert.
>>
>> On Thu, Feb 12, 2009 at 4:52 PM, Ruqin Zhang <ruzh...@gmail.com> wrote:
>> > Thanks Robert,
>> >
>> > Here is the setup:
>> >
>> > (1) For viewer and master camera:
>> >     _viewer = new osgViewer::Viewer;
>> >     _viewer->getCamera()->setGraphicsContext(this);
>> >     _viewer->getCamera()->setViewport(0, 0, size.x, size.y);
>> >     _viewer->getCamera()->setClearColor(*new osg::Vec4(0.75, 0.85, 0.95,
>> > 0));
>> >     _viewer->addEventHandler(new osgViewer::StatsHandler);
>> >     _viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
>> >     osg::ref_ptr<osgGA::StateSetManipulator> statesetManipulator =
>> >                  new
>> > osgGA::StateSetManipulator(_viewer->getCamera()->getStateSet());
>> >     _viewer->addEventHandler(statesetManipulator.get());
>> >     // Create the ASDS Graphical Picker instance and add it as an event
>> > handler
>> >     _viewer->addEventHandler(ASDSGraphicalPicker::instance());
>> >
>> > (2) For Camera manipulator:
>> >     _tbm = new osgGA::TrackballManipulator;
>> >     _tbm->setNode(ASDSScene::instance()->getPartsMatrix().get());
>> >     _tbm->setAutoComputeHomePosition(false);
>> >     _tbm->setTrackballSize(0.5);
>> >     _viewer->setCameraManipulator(_tbm.get());
>> >
>> > (3) For slave camera:
>> >     camera->setGraphicsContext(this);
>> >     camera->setViewport(_viewer->getCamera()->getViewport());
>> >     camera->setClearMask(GL_DEPTH_BUFFER_BIT);
>> >     // Add the dragger branch as the child of this slave camera
>> >     camera->addChild(ASDSScene::instance()->getDraggerBranch().get());
>> >
>> > I also attach a screenshot. The dragger should be in the center of the
>> > right
>> > tire. But it is not.
>> > Let me know if I did anything wrong here. Thanks a lot!
>> >
>> > Ruqin
>> >
>> >
>> > On Thu, Feb 12, 2009 at 3:26 AM, Robert Osfield
>> > <robert.osfi...@gmail.com>
>> > wrote:
>> >>
>> >> Hi Raqin,
>> >>
>> >> I'm afraid there is too little information about your viewer setup to
>> >> be able to guess what is wrong.
>> >>
>> >> Are you using Viewer? CompositeView?  Could you provide screenshots as
>> >> well.
>> >>
>> >> Robert.
>> >>
>> >> On Thu, Feb 12, 2009 at 4:08 AM, Ruqin Zhang <ruzh...@gmail.com> wrote:
>> >> > Hi guys,
>> >> >
>> >> > I got a problem to set up two identical cameras. One is the master
>> >> > camera of
>> >> > osgViewer which contains the main scene.
>> >> > The other works as a slave of osgViewer which contains dragger. This
>> >> > is
>> >> > an
>> >> > effort of trying to force a post rendering of
>> >> > the dragger. Whiles, I got some issues here: I added a
>> >> > cameraManipulator
>> >> > to
>> >> > the viewer for camera actions. When I apply
>> >> > some manipulation, it seemed that these two camera are not line up
>> >> > well
>> >> > (There is some movement between dragger and object ).
>> >> > These two camers are not identical to each other.
>> >> >
>> >> > So, here my question is: how to set up two exactly identical cameras?
>> >> > Thanks
>> >> > a lot!
>> >> >
>> >> > Ruqin
>> >> >
>> >> > _______________________________________________
>> >> > 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
>> >
>> >
>> >
>> > _______________________________________________
>> > 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
>
>
>
> --
> Research Assistant
> Human Computer Interaction Program
> Virtual Reality Applications Center(VRAC)
> Iowa State University
>
> _______________________________________________
> 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

Reply via email to