Hello Eric,
Maslowski, Eric wrote:
> Thanks Carsten,
> So, if I understand correctly for stereo when using a MatrixCamera we have
> to generate projection & modelview matrices ourselves (every frame if it's an
> asymmetric, off-axis frustum like those found in ProjectionViewport)?
>
> Regarding the larger issue here, I did some deeper digging into what might be
> happening with the perspective camera and I noticed that the matrix I feed
> OpenSG isn't the same as what I receive back through: Camera->getViewing().
> It's not even the inverse, which I was expecting. I'm currently feeding
> "getViewing()" a matrix to fill, and the pixel width/height from the current
> viewport. Is this the proper method to use for this? Here's some sample
> output showing the in/outs.
>
>
> -------
> ref = matrix generated by my navigator and fed directly to OSG
> inv = the inverted version of "ref", never submitted to OSG
> osg = the matrix I receive from OSG using "getViewing()"
>
>
> ref: 0.559012 0.353901 0.749840 -1.327405
> 0.000000 0.904337 -0.426819 1.448839
> -0.829159 0.238597 0.505536 -0.178932
> 0.000000 0.000000 0.000000 1.000000
>
> inv: 0.559012 0.000000 -0.829159 0.593673
> 0.353901 0.904337 0.238597 -0.797777
> 0.749840 -0.426819 0.505536 1.704189
> 0.000000 0.000000 0.000000 1.000000
>
> osg: 0.559012 0.353901 0.749840 -0.000000
> 0.000000 0.904337 -0.426819 0.000000
> -0.829159 0.238597 0.505536 -0.000000
> 0.593673 -0.797777 1.704189 1.000000
> -------
>
>
> What is even weirder about this is that the REF rotational values transfer
> over, but the positional values are the same as the inverted matrix. My
> matrix math is beyond "rusty" but can anyone explain what could potentially
> cause this? I'm at a loss.
Camera::getViewing() normally returns the inverse of the camera beacon's
getToWorld() matrix (or leaves the matrix unchanged if no beacon is
set). For MatrixCamera it returns whatever is set with setModelviewMatrix().
OpenSG sets GL_PROJECTION to p * t where p is getProjection(p,w,h) and t
is getProjectionTranslation(t,w,h) with w,h being width and height of
the viewport. GL_MODELVIEW is set to v where v is obtained by
getViewing(v,w,h). Decorators or derived classes may override this though.
Are the above values from a MatrixCamera? Is it decorated? How do you
"feed" the values from your navigator to it?
Thanks,
Carsten
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users