GLC_lib & GLC_Player Forums

Files .DAE - How can I move all instance together?
Page 1 of 1

Author:  longolui [ Thu Oct 16, 2014 7:45 am ]
Post subject:  Files .DAE - How can I move all instance together?

Good morning,
I have a question.
I load a DAE but I'm not able to move on the scene. How can I move all instances that DAE contains togheter?

Thanks a lot

Author:  guillermoe [ Sun Jan 04, 2015 1:44 am ]
Post subject:  Re: Files .DAE - How can I move all instance together?

If I correctly understand what you need, just update the matrix for the world's root node.
After updating the absolute matrix, all children will move according to the new matrix.
It would be something like this:
GLC_StructOccurence* nodeOccurence= m_World.rootOccurence();
                GLC_Matrix4x4 positionMatrix(GLC_Vector3d(0.05, 0.05, 0.05));
                GLC_Matrix4x4 rotationMatrix(glc::Z_AXIS, 0);
                nodeOccurence->structInstance()->setMatrix(positionMatrix * rotationMatrix);

                //Do updates

Hope this could be helpful.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group