Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do setRotationAxis and setRotate work in JavaFX 3D?

1049313Nov 4 2013 — edited Nov 8 2013

There is a texture I have to apply to a sphere. It has an arrow along equator.

When I applied a PhongMaterial with that texture to my sphere, an arrow I needed on top, was on the bottom facing direction opposite of what I needed.

I then called

                    final Sphere sphLeaf = new Sphere(R);

                    sphLeaf.setRotationAxis(Rotate.X_AXIS);

                    sphLeaf.setRotate(180.0);

Then the arrow was correctly placed on top of the sphere, but still facing wrong direction.

I thought that calling

                    sphLeaf.setRotationAxis(Rotate.Y_AXIS);

                    sphLeaf.setRotate(180.0);

would point my arrow where I needed, but instead it was now on the side of the sphere, though facing the right direction.

I thought that each call to setRotationAxis must limit rotation to that axis only. Why is there extra rotation occurring on top of what I requested?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2013
Added on Nov 4 2013
27 comments
3,058 views