www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: mikedehaan on April 03, 2006, 01:39:57 am

Title: Using Blender to create a 3ds file
Post by: mikedehaan on April 03, 2006, 01:39:57 am
I'm trying to create a 3ds file in blender similar to the ql.3ds from the fps demo app.

I'm having some trouble understanding materials and textures.  What I'm trying to do is create a terrain in blender and assign some simple textures to parts much like the wooden doors and brick walls in the ql.3ds file (e.g. water for a small pond, grass for the rest - nothing too complicated).

I have sample code that demonstrates my problem (modified version of the fps demo) and blender files, but I don't have a place to make them available.

Any advice would be greatly appreciated.

-Mike
Title: Any suggestions on a better modeling tool?
Post by: mikedehaan on April 03, 2006, 06:08:58 am
Is there a another tool that I should be using instead of Blender to create 3ds files?  What is everyone else using?

- :?:
Title: Using Blender to create a 3ds file
Post by: Mr.Marbles on April 03, 2006, 03:59:22 pm
I'm not really an expert in modeling but I know "3D Studio Max" can create .3ds files.
Title: Using Blender to create a 3ds file
Post by: Remo on April 04, 2006, 08:22:25 am
You can work with Milkshape 3D. You can use it to do some modeling or importing a MDL file ( Blender can export to mdl right?) and export to 3DS.

http://www.swissquake.ch/chumbalum-soft/ms3d/index.html
Title: Using Blender to create a 3ds file
Post by: Melssj5 on April 04, 2006, 05:57:21 pm
I do all my models in 3d studio max, aplying the textures is easy and generates a 3ds file.
Title: Using Blender to create a 3ds file
Post by: Crate on April 04, 2006, 08:07:36 pm
blender should work. If you are getting started, Misfit Model 3D might be the thing for you. It is a lot like milkshape, except its free. It can also export md2s.

http://www.misfitcode.com/misfitmodel3d/
Title: Using Blender to create a 3ds file
Post by: Melssj5 on April 06, 2006, 05:38:35 am
I didnt liked Misfit, I downloaded it and used a bit but it wasnt good for me, I strongly recomend 3ds max 7 or 6. Its very simple to use, you can render and apply the textures very easy. it dont export to md2 without a plugin, but 3ds is enough for me.
Title: Using Blender to create a 3ds file
Post by: mikedehaan on April 06, 2006, 06:29:19 am
Doesn't 3ds max cost something like $4,000?

I've tried AC3D which costs about $59 (for the basic version).  The textures and 3ds export seem to work for the most part.  Although, some of the models I've created with AC3D won't load in jPCT.  I get an exception in MergeObjects...

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 20
   at com.threed.jpct.Object3D.appendToObject(Unknown Source)
   at com.threed.jpct.Object3D.mergeObjects(Unknown Source)
   at JPCTDemo.<init>(JPCTDemo.java:275)
   at JPCTDemo.main(JPCTDemo.java:152)
Title: Using Blender to create a 3ds file
Post by: Melssj5 on April 06, 2006, 08:20:13 am
Well, it cost me 5 USD!!!!  :x  :x  :x  :x (cracked version :oops: )

If you dont want to pay for the license then you can use it for free for 2 months without actuvating it, after that you can uninstall and reinstall it again.
Title: Using Blender to create a 3ds file
Post by: Melssj5 on April 06, 2006, 08:25:45 am
Well, the 3DS format is quite complex. It uses chunks describing linked geometries or something like that. Egon said that he uses a dosument that he found on the web several time ago of someone that made reverse ingeniering to a 3DS file. I also have found on the web information about the 3DS file format but nobody seems to know perfectly all about it because is not a free file format. In anyway I suppose that there are somethings that AC3d do that cant be understood by the loader that Egon used. or maybe its a bug if you said that it only happens with some models without changing the java programation.
Title: Using Blender to create a 3ds file
Post by: EgonOlsen on April 06, 2006, 07:21:29 pm
Quote from: "mikedehaan"
I've tried AC3D which costs about $59 (for the basic version).  The textures and 3ds export seem to work for the most part.  Although, some of the models I've created with AC3D won't load in jPCT.  I get an exception in MergeObjects...

Exception in thread "main" java.lang....: 20
   at com.threed.jpct.Object3D.appendToObject(Unknown Source)
   at com.threed.jpct.Object3D.mergeObjects(Unknown Source)
   at JPCTDemo.<init>(JPCTDemo.java:275)
   at JPCTDemo.main(JPCTDemo.java:152)
Looks more like a problem in jPCT than in the model itself. Which version of jPCT are you using and can you send me one of the models causing the problem for debugging?
Title: Using Blender to create a 3ds file
Post by: mikedehaan on April 07, 2006, 01:35:01 am
For the jPCT version, when I run...

Code: [Select]

public static void main(String args[]) {
System.out.println(Config.getVersion());
}


It returns...

Code: [Select]

1.10


I'll need to work on getting you a failing 3ds file.  I overwrote the bad one by mistake.  I will hopefully have one by tonight.  Should I send it to your email address on the contact page?

Also, I'm using 3ds because it was the only loader I recognized.  Is there a better(non-proprietary) way that I should be doing this?  Are there plans in the future to support Blender or other open source modelers?
Title: Using Blender to create a 3ds file
Post by: mikedehaan on April 07, 2006, 05:29:08 am
Egon, I sent you an email that has the 3ds file I tried to load.  Let me know if there's anything else I can provide you with.
Title: Using Blender to create a 3ds file
Post by: Melssj5 on April 07, 2006, 05:41:51 am
Can you send  it to me too, because I want to test it on the 3d studio max and export it again to see what happens!!!

My mail is melssj5@hotmail.com
Title: Using Blender to create a 3ds file
Post by: EgonOlsen on April 12, 2006, 06:50:52 pm
I finally found the time to test the model you sent to me...and i can't reproduce your problem with it. Here's what i did and what works fine:

Code: [Select]

    Object3D[] objs=Loader.load3DS("bad_terrain.3ds",1f);
    Object3D tmp=new Object3D(0);
    for (int i=0; i<objs.length; i++) {
      tmp=Object3D.mergeObjects(objs[i], tmp);
    }


So i guess you must be doing something else which results in the crash. Can you post some code for small test case of what exactly you are doing?

Edit: Opps, i finally found something: Calling build() on the objs (which is not needed btw) seems to cause the problem. I'll investigate this...
Title: Using Blender to create a 3ds file
Post by: mikedehaan on April 12, 2006, 07:13:03 pm
Hmm....This error seems to happen when the rotateMesh() method is called.

Here's my code snippet...

Code: [Select]

Object3D aobject3d1[] = Loader.load3DS("3ds" + c + "terrain.3ds", 60F);
level = new Object3D(0);
for (int k = 0; k < aobject3d1.length; k++) {
Object3D object3d = aobject3d1[k];
object3d.rotateMesh();
level = Object3D.mergeObjects(level, object3d);
}


To be honest, I've been experimenting with JPct by taking the demos and modifying them.  This example came from the FPS demo.  I don't really know why the rotateMesh() method is there, nor do I know the effects of using the method.
Title: Using Blender to create a 3ds file
Post by: EgonOlsen on April 12, 2006, 07:24:25 pm
Ok, i've found the problem. The upcoming version 1.11 should fix it. For now, just leave out any call to build() or rotateMesh() on the sub objects. It's not needed anyway at this stage of your code.