Page 1 of 1

Moving primitives (translation)

Posted: Thu Feb 07, 2013 3:22 pm
by eimixas
What is best way to translate eg. plane?

i tried:

const ccGLMatrix& planteTrans = pPlane->getTransformation();
CCVector3 N(planteTrans.getColumn(2)); //plane normal
N.normalize();
N = N * 0.1;
pPlane->translateGL(N);

m_app->refreshAll();
m_app->updateUI();
m_app->redrawAll();

It moves, after saving project and loading - its position is moved.
But in properties table - bounding box center and dimmensions are not changing, am i doing something wrong?

Re: Moving primitives (translation)

Posted: Thu Feb 07, 2013 3:45 pm
by daniel
You should call 'applyGLTransformation_recursive' after 'translateGL' so that the temporary GL transformation will be actually 'applied' to the coordinates (and also stored in the particular case of primitives).

Otherwise, the GL transformation is only used for display.

Re: Moving primitives (translation)

Posted: Thu Feb 07, 2013 7:45 pm
by eimixas
Thank you - it works.