I was wondering… I am about to create a very simple model in Blender that should represent a car.
When moving forwards, backwards and so on I want the wheels to rotate so should I animate them in Blender or should I do this in jme3?
I am also wondering, can I access the individual wheels from within jme3 so I can let them rotate individually (if one is stuck for example)?
If you want to access individual parts of your model, I think you have to develop them as different objects in Blender. Then they will appear as a tree of subnodes, representing your various parts.
Also, note that the Blender importer creates a separate geometry (capable of rotation) for each material region of a Blender object. So for instance if your trim, windshield, and tires have their own materials, they will wind up as separate geometries too, even if they were not separate objects in Blender.
Cool thx.
Looking really good. I just did a test and I seem to be able to traverse the object tree which is great!
Just one last question… Is that tree read only or can I append Node’s to those imported models during runtime?
The reason why I’m asking is that I want to build a modular car where the user can attach modules. So for example I create a chassis in blender and a wheel which are separate models.
In the game the user can select the wheels which I want to attach to the chassis.
if I do something like this:
leftFront.attachChild(selectedWheel);
Where leftFront is the Node from the imported blender model.
[java]
Node car = new Node();
car.attachChild(chassisModel); //imported model from blender
car.attachChild(frontLefWheel);
car.attachChild(frontRightWheel);
…
[/java]