3ds-File Import - Pivot-Point not working

Started by Shizzn, September 01, 2013, 04:56:46 PM

Previous topic - Next topic

Shizzn

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]

EgonOlsen

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.

kkl

#2
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?

EgonOlsen

Use an older version of Blender where it doesn't crash...?