3ds model loading with animation done

Or at least it’s in alpha 1 :slight_smile: I had no idea it would be such a huge project to get right!! It’s there though, try TestMaxJmeWrite if you’re interested. Works like the other converters. The 3ds file is converted to jME binary and you can view it in XML if you want. Animation going with the ever so generic Character.3ds file to show what it’s like. Animation seems smooth (my method for it is pretty darn fast), but I can’t read any FPS because I just see a solid white bar at the bottom of my screen :confused:



Supported features so far:

Geometry

Spot Lights

Point Lights

Textures

Materials

Multiple textures/materials per listed object

Smoothing Groups

Animation (scale, translation, rotation)

Parent/Child relationships







Not much else to support really. Try it out and let me know of any bugs you see. I already know of some lighting animation bugs, but I’ll work on them as I go.

with the spot/point light, would they be assigned to a lightstate and added to the node?



Also, i can’t get static meshes to load (ive tried 4 from 3dcafe.com), heres the error:



java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.ArrayList.RangeCheck(Unknown Source)
   at java.util.ArrayList.get(Unknown Source)
   at com.jme.scene.Spatial.getController(Spatial.java:156)
   at jmetest.renderer.loader.TestMaxJmeWrite.simpleInitGame(TestMaxJmeWrite.java:80)
   at com.jme.app.SimpleGame.initGame(SimpleGame.java:261)
   at com.jme.app.BaseGame.start(BaseGame.java:63)
   at jmetest.renderer.loader.TestMaxJmeWrite.main(TestMaxJmeWrite.java:40)



Any ideas?

DP
"Cep21" wrote:
I can't read any FPS because I just see a solid white bar at the bottom of my screen :/
SimpleGame has been pointing to a font located in its own package (defaultfont.tga) for a week or so now. Make sure your build process is bringing that across.
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.jme.scene.Spatial.getController(Spatial.java:156)
at jmetest.renderer.loader.TestMaxJmeWrite.simpleInitGame(TestMaxJmeWrite.java:80)
at com.jme.app.SimpleGame.initGame(SimpleGame.java:261)
at com.jme.app.BaseGame.start(BaseGame.java:63)
at jmetest.renderer.loader.TestMaxJmeWrite.main(TestMaxJmeWrite.java:40)


It looks to me that you're trying to call getController when there's no controller. I bet you're loading a 3ds mesh without animation :) My loader is somewhat "smart" and doesn't give you model animation if there isn't any.

Oh yea and just a warning about public models, they can sometimes have like 64,000 triangles in them or something similarly crazy. Trying to calculate 64,000 * 3 normals with 32 diffrent sets of smoothing groups can be um… slow :confused: So if it hangs make sure you’re not loading a bajillion vertexes. I’ll add some kind of “dumb” option later on to speed up loading at the cost of prettieness.

with the spot/point light, would they be assigned to a lightstate and added to the node?


Yea they are lights attached to the lightstate that is set to the XMLScene node in the equivalent XML file

aaah, i just substituted the url of the character.3ds to my model to test, it turns out the test tries to gain access to a controller thats not there.



And the model is a box

The jME model type is looking more and more fantastic Cep. You are really impressing me.

I figure a good support for lots of file formats could make jME a very attractive renderer. obj is next on the list.



On a side note, .3ds file animation is nothing more than interpolating scale/translation/rotation for a node with setLocal*. As such, I can’t imagine a faster way to do animation in jME.



Also, if you run the test max file and look at bounding boxes you’ll notice they don’t update correctly. Is that suppost to happen, considering I only change the localTranslation/rotation for a node and don’t touch the vertexes at all?

Can you load all the file formats from the xml?

You can convert the formats (3ds,md2,ms3d,ase) to jME binary which can be loaded. The jME binary can be converted to XML if you want.