setRotationPivot and 3ds max.

Started by Uncle Ray, December 26, 2014, 09:39:16 AM

Previous topic - Next topic

Uncle Ray

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?



Uncle Ray

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.

EgonOlsen

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...?

Uncle Ray

#3

Uncle Ray

file's pivot's original is (0,0,0),
and object's pivot's original is the center of object.

EgonOlsen

#5
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.

Uncle Ray


EgonOlsen

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...?

Uncle Ray

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.

EgonOlsen

Quote from: Uncle Ray on December 29, 2014, 02:53:25 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


obj.rotateAxis(obj.getXAxis(), <float>);


instead of


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.