Re: An advanced example

Started by bennoms, June 11, 2008, 10:52:49 PM

Previous topic - Next topic

bennoms

Hi !

I really liked your project feud_demo! But i´m trying to load a *.3DS file created on 3ds Studio Max 9.0 on it, and I can´t find a way to render the scene objects with their texture.
I create the scene on 3ds Studio with materials (checker, bitmaps, gradient and others) and I´d like to render it on like a Level for feud_demo, but all textures get WHITE.

I´m trying something like this:

////////////////////////////////////////

Object3D[] objs = Loader.load3DS("C:/Development/feud_demo_tests/bin/Campus.3DS", 1.0f );

for (int i = 0; i < qtdObjs;i++){
           objTemp = objs;
           //objTemp.calcTextureWrap(); //tried with and without this metod
           world.addObject(objTemp);
        }

////////////////////////////////////////

If I use "Unwrap UVW" on 3ds studio and link a bitmap file, I can call setTexture in the demo (it works), but
- isn´t there a way to load the whole 3DS scene without the needing of create a lot of external bitmaps? Or maybe i´m doing something wrong (probably)!

Because if i have a lot of walls in a complex scene, I´d like to fix the walls textures on 3ds Studio rather than create a UV Map.

- And when I create a light in the 3DS scene, the same isn´t created in the demo!

It would be easier if I knew how the Level.ser was generated, but I don´t.

Oh! I´m new at JPCT programing and 3DStudio design so, i´m sorry about my litle knowledge.

Could you please help me?

Thanxs B.


Quote from: EgonOlsen on May 15, 2007, 08:54:41 PM
I've finally managed to finish documentation of my client-/server-based fps-example. It's for you to enjoy, rip apart, make jokes about ...whatever. Please note that the level and the models are not done by me. Here are the files: http://www.jpct.net/download/feud_demo.zip and here's a webstart demo: http://www.jpct.net/demos/feud/feud.jnlp.

Have fun!

JavaMan

Nice job. Everything is really smooth, and moves freely. I like the skybox to.

Jman

Melssj5

If u put a color to anbobject in 3ds max and it has no pic texture then it will be rendered on JPCT with that color, if you are using a picture as a texture in 3ds max then you have to add it to the TextureManager with the same name that was exported by 3dstudio Max, for example, youa re using a picture called wallnumber100a.jpg then it will be exported a reference to a texture called wallnumb.JPG.

The TextureManager class in jpct manage the textures for an Object3D as was defined in the 3ds file. If you do not apply anay texture to your map then obviously you wont see any texture than a white color.

Hope this helps.
Nada por ahora

bennoms

#3
Yes it sure helped!

I was doing:

SimpleStream ss = new SimpleStream("walls.jpg");
          TextureManager.getInstance().addTexture("WALLS.JPG", new Texture(ss.getStream()));

after

Object3D[] objs = Loader.load3DS("C:/Development/feud_demo_test/bin/Campus.3DS", 1.0f );


I thougth I would´t need to Use addTexture(), as in the log showed * that after the Load3DS method, it already adds the texture.

*=
"
Processing new material 01 - Default!
Texture named FLOOR.JPG added to TextureManager!
Processing new material 02 - Default!
Texture named WALLS.JPG added to TextureManager!
Processing object from 3DS-file: Box01
Object 'Box01_jPCT25' created using 12 polygons and 8 vertices.
Processing object from 3DS-file: Box05
Object 'Box05_jPCT26' created using 131 polygons and 67 vertices.
"

But adding the Texture with the same name showed in the log (FLOOR.JPG,WALLS.JPG) before loading de 3DS file worked fine.

Thanxs for the help!

I have a few more questions xD:

1 - If I create a material on 3dStudio Max, like a reflecting metal material, or a water fluid and transparent material, is there any way to load that material on JPCT or I can only load image textures?

1 - Is it possible to load a created "Light" from a 3ds scene? Because I created on the same scene, but It doesn´t load this light. The log shows this object was ignored (not counted).

Thanxs All!
B.

EgonOlsen

Quote from: bennoms on June 12, 2008, 06:58:50 PM
1 - If I create a material on 3dStudio Max, like a reflecting metal material, or a water fluid and transparent material, is there any way to load that material on JPCT or I can only load image textures?

1 - Is it possible to load a created "Light" from a 3ds scene? Because I created on the same scene, but It doesn´t load this light. The log shows this object was ignored (not counted).
jPCT loads polygonal mesh data and texture information from 3ds. If no textures are present, it also loads diffuse colors. That's all. Everything else will be ignored by the loader.

EgonOlsen

I've moved this part of the thread to support, because that is, where it actually belongs.

bennoms


Melssj5

Lights and those nicely materials are not imported to jpct directly, but you can do some things with jpct, you can set the transparency level for an object and you can put some spheres representing the lights and checking the names in jpct you can place the lights.
Nada por ahora

bennoms