Author Topic: Re: 3ds max tips  (Read 1749 times)

Offline mAlinka

  • byte
  • *
  • Posts: 21
    • View Profile
Re: 3ds max tips
« on: November 19, 2015, 07:33:05 am »
Hello.
I just started to learn JPCT-AE enjine and have a problem with models exported from 3DS Max. When I try to load them call to Loader.load3DS(...) just hangs.
Log output:
Quote
11-19 01:15:32.238: I/jPCT-AE(1056): Loading file from InputStream
11-19 01:15:32.238: I/jPCT-AE(1056): Expanding buffers...16384 bytes
11-19 01:15:32.358: I/jPCT-AE(1056): File from InputStream loaded...13681 bytes
11-19 01:15:32.438: I/jPCT-AE(1056): Processing object from 3DS-file: Box001
11-19 01:15:32.778: I/jPCT-AE(1056): Object 'Box001_jPCT0' created using 12 polygons and 8 vertices.
11-19 01:15:32.788: I/jPCT-AE(1056): Processing object from 3DS-file: Box002
11-19 01:15:33.028: I/jPCT-AE(1056): Object 'Box002_jPCT1' created using 12 polygons and 8 vertices.
11-19 01:15:33.028: I/jPCT-AE(1056): Processing object from 3DS-file: Box003
11-19 01:15:33.528: I/jPCT-AE(1056): Object 'Box003_jPCT2' created using 12 polygons and 8 vertices.
11-19 01:15:33.528: I/jPCT-AE(1056): Processing object from 3DS-file: Box004
11-19 01:15:34.098: I/jPCT-AE(1056): Object 'Box004_jPCT3' created using 12 polygons and 8 vertices.
11-19 01:15:34.098: I/jPCT-AE(1056): Processing object from 3DS-file: Box005
11-19 01:15:34.348: I/jPCT-AE(1056): Object 'Box005_jPCT4' created using 12 polygons and 8 vertices.
11-19 01:15:34.348: I/jPCT-AE(1056): Processing object from 3DS-file: Box006
11-19 01:15:34.718: I/jPCT-AE(1056): Name in hierarchy found: Box001
And that's all.
Could you suggest me please how to solve this?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Re: 3ds max tips
« Reply #1 on: November 19, 2015, 08:28:33 am »
Can you provide me with the model to check this out?

Offline mAlinka

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Re: 3ds max tips
« Reply #2 on: November 19, 2015, 09:38:49 am »
Yes of course. Thank you for fast reply!
The model is very simple. We made it just for test

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: 3ds max tips
« Reply #3 on: November 19, 2015, 06:34:11 pm »
Strange. This file contains a chunk with a size of 0, which is not right IMHO. It should at least have the size that it takes to indicate type and size, i.e. 6 bytes. I've uploaded a version that should handle this case here: http://jpct.de/download/beta/jpct_ae.jar

Offline mAlinka

  • byte
  • *
  • Posts: 21
    • View Profile
