Author Topic: switching shape from time to time, new Object3d or setMesh?  (Read 1880 times)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
switching shape from time to time, new Object3d or setMesh?
« on: November 11, 2020, 04:12:13 pm »
Hi Egon,
i want some 3d models in main World to be rendered also in another World, and the models in the other World need to be switched from time to time, assuming the meshes are all in GPU, how to switch models?
create new Object3d or call Object3d.setMesh ?
an object3d needs some initialization before rendering, i guess setMesh would be quicker?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: switching shape from time to time, new Object3d or setMesh?
« Reply #1 on: November 11, 2020, 05:32:33 pm »
I would go with what the docs for setMesh() state:

Quote
Shouldn't be required in normal applications.

Or in other words: It won't work that way. You can't set a new mesh to an object that's already in use (i.e. that has been compiled and rendered). This method is mainly there, if you want to build keyframe animation sequences on your own and similar things. Not for changing the appearance of an object.