How to add nodes to a scene dynamically?

Here’s my use case:

  1. Load a scene from a .pod file
  2. Render the scene
  3. Load another scene in memory from a different .pod file (not rendering)
  4. Take a node from the in-memory scene (with mesh, materials etc.) and push the node into the original scene
  5. Render



    Is it possible? If so, what’s the best way to implement it?



    Thanks

Step 3 is not fundamental as the node could also be manually created. The concept is that I need to add and remove nodes to the scene dynamically

Hi,



It is certainly possible but CPVRTModelPOD isn’t designed to be modified dynamically so it would involve reallocating/copying the various lists (e.g. node, material, meshes) and updating the stored IDs/sizes. Long story short, this wouldn’t be the best approach for what you wish to do.



Maybe consider having everything static in one POD file and all the dynamic objects in their own PODs. Then modify your rendering code to render a dynamic list of CPVRTModelPODs.



Thanks,



Scott

Thanks Scott