Author Topic: 3ds-File Import - Pivot-Point not working  (Read 9488 times)

Offline Shizzn

  • byte
  • *
  • Posts: 5
    • View Profile
3ds-File Import - Pivot-Point not working
« on: September 01, 2013, 04:56:46 pm »
Hi Egon,

in my jPCT-AE-Project, I try to import an 3ds-object (created with Blender), but the pivot-point of the 3ds-file is not imported/converted. As you might remember, I use Vuforia for the tracking of a marker and need jPCT-AE to set the Rotation and Translation of 3D-objects. The objects are displayed correctly, but some of them (in my case the objects are 3D-Letters) aren't in the center of the marker because the Pivot-Point in jPCT-AE is not in the center of the object. So, here's my Bug-Report:

Bug: The Pivot-Point of an imported 3ds-object is not converted to the Object3D-object.


What did I try to solve the problem?
  • change Config.useRotationPivotFrom3DS
  • use Config.oldStyle3DSLoader
  • scale the object with Blender (instead of jPCT)
  • check the Pivot-Point of the 3ds-object with 3dsMax

What's the effect?
jPCT-AE doesn't take the Pivot-Point of the object, but the center of the bounding box of the object, even if Config.useRotationPivotFrom3DS is true. The difference is shown on pivot_bug_1.png in the attachments: The Pivot-Point is marked with big arrows. The center of the bounding box is marked with the coordinate axes.

What's my workaround?
I load the objects via Loader.load3DS (doesn't matter, whether Config.useRotationPivotFrom3DS is activated or not) and set their RotationPivot-Point (setRotationPivot) to (0, 0, 0). Then, jPCT-AE does not take the center of the bounding box, but Blender's world center. This can be seen on pivot_bug_2.png: The Pivot-Point is little 'yellow' dot with the arrows. The world's center is in the middle of the crosshair.


As you see, I checked many cases and tried several scenarios. One of my biggest concerns was, that Blender does not export the Pivot-Point. But as mentioned earlier, I imported the 3ds-object with 3dsMax, checked the Pivot-Point and realized that it was at the right position. That's why I think, that jPCT-AE does not import the Pivot-point of the object correctly.


Greetings
Shizzn

[attachment deleted by admin]
« Last Edit: September 01, 2013, 04:58:59 pm by Shizzn »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: 3ds-File Import - Pivot-Point not working
« Reply #1 on: September 01, 2013, 09:41:22 pm »
I wouldn't consider this to be a real "bug". The 3ds loader is based reverse engineered data. No official format documentation is available and sometimes, the specs are not complete, wrong or some exporters to different things that the specs don't cover. If you can provide me with a sample model, i'll take a look at it and see if i can fix it.
BTW: jPCT-AE never takes the center of the bounding box as pivot. The pivot is either taken from the file or calculated based on the geometry. If the pivot is always in the center of the boundig box in your case, it might be taken from file but missing some additional transformation.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: 3ds-File Import - Pivot-Point not working
« Reply #2 on: December 11, 2013, 01:49:09 pm »
I just checked Blender v2.69 3ds export script and it seems like they removed the code that adds pivot point into 3ds file. According to the comment in the script, it says the code crashes Blender, and it really does (tested). I'm looking around for the fix now~ Do you have any idea?
« Last Edit: December 11, 2013, 01:57:24 pm by kkl »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: 3ds-File Import - Pivot-Point not working
« Reply #3 on: December 12, 2013, 09:45:24 pm »
Use an older version of Blender where it doesn't crash...?