Hi I’m totaly new to jmonkey engine, and I’ve decided to use jme3. I would like to combine several meshes into one. I’ve looked around and found that in jm2 they had ways for doing this, but when I look for these classes in jme3, I cant find them. Did they change the name of classes into something else or is this not supported yet?
How to combine meshes into one mesh? Any examples for jme3? Also example using atlas texture on combined mesh would be good. Perhaps someone could put this into advanced tutorials. Its much needed and info on this is missing.
Thanks in advance for any pointers or answers you can provide
I have a follow up question about docs, where are java docs for jme3?
I found these for jme2
http://www.jmonkeyengine.com/doc/
but haven’t been able to find ones for jme3 online…
The JavaDoc is installed in jMP and automatically displayed in the code completion, you can browse it by clicking the browser icon in the code completion window. Its also available in the sources (nightly) and you can build it from svn with “ant javadoc” for use in other IDE’s.
Cheers,
Normen
thanks for that
so I take it that combining meshes in not yet supported directly by jme3 and classes like GeometryBatchInstance have not been ported over to jme3?
Few stuff of jME2 can or will be “ported” to jME3. jME3 is mostly written from scratch, using the same scenegraph approach, the same math system and extending some other subsystems like the load/save system of jME2. So its rather not implemented than “not ported”. I think GeometryBatchInstance is from jME1, is it not? I dont think jME2 had a way to “merge” meshes and its generally something you would do in a 3d editor beforehand for a game.
Cheers,
Normen
I dont think jME2 had a way to “merge” meshes and its generally something you would do in a 3d editor beforehand for a game.
So you have a scene with 20 000 objects dinamically created objects and you’d like to merge some of them together to get better FPS, and also split them when its necessary dinamically, thats why stuff like “GeometryBatchInstance” is usefull, for optimization that you cant do in 3d editor, but have to do it on the fly since all your meshes are dinamically crated
Wonder why this was not included, seems like they could have directly ported it from jme2 or previous versions since techniques for doing this should not change dramatically.
Wonder if someone of developers could give some feedback on this.
Well when I’m not wrong you could just copy al vertex/indexbuffer/texturecoordbuffer togheter into one large(for each type) However they all need to use the same material then (maybee a case for a textureatlas?)
I wonder why this functionallity was left out especially since its important and logic behind it should be the same as in previous versions of jme, so even if jme3 is rewritte from scratch these classes could have been “ported” since functionallity and what they do should not matter if jme1, jme2 or jme3 is using them
Anyways I found this example:
https://wiki.jmonkeyengine.org/legacy/doku.php/geometrybatch
which is great example but will not work with jme3 because jme 3 is missing these functions for Mesh class:
Mesh.reconstruct
Mesh.getTextureBuffer
Mesh.getNormalBuffer
Mesh.getColorBuffer
Mesh.updateModelBound
Perhaps there was a good reason these were left out and not added. Maybe devs didn’t have time to add these? If they were there then I could perhaps implement that example for jme3 and optimize my scene in big way allowing me to merge lots of objects into one object, like 10 000 of them making them 1 object and much faster to render then all of them rendering separatly which brings the FPS down
I’d like more opinions on this, please comment if you have any idea
Perhaps I could look in jme1 and jme2 and add these missions function my self to jme3 but then I would have to make sure this does not break some other functionallity? Any plans by devs to add these at all, or why they were left out in new version?
No, these methods are not missing. Look into the wiki and the lately posted “Hello Mesh Tutorial” to learn more about meshes.
I found it, thanks
For anyone else wondering the tut is here:
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes
Functions I was missing have been replaced by public VertexBuffer getBuffer(VertexBuffer.Type type)