InstancedModelGroupVisual3D - Usage question
#1
Hi I'm currently evaluating the product and find the Instance model concept very interesting.

Although the example shown would not really fit with the current way I am using instanced models (using my existing 3Dengine).

From what I understand from the example, in order to use the instance model, one need to populate the InstancesData property with the data of each repeated instances.

In you example it works well since you know already where those instances are placed (lets say on a cube of 100x100x100)

But in my case, I only know while building the scene when I need a new instances of a model. Therefore I do not know at the moment I create my first instance that ill be needing 1 or 10000.

How would I achieve this? Should I keep the InstancedModelGroupVisual3D object available and add to this object any new instances or should I create a new InstancedModelGroupVisual3D for every instance I need?

I hope I'm not too confusing :)

Thanks!
#2
Maybe I am missing something, but from how I understand the problem the following may solve your problem:

When you begin building your scene create a new List<InstanceData> (try to predict the number of instances and call the constructor of the List with that number).

Then during building of your scene, when you see that you need a new instance, just add a new InstanceData to the list.

At the end of building your scene, create a new InstancedModelGroupVisual3D and convert the List<InstanceData> to array and set it as InstancesData.
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)