Author Topic: Re: An advanced example  (Read 6268 times)

Offline bennoms

  • byte
  • *
  • Posts: 4
    • View Profile
Re: An advanced example
« on: June 11, 2008, 10:52:49 pm »
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.


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!

Offline JavaMan

  • long
  • ***
  • Posts: 231
    • View Profile
Re: An advanced example
« Reply #1 on: June 11, 2008, 11:27:00 pm »
Nice job. Everything is really smooth, and moves freely. I like the skybox to.

Jman

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: An advanced example
« Reply #2 on: June 12, 2008, 04:53:13 pm »
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

Offline bennoms

  • byte
  • *
  • Posts: 4
    • View Profile
Re: An advanced example
« Reply #3 on: June 12, 2008, 06:58:50 pm »
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.
« Last Edit: June 12, 2008, 07:01:59 pm by bennoms »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: An advanced example
« Reply #4 on: June 12, 2008, 07:03:22 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: An advanced example
« Reply #5 on: June 12, 2008, 07:04:43 pm »
I've moved this part of the thread to support, because that is, where it actually belongs.

Offline bennoms

  • byte
  • *
  • Posts: 4
    • View Profile
Re: An advanced example
« Reply #6 on: June 12, 2008, 07:41:10 pm »
Ok!

Thanxs All.
B.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: An advanced example
« Reply #7 on: June 12, 2008, 09:49:01 pm »
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

Offline bennoms

  • byte
  • *
  • Posts: 4
    • View Profile
Re: An advanced example
« Reply #8 on: June 25, 2008, 02:21:53 am »
Ok, thanxs again!
B.