Prefered way to create a soccerfield? Programatically or using the scene editor?

Hi everybody,



i’m relative new to jMonkey and using it with eclipse, cause i’m used to it.



I would like to design a soccerfield and keep asking myself how to design the scene and the models.

Is the usual way to do this programatically? I did all the examples and understood them without any problem. But, how for example a soccerfield with a goal? It doesn’t have to be perfect because it is more for artificial research (like RoboCup) than for really playing a game. That said, i should mention java is no problem for me at all, but using the jMonkeyPlatform keeped me confused a little.



So i know asking for “the best way” is not recommendet, but maybe some of you have experience how to begin best with a scene like a simple soccerfield: Is the best way to do this with the jmonkeyPlattform IDE or in Eclipse doing it the programatically way?



Would be pleased for some hints,



Greetings,



Pixelkalle.

Use any modelprogram (blender,3dsmax,deled ect) that can export as either ogre xml or obj. There you design the models and just load them.



Of course it is possible to create them programmatically as well, but it might be far more difficult that way.

1 Like

It is possible to do it programmatically, I do that all the time in my game which requires procedural content. However, because your soccer field is not likely to change much between plays, its probably worth making a model and using that. You might even be able to find a free soccer field model on the net.



Have a look at the first tutorial - it creates two boxes. Using that code, you can get it to create a flat square or rectangle instead. Then, just add physics to it (see the 9th tutorial for how to do that). Its pretty straightforward.

1 Like

Hi,



thanx for you answers. I used ‘deled’ for windows to crete a simple model of a soccerfield. Couln’t find a suitable one for me.



As i am Using Eclipse, where do i put the files? (Materials, xml, textures) I’m wondering that the examples with textures and models - like ‘TestFancyCar’ work. According to the source code ‘TestFancyCar’ is using a scene in “Models/Ferrari/Car.scene” which i can’t find on my hardisk.



Hope you can help me again,



Pixelkalle

they are in the testdata folder

Basically you specify a realtive path there. like “Models/Ferrari/Car.scene”

Now when you load this mdel jme asks locators where it might be, for the testdata folder and the core data folder there are already per default locators configured.

Two main options:

FileLocator: assetManager.registerLocator(“c:/mymodels/”,“com.jme3.asset.plugins.FileLocator”);

or classpath wise

assetManager.registerLocator(“mypackage/mysubpackage/”, ClasspathLocator.class.getName());