1
의 특정 점을 중심으로 내가 그들을 확장하고 그러나, RotationInterpolator
회전 Java3D
를 사용하여 그 중 하나를 회전, Java3D에서이 개 모델을 수입하고있어,이 원점을 중심으로 객체를 회전합니다. 객체의 중심이 아닌 장면을 중심으로 객체를 회전시키고 싶습니다. 간단히 말하면, 나는 그것을 제자리에서 돌리기를 원합니다.
특정 지점을 중심으로 회전하려면 어떻게해야합니까?
TransformGroup rotateTheBlades = new TransformGroup();
rotateTheBlades.setCapability(
TransformGroup.ALLOW_TRANSFORM_WRITE);
Alpha rotationAlpha = new Alpha(-1,5000);
RotationInterpolator rotator =
new RotationInterpolator(
rotationAlpha,rotateTheBlades);
Transform3D abc = new Transform3D();
abc.rotZ(Math.PI/2);
rotator.setTransformAxis(abc);
rotator.setSchedulingBounds(new BoundingSphere());
rotateTheBlades.addChild(rotator);
rotateTheBlades.addChild(theBlades);
내 현재 회전을 수행하는 코드입니다.
원점으로 변환하고 회전 한 다음 다시 번역해야합니다. –
DR : 답을 써야합니다. 대답은 대답 이니까요. –
그래서 원점으로 변환하고 RotationInterpolator를 설정 한 다음 다시 번역 하시겠습니까? – amr