[osg-users] Fwd: Fwd: Fwd: CallBack issue

Ulrich Hertlein u.hertlein at sandbox.de
Sat Mar 28 16:51:16 PDT 2009


Hi Sajjad,

On 28/3/09 11:55 PM, ami guru wrote:
> So you mean  that the setMatrix() function after  the callback is not
> making any difference to  the scene.
>
> But i get different scene when i toggle the matrix setup after the callback.
>
> With setMatrix() after the callback i get two cows side by side and the
> left one is rotating around z
>
> Without setMatrix() after the callback i still do get two cows side by
> side and the left one is rotating around z by the left ones head is cut
> by the window view.

Okay, so it makes a difference to the camera position (as it apparently evaluates the 
scene bbox before the update callback is run).

It doesn't make a difference to the transformation of the node (which is where this thread 
is coming from AFAIR), since that is set in the update callback.

Also notice that the original RotateCB includes rotation *and* translation in the new 
matrix whereas your code only specified the rotation part, thereby losing any 
scaling/translation you set before.

If you change the translation (the one after setUpdateCallback) to some other value, the 
camera position will change, but the cow will still rotate around (-6,0,0).

Cheers,
/ulrich



More information about the osg-users mailing list