Custom model

Hi all,



Soon, i will be done with my first jmonkey project. It's a multiplayer tank shooting game…



But now i try to make a very different game, maybe a little difficult for me.

i need a custom "modell-maker" like the creature builder in Spore game

so i load a dog for example and i can add more legs, modify the leg's height, add eyes and more

i don't know where can i start to do it

can you take me some recommandation for this?



after this i'd like to implement some advanced physic. so the modell's physic works like the real life, for example

if i make the dog's leg too long, the dog is always fall back…



it is possible to do this or it's a very-very difficult tasks?



thanks and sorry for my English




First:


boci said:
it is possible to do this or it's a very-very difficult tasks?


Difficult: Absolutely.  Possible: Absolutely. :D

I would first look into TriMesh and how objects are built when you create a shape or load a model.  Using the example of adding legs to a dog, you will probably have a dog model loaded and a leg loaded into a TriMesh.  When you want to add a leg, you will just need to figure out 'where' on the model to add the triangles..  I will warn you though, these types of manipulations can be tough; not because technically morphing the model is difficult, but getting it to look right is very tough.  I would examine the kinds of constraints Spore imposes on the user and try to determine how limited or how free the options can be.

Hi



Thanks for the answer.

well, first time i will try to implement it to my tank game

for example, you can attach a machine gun to tank or replace it to a new one

it's not free as Spore of course, but it will do the job for me…

For attaching a machine gun a tank I would simply attach the spatial containing the machine gun to the spatial with the tank.  By doing this, the two components retain the ability to rotate independently, so I'd say that's actually more free than Spore!

Yeah, i dont think for the rotation thing :slight_smile:

very good idea, but it seems to difficult to me, now…

If I understand well there are 2 main things you have to worry about. One like sbook mentioned being how to connect 2 parts of the model in terms of polygons. Secondly there's of course the behaviour or attached parts.

I can't really help you with the first part other than to say I'd try to do something with volume (convert to voxels, add new part, convert back). On the second part there have been pretty amazing results using evolutionary algorithms. You have rules on how each part can move and physics etc. and you have a certain fitness function (this could be time before falling down times distance travelled in case of a moving animation). You then generate random movements and select the best results according to the fitness function etc.

It has been done with models of humans and it produced very realistic movements as well as some awesome  animation that cannot be (easilly) recorded with motion capture.