Hello,
I encountering a quite strange issue. I have create an object model under Blender and I would like to use that single model to create several objects within my application.
I create N nodes and for each one, I create a static model from the resource related to the model file “Models/Gate.mdl”.
Here is the code snippet I use…
for(i = 0; i < 10; i++)
{
Node *myNode = mScene->CreateChild("Gate" + String(i));
myNode->SetPosition(Vector(…, …, …));
StaticModel *myModel = myNode->CreateComponent<StaticModel>();
myModel->SetModel(mResourcesCache->GetResource<Model>("Models/Gate.mdl"));
myModel->ApplyMaterialList();
}
However, when I execute that code, I have some strange behaviors when I look at the objects. It seems that sometimes or depending on my camera position, some are visible and other are not, and they appear and disappear in a random fashion.
So my main question is : is it possible (and maybe relevant) to create several objects from the same unique resource ? Do I have to duplicate the model resource to have one duplicated resource associated with one node ? I mean that if I create 10 nodes, do I have to create 10 different resources of the same model ?
It is a little bit confusing to me, so any clarifications would be very welcome.
My best regards !