Hi All,

thanks for this reply Dirk,

After analysing ProjectionCameraDecorator::getViewing() we got a little
confused about how to use the user node at that decorator.

The problem is: we thought that user was only used to calculate frustrums,
and since all planes are set in tracker space (and so does the user node
transformation),
it should work. I've replied one of our mails saying just that, that the
planes are defined at tracker space, at that point everything seemed to be
fine and make sense.

On Mon, Mar 1, 2010 at 12:50 AM, Dirk Reiners <dirk.rein...@gmail.com>wrote:

>
>        Hi Pablo,
>
> On 02/26/2010 12:03 PM, Pablo Carneiro Elias wrote:
> > Hi Dirk, thanks.. I've found the problem.... user beacon must be a child
> of
> > camera beacon.. !
>
> ah! Well, it doesn't have to be, but if you are moving the camera the user
> beacon has to move, too. So yes, in general putting it as a child of the
> camera
> beacon is the easiest solution.
>

well, we found that getViewing() uses the user node to place the camera. So,
if the user node is not a child of camera beacon, the camera transform will
not be taken into account in order to calculate
view matrix, isn't? So, assuming that we need to place it as a child of
camera's beacon, it lead me to one more question: since the camera has a
real position in world space, that tracker would have to be in the same
metric system of my world so it can work, doesn't it?

::getViewing()
{

  if(pUser == NULL)
  {
       ... // use decoratee camera to calculate view matrix...
  }
  else
  {
      pUser->getToWorld
<file:///home/siviep/projects/docs/2.0/classOSG_1_1Node.html#af244b7df2453f6e8997a1204f66206c1>(result);
      result.invert
<file:///home/siviep/projects/docs/2.0/classOSG_1_1TransformationMatrix.html#adcd0ed5a21505e391004d5f94b054fef>();
  }

}

looking at ::getProjection(), we saw that the user is sent to camera space:
  ...

 Matrix 
<file:///home/siviep/projects/docs/2.0/classOSG_1_1TransformationMatrix.html>
cam,user;
 camera->getBeacon
<file:///home/siviep/projects/docs/2.0/classOSG_1_1CameraBase.html#a39884cd48afe3f72ba7d663e0988caa6>()->getToWorld
<file:///home/siviep/projects/docs/2.0/classOSG_1_1Node.html#af244b7df2453f6e8997a1204f66206c1>(cam);
 if(pUser == NULL)
 {
     FWARNING 
<file:///home/siviep/projects/docs/2.0/group__GrpBaseBaseLog.html#ga98ef420389a4d838c2eef37650e814f2>(("ProjectionCameraDecorator::getProjection:
no user!\n"));

     user = cam;
 }
 else
 {
     pUser->getToWorld
<file:///home/siviep/projects/docs/2.0/classOSG_1_1Node.html#af244b7df2453f6e8997a1204f66206c1>(user);
 }

 cam.invert 
<file:///home/siviep/projects/docs/2.0/classOSG_1_1TransformationMatrix.html#adcd0ed5a21505e391004d5f94b054fef>();

 cam.mult 
<file:///home/siviep/projects/docs/2.0/classOSG_1_1TransformationMatrix.html#a287499ff4c6f3967ea9fb60a6336b591>(user);
 Pnt3f <file:///home/siviep/projects/docs/2.0/classOSG_1_1Point.html>
viewer(cam[3]);

 ...
 ... // calculate frustum using planes defined in tracker space.


so it also suggests that, indeed, user should be placed as a child of
camera's beacon. But then how can screen and user transform be in an
arbitrary coordinate system?


Glad you found it!
>
>        Dirk
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Opensg-users mailing list
> Opensg-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>


thanks!

Pablo
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to