[osg-users] osgViewer::View::getCameraContainingPosition() returns weird results when using slave cameras
Jason Beverage
jasonbeverage at gmail.com
Mon Jun 2 11:27:49 PDT 2008
Hi Glenn and Robert,
I added a call setting up the projection matrix to the FAQ for embedding a
viewer in a .NET control. I was having an issue that the perspective on my
camera was squished when I started with a tall and skilly control. Setting
the initial projection matrix with the following line of code caused
everything to work correctly.
viewer->getCamera()->setProjectionMatrixAsPerspective(30.0f,
static_cast<double>(traits->width)/static_cast<double>(traits->height),
1.0f, 10000.0f);
Thanks!
Jason
On Wed, May 28, 2008 at 4:00 PM, Jason Beverage <jasonbeverage at gmail.com>
wrote:
> Hi Glenn and Robert,
>
> Glenn, your code worked great, thanks alot, I really appreciate it. The
> posts from you and Hesicong over the last few months about using OSG via
> C++/CLI have made using OSG in a .NET environment much nicer than what we
> were previously doing.
>
> Robert, I'm in no major hurry to get that issues fixed since I'm just using
> osgViewer::Viewer and things seem to be working as expected correctly now.
>
> Thanks for all your help!
>
> Jason
>
>
> On Wed, May 28, 2008 at 3:12 PM, Robert Osfield <robert.osfield at gmail.com>
> wrote:
>
>> Hi Jason,
>>
>> On Wed, May 28, 2008 at 5:48 PM, Jason Beverage <jasonbeverage at gmail.com>
>> wrote:
>> > Did you ever find a fix for this issue? I believe I might be running
>> into
>> > the same problem.
>>
>> There is still a problem with the set up of events within
>> CompositeViewer with certainly window/camera combinations, it almost
>> works, but not quite precisely as it should. One can see an artefact
>> in when running:
>>
>> osgcompositeviewer cow.osg
>>
>> Try using the trackball manipulator in the lower right cow view. The
>> mouse interactive doesn't quite behave as it should suggesting that
>> the x,y projected into the local view aren't correct. I haven't
>> looked at this issue recently, but the last time I looked I couldn't
>> spot the cause. I really need to just spend a day going through the
>> code with a fine tooth comb to spot what is happening to the mouse
>> events as they are processed. Events needs to be processed by the
>> CompositeViewer as it has to decide event focus to the correct view,
>> then handle slave cameras etc, to projected the mouse coords into a
>> consistent coordinate frame for a single view - it's a lot more
>> complex that one would at first expect, the internal complexity comes
>> from hiding the actual complexity of the setup.
>>
>> I can't tackle this bug hunt right away as I've already spent most of
>> this week on submissions/bug fixing and need to get on with other
>> work... I'll try to make time to resolve this next week. Ping me
>> next week if I haven't started work on it.
>>
>> Robert.
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080602/e2ed8e8f/attachment.htm>
More information about the osg-users
mailing list