Difference in position when building object and not builing them

Started by cintix, November 13, 2011, 07:29:29 PM

Previous topic - Next topic

cintix

Hi agian,

In my little test I loading 3 rather simple 3DS models.
I created them in one project and exported them one by one, so when I loaded them. They would be placed correctly just by loading them.
This worked great until i noticed that I did not call world.buildAllObjects(), and I thought that might be a good idea to get better performance.

Then after building all object then the models gets a placed wrong. NOT all wrong but the Y axis is of like 69 and 56 on another object.
Have anyone of you had this problem ??



Faith is for the weak...

EgonOlsen

build() does nothing to the objects geometry. However, it does something to the rotation pivot, i.e. it calculates a new one. Without build(), the pivot is at (0,0,0). Try to build the objects (you are not supposed to omit this call, because otherwise, no normals and no bounding box are present) and reset the rotation pivor to (0,0,0) afterwards to see if that helps.

cintix

Ohh thank you agian..
using  object3D.setRotationPivot(new SimpleVector(0,0,0)); after doing world build fixed everything :-)
Faith is for the weak...