Author Topic: setRotationPivot and 3ds max.  (Read 3242 times)

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
setRotationPivot and 3ds max.
« on: December 26, 2014, 09:39:16 am »
if i changed the model's pivot in 3ds max,and saved as md2(for example new.md2)


when i uesd new.md2 in jpct,the Objec3d A,which loaded new.md2.

question:
1:A's pivot is the old pivot,or the new pivot which i modified in 3ds max?

2:if i want to use the new pivot which 3ds max created,how?
 


Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: setRotationPivot and 3ds max.
« Reply #1 on: December 26, 2014, 10:38:56 am »
and Config.useRotationPivotFrom3DS=true;

it's just the file's pivot,

not the pivot of the object.

i just need the object's pivot which is differrent to file‘s.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: setRotationPivot and 3ds max.
« Reply #2 on: December 26, 2014, 12:21:07 pm »
I'm not sure what you mean. The pivot will be cal calculated when calling build(), unless you are loading a 3ds file and are using the mentioned config setting. You can set it manually as well after calling build(). That's all there is to it. I'm not sure what you mean with this file vs. object's pivot part...?

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: setRotationPivot and 3ds max.
« Reply #3 on: December 28, 2014, 09:50:13 am »
« Last Edit: December 29, 2014, 02:13:58 am by Uncle Ray »

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: setRotationPivot and 3ds max.
« Reply #4 on: December 28, 2014, 09:54:23 am »
file's pivot's original is (0,0,0),
and object's pivot's original is the center of object.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: setRotationPivot and 3ds max.
« Reply #5 on: December 28, 2014, 01:56:14 pm »
I still don't get your point. That the object's pivot doesn't make it into the file? Then it's an exporter issue. In any other case, please try to explain again what you actually want and what you get instead, because i just don't get it... ???

Btw: I can't see your image, just some placeholder image.
« Last Edit: December 28, 2014, 01:57:47 pm by EgonOlsen »

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: setRotationPivot and 3ds max.
« Reply #6 on: December 29, 2014, 02:14:33 am »
sorry,is there can see now?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: setRotationPivot and 3ds max.
« Reply #7 on: December 29, 2014, 01:49:03 pm »
I can see the image now...but still...what exactly is the problem? That the pivot in the file is not the one that it should be? In that case, it's an issue with the exporter and it's out of the scope of the engine to fix this. If that's not the problem, i'm unsure what else is...?

Offline Uncle Ray

  • int
  • **
  • Posts: 81
    • View Profile
Re: setRotationPivot and 3ds max.
« Reply #8 on: December 29, 2014, 02:53:25 pm »
I want the object rotate with the center of the object.
when i use rotateX(),it was rotate with the point which is near but not exactly the center of the object.
Because in my project the object must be moved,so i can not set a SimpleVector(x,y,z) to be a rotationpivot.How can i setRotationPivot?

In fact,when i use rotateX(),the object was rotate with file's x-axis,not the object's x-axis.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: setRotationPivot and 3ds max.
« Reply #9 on: December 29, 2014, 03:33:06 pm »
How can i setRotationPivot?
By using the setRotationPivot()-method in Object3D? I still don't get your actual issue...you want to set the rotation pivot to something that isn't the one taken from the file? Just do it. Make sure to do it AFTER calling build() on the object.
But that has nothing to do with rotation axes. Maybe you want to do something like

Code: [Select]
obj.rotateAxis(obj.getXAxis(), <float>);

instead of

Code: [Select]
obj.rotateX(<float>);


if you want your rotations relative to the object's former rotations. But again, this has nothing to do with the pivot.