Designation of Ligdx division around a special axis

I am working on an application that uses the Libgdx engine and decals in 3d space. Now I need to rotate the decals around the X, Y, Z axis, but around a custom pivot point that stands somewhere in three-dimensional space.

I found that the stickers have a transformOffset field that can work with some calculations, but only Vector2. This means that I can only move the pivot point along the X and Y axis. And when I rotate the pads over the Y axis, wherever the pivot point is, the result was the same.

decal.transformationOffset = new Vector2(0, -5);

decal.rotateX(newValues[0]);
decal.rotateY(newValues[1]);
decal.rotateZ(newValues[2]);

I also need to move the rotation axis along the Z axis.

Is there any workaround?

Tnx!

EDIT:

, 3D , Z . , , .

, Z:

decal.transformationOffset = new Vector2(pivotPosition.x - decal.getPosition().x, pivotPosition.y - decal.getPosition().y);
Tween.to(decal, DecalTween.XYZ_ROTATION, 5f).target(0, 360, 0).repeatYoyo(Tween.INFINITY, 0f).start(tweenManager);

tween :

target.setRotationX(0);
target.setRotationY(0);
target.setRotationZ(0);
target.rotateX(newValues[0]);
target.rotateY(newValues[1]);
target.rotateZ(newValues[2]);

Z . , , .

Tween.to(decal, DecalTween.MOVE_XYZ, 2.5f).target(decal.getPosition().x, decal.getPosition().y, pivotPosition.z - decal.getPosition().z).repeatYoyo(Tween.INFINITY, 0f).start(tweenManager);
    decal.transformationOffset = new Vector2(pivotPosition.x - decal.getPosition().x, pivotPosition.y - decal.getPosition().y);
Tween.to(decal, DecalTween.XYZ_ROTATION, 5f).target(0, 360, 0).repeatYoyo(Tween.INFINITY, 0f).start(tweenManager);

, animatio, ?

+4
1

, .

Decal, transformOffset Vector3.

transformVertices tz, tx ty. tz .

.

- , libgdx, .

.

+3

All Articles