3DS files and LWJGL

Hi, I’m trying to use the 3DS loader package provided by:

http://games.swizel-studios.com/

Anyone have experience using this package?
It seems that when I load a 3DS file using

scene = new Scene3ds(new FileInputStream(“data\skeleton.3ds”));

The system.out keeps getting sent numbers which I
guesstimate to be framerates.

Is there a way to turn that off?
Right now I added a call:

System.setOut(new PrintStream(new ByteArrayOutputStream()));

Really stupid hack…

OT but…

“data\skeleton.3ds”

NEVER use backslashes in a path. It works on windows but everyelse it doesn’t.

Does anyone know if another way to load 3DS files
with LWJGL ???

It seems this one only loads from 3D studio V3…
As well as I can’t figure out how to get textures to work.

I looked at JME for a little bit.
can’t seem to find enough documentation on it to start.

Just wondering what people use for loading models for
LWJGL ??

EDIT:

While searching for something which loads models into
openGL, I came across this :

http://www.jpct.net/

I guess this is what I’m looking for …
I can’t seem to find a tutorial or example code though…
If some one can kick me towards the right direction,
that’s be great.

Along with jME and Xith, which one is better ??
It seems Xith has more support for JOGL right now…
Maybe I should ditch LWJGL and go with JOGL

Hides before the stones come flying at him

Well try the JDC utils

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=LWJGL;action=display;num=1078868758

He has a 3ds loader thats is a gametutorials.com tutorial. He has hacked it into HIS framework. I am sure it would be easy to hack it into yours. You just have to change a single function.

Also be aware that it only support one material pr object, and no vertex colors. It will also try to load in a texture if it are specified in the material settings (Thats a part of the 3ds format)

good luck

you know im biased with the jME side. But I just wanted to make something clear about the 3ds loading thing.

We dont load 3ds files into the scene graph. We load .jme ( which is faster at loading in the scenegraph btw ) into the scenegraph. You can convert 3ds to .jme using the converter available with the jme distribution.

As for the documentation thing, still with the 3ds theme here, look at jmetest.renderer.loaders.MaxtoJmeTest. It converts a 3ds file to a jme file and loads it into the scenegraph. You can alter that test to create a FileOutputStream and save the .jme file for later use (thats what I am doing in my game).

Hope that helps.

PS. at gametutorials.com you have to buy their CD to find out how to load an animated 3ds file into the scenegraph, so if your not willing to part with you hard earned money, go with jME :wink:

DP

If he uses JDC utils he gets a loader he can use whereever he wants. The point is that JCD used a tutorial from gametutorials.com and hacked it into his framework without any effort.

So the question is do nech_neb just want one file that can load or an entire framework :slight_smile:

Due to DP’s strong support for jME ,
here and in other posts…

I’ve decided to research deeper into jME.

Problem is: I’m an idiot, and can’t get the CVS working

HOST : cvs.dev.java.net
Repository Path : ???
User: guest
Password : blank?

Help?

:-[

Thats a hard question…Realy cant help you… but Anonymous access to a CVS server usualy have username anonymous.

But it could also be your protocol. is that set to pserver?

It’s been a while since I looked at this code, but as far as I know it should handle textures OK. Check out the example source for loading and rendering a model on this page here.

http://games.swizel-studios.com/tutorials.html

The face.3ds should have a texture face.png, which gets loaded and rendered with the model.

http://games.swizel-studios.com/tutorials/beta/src/beta_0.3.zip

Hope this helps,

Andy.

Hey Andy?

Does it only support 3DS files using version 3?
Cause I can load the skeleton provided by the
tutorial just fine.

But I can’t seem to load my own 3DS files created
by 3DS MAX 6.

in jME you can ;D (ive done it loads of times)

anyway, back to your guest thing.

I dont recall the username or password (but I think its blank), you could try anonymous.

but the repository path is: /cvs

scroll down until you find jme (not jME) and checkout a copy.

Or an even better way is to register with java.net and request an “Observer” status, that way, you can post bugs if you see any.

DP

I know it handles most (if not all the) v3 .3ds nodes, I know it handles some from v4 as well. I’m not sure if it’s a complete list.

If you have some files that don’t work post them on the internet and I’ll have a go and see if I can add in the required changes.

Regards,

Andy.

[quote]It’s been a while since I looked at this code, but as far as I know it should handle textures OK.
[/quote]
Yes it does. But the texture reported by mri-v3ds is the name of the material in MAX. So you need to rename the material to the texture path.

Don’t think it spammed System.out. There is a Scene3ds constructor that takes a TextDecode3ds wich can be used to get a debug output.

Also note that mri-v3ds only parses the 3ds file and stores the data in memory. It is not a 3ds viewer!

Correct, the library only parses the files into an internal data structure it’s up to you to write the rendering part.

I’ve already written a simple one, see the link further up the page in my previous comments.

It’s kind of hard for me to debug some of these problems, since I don’t have 3D Studio Max, it helpful comments like these that allow me make improvements to the code for all to see.

Regards,

andy.

Hi,

i also tested the .3ds Loader from Mri. It seems to load Mesh and Texture cords quite well.
When i try to load a Scene with Light made in 3D Max 5 a “Negative Chunk Size” Exception is thrown. Anyone loaded Scenes containing Light using the Loader ?

Stay Tuned,
Jens

The example code, listed in one of my previous posts in this thread reads in a uses lights.

Andy.

hmm,

can you give me a link ?

I only need the .3ds file so i can load in into Max and see for myself ;D

  • jens

Here are the links you’ll need.

http://games.swizel-studios.com/libraries.html

http://games.swizel-studios.com/tutorials/beta/src/beta_0.3.zip

The skeleton.3ds file in the zip should use lights I think. It’s been a while since I checked.

Andy.

Thx,

and the first Test worked, now i have to implement it :slight_smile:

Stay Tuned,
Jens

Another way to tackle the problem is to write a 3DS MAX import/export script into your own format. This way you could export only the information you really need in your 3D engine. If you plan to optimize for size (e.g. webstart or a demo) I would consider this.

Pros for using the script is
easy to maintain/make changes
very flexible
Cons
you have to be familiar with MAX Script language
you need 3DS Max software

if u are interested in this I would have a look at the MD5 (Doom3) import export scripts from “der ton” …

/Christian