jPCT-AE - a 3d engine for Android > Support

how to do continuous rotating with different axis correctly?

(1/3) > >>

tomoroho:
Dear Egon,

I want to perform an effect that a object rotatez with the vector "Pivotz" for degree A.
And then in the new place rotatex with vector "pivotx" for degree B.
The first rotating works well,and the second rotating works too,but not start from the new place.
It seems to start from the original place,just like the first rotating is with its own center vector.

thx very much.

EgonOlsen:
Rotations are cumulative but the pivot are not, because they will be evaluated at render time only. This means that the last pivot is the one that will be taken for rendering. In your case, you might want to consider to use dummy Object3Ds instead, assign them as parents to your actual object do the rotations on them instead.

tomoroho:

--- Quote from: EgonOlsen on September 07, 2012, 02:02:48 pm ---Rotations are cumulative but the pivot are not, because they will be evaluated at render time only. This means that the last pivot is the one that will be taken for rendering. In your case, you might want to consider to use dummy Object3Ds instead, assign them as parents to your actual object do the rotations on them instead.

--- End quote ---

Maybe u misunderstand what i mean. The whole animation can be divided to two stage. In stage one, the object rotatez with the vector pivotz by setprivot method, and it play very well.After stage one completed,the object translate to new place .After all these done, I setprivot to the new one which is privotx,and I want the object to rotate with axis-x. And also the object rotate with the new pivot ,but just not from the new place to which the stage one translate. At the time stage one ended and stage two started,the object moves away and rotatex from that place. It looks like in stage one the object rotatez with its center vector but not the pivotz which been set.

The rotating plays well , but not continuously. And I don't know why the place changed in the beginning of the stage two.
thanks.

EgonOlsen:
I don't get it...maybe a drawing can help... ???

tomoroho:

--- Quote from: EgonOlsen on September 07, 2012, 07:49:18 pm ---I don't get it...maybe a drawing can help... ???

--- End quote ---
I don't know how to fix it. I make a simple demo to display the problem.
would u please review it and help me .
Place the src folder in the HelloWorld project.
Just click on the cube .and see the doAnimation() method.
thanks very much.

[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

Go to full version