MaterialState ms;
for (String meshName : ColladaImporter.getGeometryNames())
{
loadedModel.attachChild(ColladaImporter.getGeometry(meshName));
Integer mindex = loadedModel.getQuantity()-1;
ms = Materials.createMaterialState();
ms.setDiffuse(ColorRGBA.randomColor());
loadedModel.getChild(mindex).setRenderState(ms);
}
/*
* The code to save from Collada model
*/
JFileChooser fileChooser = new JFileChooser(Editor.class.getClassLoader().getResource("").getPath());
if (fileChooser.showSaveDialog(fileChooser) == JFileChooser.APPROVE_OPTION) {
try { BinaryExporter.getInstance().save((Savable) loadModel, fileChooser.getSelectedFile()); }
catch(Exception exception) { Console.writeLine(exception.getMessage()); }
}
/*
* The code to load a 3D Object
*/
JFileChooser fileChooser2 = new JFileChooser(Editor.class.getClassLoader().getResource("").getPath());
if (fileChooser.showOpenDialog(fileChooser2) == JFileChooser.APPROVE_OPTION) {
try { loadModel = (Node) BinaryImporter.getInstance().load(fileChooser2.getSelectedFile()); }
catch(Exception exception) { Console.writeLine(exception.getMessage()); }
}
>
I can take a
the conversation I use the support of collada blender (which does not actually animation)
Now I work with the md5 and I am obliged even for an object that did not articulation of his bones if given a model and dismantled a bit like your chair
:) Can u be more specific? I managed so far to import 3ds objects into the scene(each one is in a Node, attached to the rootNode). Now what I'm trying to do is let the user select an item in the scene and move it around, rotate it or scale it. Been reading all sort of posts and so far I see that u have the best solution :D. Care to share? ;)
He used a special tool to import the model… Well, that is not really true, the importing process is simply the jME loading tool, but he placed it in one custom application (sort of like MonkeyWorld3D).
He used a special tool to import the model... Well, that is not really true, the importing process is simply the jME loading tool, but he placed it in one custom application (sort of like MonkeyWorld3D).
Any idea how to achieve that select box effect? One way I think is to just draw (add them as a child to the node of the model) those lines(knowing exactly the length, width and height of the model) at some offset.
Perhaps looking at SimpleGame or DebugGameState would give an idea on how to achieve it… It has a mode (hitting 'b') that draws the bounding boxes, you can use that information to draw your custom selection highlight.