Clone and transform objects

Started by ap, May 14, 2015, 10:35:29 AM

Previous topic - Next topic

ap

Hello

I'm cloning an object, for sharing the mesh data, and I'm a bit confused.
I am trying to transform the mesh data at start-up by using rotateMesh() and translateMesh() after applying proper transformations (for aligning the objects properly).

I am wondering what is the better option (in terms of performance and memory consumption) - cloning the original object (with the original mesh data) and then applying rotateMesh/translateMesh OR first applying mesh transformations and then cloning? Is there a difference?
What happens to the mesh data after rotateMesh/translateMesh? Is it still being shared, so a transformation on one object affects the other?

Thanks
AP

EgonOlsen

Doing this on a shared mesh will apply the operations on same mesh. So doing it after cloning and sharing doesn't do any harm performance or memory wise, but you might apply the same operations twice. IMHO, it's better to apply these operarions before the cloning...it's just more logical.