Moving primitives (translation)

Any question about the main GUI application (frontend)
Post Reply
eimixas
Posts: 36
Joined: Thu Jan 17, 2013 8:14 am

Moving primitives (translation)

Post 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?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Moving primitives (translation)

Post 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.
Daniel, CloudCompare admin
eimixas
Posts: 36
Joined: Thu Jan 17, 2013 8:14 am

Re: Moving primitives (translation)

Post by eimixas »

Thank you - it works.
Post Reply