Hi,

you should probably add
nav->updateCameraTransformation() to give the
navigator a note about the new matrix.

(I suppose) You can shorten the code to 

Navigator *nav=mgr->getNavigator();
NodePtr cameraBeacon = mgr->getCamera()->getBeacon();
TransformPtr cameraTrans =
TransformPtr::dcast(cameraBeacon->getCore());
 
static float gigi=0;

beginEditCP(cameraTrans, Transform::MatrixFieldMask);
Matrix& m=cameraTrans->getMatrix();
m.setTranslate(gigi,0,0);
gigi+=10;
endEditCP(cameraTrans, Transform::MatrixFieldMask);

nav->updateCameraTransformation();

You don't have to do all the other set*() stuff,
because you are assigning the same Ptrs again.

Björn

 --- Enrico Borrione <[EMAIL PROTECTED]> schrieb: 
> Hi all, hi dirk, howdy dudes? 
> 
> I have been lurking in the mailing list mining some
> informations about
> beacons and navigators, to add a little more freedom
> of action in my
> application. 
> In particular i've read some post about the camera
> transformation
> matrices, and built up some demo code. I was able to
> change the point of
> view but... not thanks to the camera beacon. So now
> i am mostly
> confused.
> Here is my code:
> 
> Navigator *nav=mgr->getNavigator();
> NodePtr cameraBeacon =
> mgr->getCamera()->getBeacon();
> TransformPtr cameraTrans =
> TransformPtr::dcast(cameraBeacon->getCore());
> m=cameraTrans->getMatrix();
> 
> static float gigi=0;
> pro.setTranslate(gigi,0,0);
> m.mult (pro);
> gigi+=10;
> 
> beginEditCP(cameraTrans);
>      cameraTrans->setMatrix(m);
> endEditCP(cameraTrans);
> beginEditCP(cameraBeacon);
>      cameraBeacon->setCore(cameraTrans);
> endEditCP(cameraBeacon);
>      
> nav->setCameraTransformation(cameraBeacon);
> nav->set(m);
> 
> Nothing really exotic: i just query the SSM for the
> beacon matrix (that,
> after some struggling i KNOW it is CORRECT), i add a
> stupid frame after
> frame translation, and i update the various objects
> involved. In
> particular i think that the last 2 lines, the
> navigator stuff, are in
> charge of the moving stuff, but... surprise
> surprise, just the latter
> actually moves the camera. The former doesn't change
> the point of view.
> (discovered that commenting the two lines one after
> the other). Is the
> update of the camera beacon unnecessary? am i doing
> something wrong? 
> My worst fear is that my code works in the single
> machine app, but that
> it will hang when used in cluster...
> Can anyone shed some light on the matter? Thanks 
> enrico
> 
> ps: almost forgot, good week end!  
> 
> 
> 
>
-------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT
> Products from real users.
> Discover which products truly live up to the hype.
> Start reading now.
>
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Opensg-users mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/opensg-users
>  


        
                
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 250MB Speicher kostenlos - Hier anmelden: 
http://mail.yahoo.de


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to