Author Topic: Clone and transform objects  (Read 738 times)

Offline ap

  • byte
  • *
  • Posts: 12
    • View Profile
Clone and transform objects
« on: May 14, 2015, 10:35:29 am »

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?


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12065
    • View Profile
Re: Clone and transform objects
« Reply #1 on: May 14, 2015, 01:06:52 pm »
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's just more logical.