Hi Patrick,
Patrick Hartling wrote:
> I have been looking through the use of OSG::Camera's beacon, and as far as I
> can tell, OSG::MatrixCamera does not use its beacon. In OSG::Camera, the
> beacon is used in getViewing(), but OSG::MatrixCamera::getViewing() simply
> returns its own modelview matrix. I have not come across other places where
> the beacon influences the rendering. Does setting the beacon for an
> OSG::MatrixCamera have any effect, or is its beacon completely ignored?
Nope, it's completely ignored. I couldn't find a sensible way to combine
them, but ideas are very welcome.
> I ask this question because I am trying to find something "in between"
> OSG::MatrixCamera and OSG::ProjectionCameraDecorator for asymmetric viewing
> in a cluster. What I want is to be able to perform navigation operations on
> one data object and have all viewports render the scene correctly. My
> original approach was to use OSG::ProjectionCameraDecorator in the server
> viewports and OSG::PerspectiveCamera in the client viewport via the simple
> scene manager. OSG::ProjectionCameraDecorator is great because its
> projection matrix is not influenced by its decoratee. This is not true of
> OSG::MatrixCameraDecorator.
You could write your own decorator. It's not really a big deal, just
like most other custom FCs. Or you could write your own Camera, which is
not much more of a deal.
> For better or worse, I cannot use OSG::ProjectionCameraDecorator because I
> do not have the projection corners needed for it to work, and trying to
> derive them from the limited information that I have about projector
> configuration may not yield accurate results. OSG::MatrixCameraDecorator can
> work, but if the decoratee is an OSG::PerspectiveCamera, then I have to keep
> its projection matrix from interfering with the projection matrix that will
> be computed by the matrix camera decorator. I end up passing in the inverse
> of the perspective camera's projection matrix as the pre-projection matrix
> and then using a matrix constructed from OSG::MatrixFrustum() as the
> post-projection matrix. This works, but it is fragile because I have to keep
> the pre-projection matrix in sync with the perspective camera's projection
> matrix.
Hm, yeah, that sounds not very elegant.
> One alternative that I am considering is keeping the modelview matrix for a
> collection of OSG::MatrixCamera objects (one per server-side viewport) in
> sync with the viewing matrix of an OSG::PerspectiveCamera, but that gets me
> right back to updating things manually. Setting the beacon of the
> OSG::MatrixCamera objects to that of the OSG::PerspectiveCamera has no
> effect, and that is why I asked the question above. If I could simply have
> the cameras all relative to the same beacon, I would be in good shape.
Would a MatrixCamera that only sets Projection make sense or do you need
more? I'm not very happy about ignoring the beacon on the MatrixCamera,
but i couldn't come up with a good way to use it. :(
> The only other alternative that I have thought of is to move the world
> instead of moving the camera(s). I had planned on making that possible, but
> I was hoping to have the option of doing either just in case moving the
> world turned out to have unwanted side effects. If it is the case that the
> easiest/only way to do this is to move the world instead of the camera, then
> that is what I will do.
That's a question of taste. Personally I don't like it and I find it
very confusing, but if you can wrap your mind around it that might work.
Yours
Dirk
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users