Hello Robert,

On 03/09/2012 04:44 AM, Robert Petka wrote:
However I want to ask whether it is possible somehow to make sorting
correct on each wall independently of user`s head rotation? So in case
more people step into CAVE, everyone can see correct image...

sure, I was primarily trying to get a bit more evidence that what we suspected the problem was, is actually happening ;)
Can you give the attached patch a try? Thanks!

        Cheers,
                Carsten
Index: Source/System/Action/RenderAction/OSGRenderAction.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Action/RenderAction/OSGRenderAction.h,v
retrieving revision 1.55
diff -u -p -r1.55 OSGRenderAction.h
--- Source/System/Action/RenderAction/OSGRenderAction.h	6 Jan 2011 13:35:27 -0000	1.55
+++ Source/System/Action/RenderAction/OSGRenderAction.h	12 Mar 2012 15:08:30 -0000
@@ -313,6 +313,7 @@ class OSG_SYSTEMLIB_DLLMAPPING RenderAct
 
     MatrixStore               _currMatrix;
     Matrix                    _camInverse;
+    Matrix                    _camProjTranslate;
 
     std::vector<MatrixStore>  _vMatrixStack;
 
Index: Source/System/Action/RenderAction/OSGRenderAction.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Action/RenderAction/OSGRenderAction.cpp,v
retrieving revision 1.126
diff -u -p -r1.126 OSGRenderAction.cpp
--- Source/System/Action/RenderAction/OSGRenderAction.cpp	25 May 2011 22:04:57 -0000	1.126
+++ Source/System/Action/RenderAction/OSGRenderAction.cpp	12 Mar 2012 15:08:30 -0000
@@ -254,6 +254,8 @@ RenderAction::RenderAction(void) :
 
     _uiMatrixId          (0),
     _currMatrix          (),
+    _camInverse          (),
+    _camProjTranslate    (),
     _vMatrixStack        (),
 
     _mMatMap             (),
@@ -399,6 +401,8 @@ RenderAction::RenderAction(const RenderA
 
     _uiMatrixId          (source._uiMatrixId),
     _currMatrix          (source._currMatrix),
+    _camInverse          (source._camInverse),
+    _camProjTranslate    (source._camProjTranslate),
     _vMatrixStack        (source._vMatrixStack),
 
     _mMatMap             (source._mMatMap),
@@ -739,6 +743,7 @@ void RenderAction::dropGeometry(Geometry
             getActNode()->getVolume().getCenter(objPos);
 
             _currMatrix.second.mult(objPos, objPos);
+            _camProjTranslate.mult(objPos, objPos);
 
             pNewElem->setNode       (getActNode());
                 
@@ -929,6 +934,7 @@ void RenderAction::dropFunctor(Material:
                     BoxVolume     vol = getActNode()->getVolume();
 #endif
                     vol.transform(_currMatrix.second);
+                    vol.transform(_camProjTranslate );
                     objPos = vol.getMax();
 
                     pNewElem->setScalar(objPos[2]);
@@ -954,6 +960,7 @@ void RenderAction::dropFunctor(Material:
                     Pnt3f objPos;
                     getActNode()->getVolume().getCenter(objPos);
                     _currMatrix.second.mult(objPos, objPos);
+                    _camProjTranslate .mult(objPos, objPos);
                     pNewElem->setScalar(objPos[2]);
 
                     if(isMultiPass)
@@ -1063,6 +1070,7 @@ void RenderAction::dropFunctor(Material:
             getActNode()->getVolume().getCenter(objPos);
 
             _currMatrix.second.mult(objPos, objPos);
+            _camProjTranslate .mult(objPos, objPos);
 
             pNewElem->setNode       (getActNode());
                 
@@ -2766,6 +2774,10 @@ Action::ResultE RenderAction::start(void
             _camera->getViewing(_currMatrix.second, 
                                 _viewport->getPixelWidth (),
                                 _viewport->getPixelHeight());
+            _camera->getProjectionTranslation(_camProjTranslate,
+                                              _viewport->getPixelWidth (),
+                                              _viewport->getPixelHeight());
+                                              
 
             _camInverse.invertFrom(_currMatrix.second);
             
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to