[0.3.1]Max 3DS loader need tester

Hi, all.

Im working on this project aim to support 3 kind of 3DSMAX file format:
(1).ase (67% finished)
(2).3ds (44% finished)
(3).max (0% not started)

Since I dont have enought 3DS model, I need your help to test the M3DLoader.
Source:

Download:

I rewrite the 3DSLoader, migrating it from java3d to jME3. It can load meshes and materials, but animation cant work.
Some kind of material may not work rightly.

How to use

import com.jme3.app.SimpleApplication;
import com.jme3.asset.max3ds.M3DLoader;
import com.jme3.scene.Node;

public class TestLoad3DS extends SimpleApplication {

    public void simpleInitApp() {
        assetManager.registerLoader(M3DLoader.class, "3ds");
        Node model = (Node)assetManager.loadModel("Model/bounce.3DS");
        rootNode.attachChild(model);
    }
}

References

(1) 3D-Studio File Format (.3ds)
Author: Martin van Velsen (email: vvelsen@ronix.ptf.hro.nl )
WebSite: http://www.martinreddy.net/gfx/3d/3DS.spec

(2) 3D-Studio Material-Library File Format (.mli)
Author: Robin Fercoq ( email robin@mail.fc-net.fr )
WebSite: http://www.martinreddy.net/gfx/3d/MLI.spec

(3) 3DSLoader for Java3D
WebSite: http://sourceforge.net/projects/java3dsloader/

Thanks,
Yan

2 Likes

Here is a screenshot of my test project

2 Likes

Change log v0.2
I rewrite the MeshChunk. Now it stores less vertex data and generate better vertex normals.

3DS file didn’t store normals data, it stores smooth group data instead. At this time, I ignored the smooth group data and calculate vertex normals myself. Here are some screenshots of current plugin. :expressionless:

Dolphin loaded by new MechChunk

Woman loaded by new MechChunk


Woman loaded by old MechChunk

Woman2 loaded by new MechChunk


Woman2 loaded by old MechChunk

4 Likes

Hi.

I’ve tested your loader with an XWing from tf3dm, and get an error about point/spot lights

java.lang.ClassCastException: com.jme3.light.SpotLight cannot be cast to com.jme3.light.PointLight
	at com.jme3.asset.max3ds.chunks.LightChunk.initialize(LightChunk.java:64)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:210)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:208)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:208)
	at com.jme3.asset.max3ds.ChunkChopper.loadSceneBase(ChunkChopper.java:117)
	at com.jme3.asset.max3ds.M3DLoader.parseChunks(M3DLoader.java:90)
	at com.jme3.asset.max3ds.M3DLoader.load(M3DLoader.java:73)

regards

Thank you. I fixed this bug.
Here is a new release. Use this jar plz. :smiley:

I’m currently making animations of 3DS file, it’s a little difficult for me.

1 Like

Thanks for the answer. i understand that you’re working on another part of the loader, I can wait for a solution. having your lib is already nice :smile:

There is another error, with an underflow exception this time.

janv. 15, 2016 10:05:22 AM com.jme3.app.Application handleError
GRAVE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.nio.BufferUnderflowException
	at java.nio.Buffer.nextGetIndex(Buffer.java:506)
	at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:361)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:400)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:419)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:419)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:419)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:419)
	at com.jme3.asset.max3ds.ChunkChopper.loadSubChunks(ChunkChopper.java:419)
	at com.jme3.asset.max3ds.ChunkChopper.loadSceneBase(ChunkChopper.java:329)
	at com.jme3.asset.max3ds.M3DLoader.parseChunks(M3DLoader.java:90)
	at com.jme3.asset.max3ds.M3DLoader.load(M3DLoader.java:73)

It seems that there is something wrong with the inputstream, could you plz upload the file? I’m curious about how it happend.
Maybe the file is broken. :sweat:

link to the model

i’m setting a locator to the directory with the 3ds and images pics :

this.getAssetManager().registerLocator(“datas/ships/T-65”,
FileLocator.class);
Spatial model = assetManager.loadModel(“x-wing.3DS”);
rootNode.attachChild(model);

Thank you, I find the bug.

It’s still about the spot light. There are too much params about spot light in 3DS Max while I just need 3 in JME3. Now I ignored the others.

There is another bug here:

I change the file name by hand,

Now I can load the model. The model is too bigger, I need a modelscale(0.1f).

thanks.
This will be a great help to get a “nice” project.

Here is a new screenshot, it can load 3ds just fine.
Download:

BUT, I made an KeyframeControl, it’s not really good I think…

2 Likes