Re: 3ds max tips
« Reply #4 on: November 20, 2015, 07:38:42 am »
I tried it, but unfortunatelly loading still hangs  :(

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: 3ds max tips
« Reply #5 on: November 20, 2015, 08:35:04 am »
 ??? Strange...can you please try the latest official release from yesterday instead: http://www.jpct.net/download.html?

Are you REALLY sure that you've replaced the jar?

Offline mAlinka

  • byte
  • *
  • Posts: 21
    • View Profile
Re: 3ds max tips
« Reply #6 on: November 20, 2015, 01:52:48 pm »
It was my first assumption that I used old jar. So I've checked it twice.
Tried the release version and had no success((

May be there is something else in model file that abnormally? Is there some necessary rules how to create and export model from 3DS Max to make it valid?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: 3ds max tips
« Reply #7 on: November 20, 2015, 02:38:19 pm »
I loaded the model without a problem at home with the new version. I'll check later and report back...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: 3ds max tips
« Reply #8 on: November 20, 2015, 05:24:58 pm »
It was caused by me being stupid. Try this jar: http://jpct.de/download/beta/jpct_ae.jar

Offline mAlinka

  • byte
  • *
  • Posts: 21
    • View Profile
Re: 3ds max tips
« Reply #9 on: November 23, 2015, 09:24:11 am »
Now the loading stage is passed without hangs but the the object is not displaying.
Here is two logs: the first one is for this problem model and second one is for model that had't any problem with loading
Quote
11-23 02:16:25.795: I/jPCT-AE(1329): Loading file from InputStream
11-23 02:16:25.805: I/jPCT-AE(1329): Expanding buffers...16384 bytes
11-23 02:16:25.805: I/jPCT-AE(1329): File from InputStream loaded...13681 bytes
11-23 02:16:25.805: I/jPCT-AE(1329): Processing object from 3DS-file: Box001
11-23 02:16:25.815: I/jPCT-AE(1329): Object 'Box001_jPCT0' created using 12 polygons and 8 vertices.
11-23 02:16:25.815: I/jPCT-AE(1329): Processing object from 3DS-file: Box002
11-23 02:16:25.815: I/jPCT-AE(1329): Object 'Box002_jPCT1' created using 12 polygons and 8 vertices.
11-23 02:16:25.815: I/jPCT-AE(1329): Processing object from 3DS-file: Box003
11-23 02:16:25.945: I/jPCT-AE(1329): Object 'Box003_jPCT2' created using 12 polygons and 8 vertices.
11-23 02:16:25.945: I/jPCT-AE(1329): Processing object from 3DS-file: Box004
11-23 02:16:25.955: I/jPCT-AE(1329): Object 'Box004_jPCT3' created using 12 polygons and 8 vertices.
11-23 02:16:25.955: I/jPCT-AE(1329): Processing object from 3DS-file: Box005
11-23 02:16:25.965: I/jPCT-AE(1329): Object 'Box005_jPCT4' created using 12 polygons and 8 vertices.
11-23 02:16:25.965: I/jPCT-AE(1329): Processing object from 3DS-file: Box006
11-23 02:16:25.965: I/jPCT-AE(1329): Name in hierarchy found: Box001
11-23 02:16:25.965: I/jPCT-AE(1329): Object 'Box006_jPCT5' created using 12 polygons and 8 vertices.
11-23 02:16:26.425: I/jPCT-AE(1329): Normal vectors calculated in 183ms!
11-23 02:16:32.335: I/jPCT-AE(1329): Memory usage before compacting: 7570 KB used out of 10152 KB. Max. memory available to the VM is 49152 KB.
11-23 02:16:32.705: I/jPCT-AE(1329): Subobject of object 12/object14 compiled to indexed fixed point data using 216/120 vertices in 246ms!
11-23 02:16:32.705: I/jPCT-AE(1329): Object 12/object14 compiled to 1 subobjects in 379ms!
11-23 02:16:34.015: I/jPCT-AE(1329): Memory usage after compacting: 7328 KB used out of 10152 KB. Max. memory available to the VM is 49152 KB.

Quote
11-23 02:50:56.995: I/jPCT-AE(1409): Loading file from InputStream
11-23 02:50:56.995: I/jPCT-AE(1409): Expanding buffers...16384 bytes
11-23 02:50:56.995: I/jPCT-AE(1409): Expanding buffers...24576 bytes
11-23 02:50:56.995: I/jPCT-AE(1409): File from InputStream loaded...19295 bytes
11-23 02:50:56.995: I/jPCT-AE(1409): Processing new material bear!
11-23 02:50:57.005: I/jPCT-AE(1409): Texture named BEAR_DIFF.PN added to TextureManager!
11-23 02:50:57.005: I/jPCT-AE(1409): Processing new material bear_eyes!
11-23 02:50:57.005: I/jPCT-AE(1409): Processing new material pupil!
11-23 02:50:57.005: I/jPCT-AE(1409): Processing new material bear_nose!
11-23 02:50:57.005: I/jPCT-AE(1409): Processing object from 3DS-file: bear
11-23 02:50:57.235: I/jPCT-AE(1409): Name in hierarchy found: bear
11-23 02:50:58.415: I/jPCT-AE(1409): Object 'bear_jPCT0' created using 1004 polygons and 564 vertices.
11-23 02:51:00.205: I/jPCT-AE(1409): Normal vectors calculated in 1605ms!
11-23 02:51:03.085: I/jPCT-AE(1409): Memory usage before compacting: 8168 KB used out of 10244 KB. Max. memory available to the VM is 49152 KB.
11-23 02:51:04.825: I/jPCT-AE(1409): Memory usage after compacting: 7641 KB used out of 10244 KB. Max. memory available to the VM is 49152 KB.
11-23 02:51:05.265: I/jPCT-AE(1409): Subobject of object 2/object4 compiled to indexed fixed point data using 2727/488 vertices in 1548ms!
11-23 02:51:05.325: I/jPCT-AE(1409): Subobject of object 2/object4 compiled to indexed fixed point data using 285/76 vertices in 57ms!
11-23 02:51:05.335: I/jPCT-AE(1409): Object 2/object4 compiled to 2 subobjects in 2245ms!
11-23 02:51:05.475: I/jPCT-AE(1409): Creating buffers...
11-23 02:51:05.545: I/jPCT-AE(1409): VBO created for object 'object4'
11-23 02:51:05.925: I/jPCT-AE(1409): Creating buffers...
11-23 02:51:05.935: I/jPCT-AE(1409): VBO created for object 'object4'

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: 3ds max tips
« Reply #10 on: November 23, 2015, 10:09:00 am »
Log output looks fine. There's no guarantee that a loaded model is located and scaled correctly so that it's visible without rescaling or translating it. A first step would be to print out the result of Object3D.getCenter() to see there the object is located in object space. It should be somewhere around the origin, but some models are way off.

Offline mAlinka

  • byte
  • *
  • Posts: 21
    • View Profile
Re: 3ds max tips
« Reply #11 on: November 23, 2015, 12:44:36 pm »
Yes, you are right. The object was placed too far away from camera. Thank you so much for help!

Offline mAlinka

  • byte
  • *
  • Posts: 21
    • View Profile
Re: 3ds max tips
« Reply #12 on: December 15, 2015, 11:25:20 am »
Hello!
Its me again. I need a little advice. I faced with the same problem: model has successfully loaded but not visible on the scene.

Model parameters are:
Origin : (0.0,0.0,0.0)
Center (Transformed center) : (-0.38567856,-2007.5032,-570.4014)
Bounding box : [-1455.0249, 1380.9241, -2979.1418, 174.60309, -944.2183, 26.167683]

Camera position is (0.0,-1402.2693,-5674.8354) and it looks at model's transformed center.

I supposed that model should be in camera's scope.
May the problem be not in model location? Some wrong materials or something else?
(I've attached the model file if you need to try to load it.)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: 3ds max tips
« Reply #13 on: December 15, 2015, 12:23:21 pm »
-5674.8354 is far beyond the default clipping distance. Try to adjust http://www.jpct.net/jpct-ae/doc/com/threed/jpct/World.html#setClippingPlanes(float, float) to a far plane of maybe 10.000 and see if that helps.

Offline mAlinka

  • byte
  • *
  • Posts: 21
    • View Profile
Re: 3ds max tips
« Reply #14 on: December 15, 2015, 01:17:36 pm »
The object is still invisible(