Beginner question here. And maybe it is so obvious that you guys will roll with your eyes, but I was asking myself:
objloader.load( './assets/models/cubeBevel.obj', function ( object ) {
// do someting with imported model
});
What is the best way to use the imported model on a later occasion. I am new to JavaScript - I used to write Java and C#.
So in C#, I would do:
ModelClassname cubeBevel = Loader.load(...);
//and then some lines below:
GameObject g = new GameObject();
g.SetModel(cubeBevel);
To me, it seems like I have to do…
objLoader.load('...', function(x){ ... })
…every time I want to instantiate a new object with the model from cubeBevel.obj. But this looks like the objLoader will always reload the model n times. Almost every example online only deals with loading a model and instantiating an object with that model ONCE but that’s not what I want to do. I might have thousands of cubeBevel.obj instances in my scene.
So, will objLoader load and parse the OBJ file over and over if I call the load method more than once? Or is it keeping track of imported models?
How would I do better in my case?
Cheers and thanks for your help!