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);
}
}
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.
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)
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
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.