Tree generator

I am creating a tree generator for the JMonkeyEngine. It is based on the arbaro tree generator.

Project is still in development, but it is already possible to create textured static trees.

Source code can be found at http://code.google.com/p/forest-generator/.

Code is free to use, I only ask that my name is mentioned.

6 Likes

Looks nice, but why didn’t you make it a plugin for the SDK right away?

There are 2 steps in using trees.

The first step is creating the tree: choose variable values and choose textures.

The second step is using this tree in another project. (the plugin you suggested)

I am still working at the first step.

Yeah sure but you seem to create a swing app from that already. The NetBeans platform has many helper classes for example to create a property editor like the one on the right of your screen etc. so if you start it as a plugin right away you probably save some time adding some features and in exchange need just some additional time to learn about the NetBeans API functions you want to use.

Anyway nag me when you need help moving tis to the SDK.

Yeah, I would like to see your tree generator integrated in jmp as plugin. It’s not difficult to do ;).

Nice project! it would be cool to make trees with LODs.



Do you know about ngPlant? Possibly that project will be helpful. It has ngShot utility, to make a render of a tree and it will be only one plane with a texture and an alpha channel.



http://ngplant.sourceforge.net/



I wish you good luck!

About LODs i meant that a tree could be 12000 tris but according to distance to camera the tree could be 5000, 1000, 200, 2(a plane, rendered like in the ngShot utility) tris.

Looks good :slight_smile: I noticed Arbaro is gnu licensed, but this still lets you make models and distribute those with your non-gnu software, I guess. Would making it a jmp plugin require jmp to be gnu as well? Arghh…, licenses gives me headache.

makeshift said:
(...) Would making it a jmp plugin require jmp to be gnu as well? Arghh..., licenses gives me headache.

No, since we wouldn't be bundling it with jMP but rather provide the option to install it as a third party plugin, there shouldn't be any licensing issues.

Great that’s what I thought and hoped :slight_smile:

I’m converting the project to an plugin. It is my first plugin so progress is rather slow.

As mentioned before arbaro is gnu licensed. What steps should I take to not violate this licence?



Next steps in project are:

Making working plugin to create basic trees

Making crossection of trees (very basic LOD)

Adding tree definitions (Searching/creating texture tiles)

Add more LOD support.



I hope to finish the basic plugin by the end of september.

2 Likes

good luck ;).

First version of plugin can be found on http://code.google.com/p/forest-generator/

See downloads for the nbm file.

See wiki for instructions. (better documentation will follow)

2 Likes

Wow! You are fast man xD. Good work ! I’m going to try it tonight :).

Awesome! Why not directly develop inside the jmp-contributions repo? This would build and put the updates directly into the update center when you commit, I can give you access to the gc project, just mail me your gc email address.



Edit: The plugin doesn’t work with the nightly version as it uses SimpleTextured.j3md:

http://i.imgur.com/NmZRr.png



Edit2: It would be cool if the generator was a generic wizard, you can create a wizard easily using a template (File->New File…) and then just plant your swing code into that. It also has a handy object to store your data in to separate configuration and actual creation.

Should now work with the nightly version.

1 Like

Okay, I was able to create a tree model, its a .mesh file… Which is probably not good as the .mesh ending is normally associated with OgreXML binary mesh files. Why can you not create a normal j3o file and just have some UserData that points to the xml file so you can reference it later? The extra “TreeLoader” instead of using the assetManager is a bit counter-intuitive… Also, without a tree in j3o form, I cannot add a tree to any scene, only load them in code :frowning:

I must admit that I chose for an own format because I failed to export the Node into a j3o and reload it again.

When loading I get:

java.lang.NullPointerException

at com.jme3.texture.Texture.read(Texture.java:591)

at com.jme3.texture.Texture2D.read(Texture2D.java:215)

Probably you know the solution to this.



TreeLoader would be updated so it would create the tree from scratch if you gave seeds for a tree that has not been build yet. (batch creation). Maybe it would be better to use j3o and add a batch creator to the creation window.



Any help to solve the nullPointerException would be nice.

The thing is probably that you do not save the j3o with the correct image paths it later needs for loading. When you load a model with some image paths, the j3o will store these. If the images are later not available at that exact location it will fail.

I use AssetManager.loadTexture(“Textures/Trees/…”) when creating the model. (before saving it)

The images are not moved from this folder

But still I get the NullPointerException. Maybe problems with relative paths?