How to add nodes to a scene dynamically?

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  masdemg 4 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31162

    masdemg
    Member

    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

    #36746

    masdemg
    Member

    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

    #36747

    Scott
    Moderator

    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

    #36748

    masdemg
    Member

    Thanks Scott

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.