Can JME3 implement generate and edit model dynamically?

I want to generate a model dynamically with some parameters. E.g, the length/width/height of a room, or a plane figure of a room. Can JME3 generate a room model dynamically with these kinds of parameters? And after generating, I also want to be able to edit the model. For example, change the height of the room, etc.

Could anybody give me some advises?

tralala, Thanks for your reply.

But if my input only is a building plan, just some lines. How JME3 can identify the lines of a picture? And also may be some lines are curves.

And i want to edit the generated model via mouse, just like 3dsmax editor.

a map doesnt have to be 1 model. you can create many quads, many boxes for a map.

For example i use quads for floor, 4 boxes for the walls, and i create a dungeon. I only keep a int[][] map and if map[x][y] != 0 i create a tile then. i do this in simpleInit();.

@longyg: Short answer: “No”. If you want a 3D mesh editor, use a 3D mesh editor. :slight_smile: jMonkeyEngine is a 3D game engine.



Long answer: “Yes, but…”



It’s similar to asking whether a car factory can take you to Las Vegas: No, it cannot, but it produces cars that get you there if you can drive. People can use jME to create an editor that does what you describe. jME does not “generate” any models from “building plans” by itself.



When you look at the jMonkeyPlatform (the development interface) you see that it can open models and arrange them in scenes, and you can save a scene, and load it into a game. This is a tool for people who have already created their models (e.g. in 3Dsmax), or, who have written Java code that generates models.



All we can recommend is to get Blender (it’s free, but a bit hard to use…), it supports scripts.

zathras said:All we can recommend is to get Blender (it's free, but a bit hard to use...), it supports scripts.


I'd say Blender has a learning curve that consists of two 90 degree angles, but I love it. :)

Anyway, if your game is all about such editing functions, that would become the main feature of it and you'd definately have to implement that yourself. If you just want to edit models, as said above, go with model editors ;)

Thanks zathras and baalgarnaal.



As baalgarnaal said, my requirement is editing model in game not only editing model in model editor.

I think my game is more like a tool. The user can build a plane graph (e.g, a plane graph of a house) by using the tool. Then the tool is able to generate the 3D model of the plane graph. And also is able to do some simple edit of the generated model.

If I understand correctly what you are trying to do I would say jmonkey is a good choice. But you will need to create most of the user interface. You can easily create boxes for wall at runtime and edit them (rotate/scale/move/change material). For complex objects you could load blender files and then even imagine an object composed of different variants parts.



You can even generate objects procedurally but I wouldn’t recommend this as it will be way more difficult ( generating polygons is easy, it’s the procedural part that would require some skills )



Jmonkey will help you handle assets loading, material, picking, collision, gui, …

http://hub.jmonkeyengine.org/oldwiki/doku.php/jme3

Well. That doesnt sound too hard if you ask me. At least the “Get walls where are walls in my blueprint” part. A roof wouldnt be too harsh, either, as long as you have a fitting model for it. When it comes to abstract forms of houses you may calculate a bit for this one… Maybe you dont even need a roof. I mean… you couldnt see inner walls then… :smiley:



When it comes to mesh-deforming you will have to make some buffer operations, reqriting the flotbuffer as far as I’m concerned.

Maybe you can write some helperclasses for this so you are fine later on. ( And could share those with us other monkeys. :smiley: )

if i have a model with skeleton created in 3ds max can i manipulate it in jme … such as rotate a certain hinge certain angle …???

longyg said:
I think my game is more like a tool. The user can build a plane graph (e.g, a plane graph of a house) by using the tool. Then the tool is able to generate the 3D model of the plane graph. And also is able to do some simple edit of the generated model.


If I understand your requirements this sounds much like my current project. I'm loading 3D models from a non-standard format, so after I've read the mesh data I'm creating all geometry "manually" (you may also call this "generating"). This is done by plugging vertex data, index data (forming polys w/vertices), and optionally color, texture coord data, etc, into VertexBuffers (com.jme3.scene.VertexBuffer) that form the backing data for a Mesh.

You'll want to look here:
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes

and at the links under the "Managing Objects in the 3D Scene Graph" located here:

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3#tutorials_for_beginners

I don't think you'll have a problem doing what you want to do, although you will of course need to develop the interactive (editor) features yourself (and there are tutorial/doc pages for that as well), particularly the collision handling bits.

I've used 3 other 3D libs before jME3, and so far jME has performed the best and definitely appears to give the best (out of engines I've tested) API access to do these low level manipulations. In my experience sometimes the collision data returned or access to geometry data in other engines isn't sufficient, and also I've run into performance bottlenecks when using some other engines, which for whatever reason just didn't seem to handle edits to 'live' mesh data very well. (Meaning the performance hit was steep-- may or may not be an issue for you, depending on your models.)