I recently upgraded from Java 1.8.0_45 on OS X to Java 1.8.0_66 only to find that the rendered scene I'm working on now shows as inverted. I was able to fix the problem by rotating the camera 180 degrees, but I don't understand why I suddenly have to do this. I looked through the Java 8 SE release notes, but didn't spot anything that looked related to this. This seems like a new bug, but how can I know for sure?
On a related note, I find that Image texture maps applied to a PhongMaterial object show the image in the scene as being flipped from left to right. Is this also documented somewhere? Is there a control that I can use to flip how the texture is used, or am I expected to give the PhongMaterial class a reversed image? Here's a rendered scene showing the left/right reversal of a texture:

Note: text is not reversed in image used as texture map.
Wayne
p.s. I've added some test code to demonstrate the first issue (inverted scene.) If you run the code under Java 1.8.0_45 on OS X, you'll get this:

But, run with Java 1.8.0_66 and you'll get this:

Here's the code:
package java3D;
import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.paint.Color;
import javafx.scene.paint.PhongMaterial;
import javafx.scene.shape.Box;
import javafx.scene.shape.Cylinder;
import javafx.scene.shape.Shape3D;
import javafx.stage.Stage;
public class Inverted extends Application {
final PerspectiveCamera camera = new PerspectiveCamera(true);
final Group cameraXform = new Group();
final Group root = new Group();
final Group world = new Group();
private void buildCamera () {
root.getChildren().add(cameraXform);
cameraXform.getChildren().add(camera);
camera.setNearClip(0.1);
camera.setFarClip(10000.0);
camera.setFieldOfView(45);
}
private Group getCube (double xPos, double zPos) {
Group cubeX = new Group();
Shape3D box = new Box(60.0, 60.0, 60.0);
box.setMaterial(new PhongMaterial(Color.RED));
cubeX.getChildren().add(box);
cubeX.setTranslateX(xPos);
cubeX.setTranslateZ(zPos);
return cubeX;
}
private Group getCylinder (double xPos, double zPos) {
Group cubeX = new Group();
Shape3D cylinder = new Cylinder(30.0, 60.0);
cylinder.setMaterial(new PhongMaterial(Color.BLUE));
cubeX.getChildren().add(cylinder);
cubeX.setTranslateX(xPos);
cubeX.setTranslateZ(zPos);
return cubeX;
}
private Group getTile (double xPos, double zPos, boolean which) {
Group cubeX = new Group();
Shape3D tile = new Box(20.0, .01, 20.0);
tile.setMaterial(which ? new PhongMaterial(Color.WHITE) : new PhongMaterial(Color.BLACK));
cubeX.getChildren().add(tile);
cubeX.setTranslateX(xPos);
cubeX.setTranslateZ(zPos);
cubeX.setTranslateY(30);
return cubeX;
}
private void buildScenery () {
for (int ii = -800; ii \<= 800; ii+=20) {
for (int jj = -800; jj \<= 800; jj += 20) {
world.getChildren().add(getTile(ii, jj, ((ii / 20 \+ jj / 20) & 1) != 0));
}
}
world.getChildren().add(getCube(-100, 200));
world.getChildren().add(getCube(100, 200));
world.getChildren().add(getCylinder(-100, 300));
world.getChildren().add(getCylinder(100, 300));
world.getChildren().add(getCube(-100, 400));
world.getChildren().add(getCube(100, 400));
world.getChildren().add(getCylinder(-100, 500));
world.getChildren().add(getCylinder(100, 500));
AmbientLight ambientLight = new AmbientLight(Color.rgb(200, 200, 200));
world.getChildren().add(ambientLight);
}
@Override
public void start (Stage stage) {
root.getChildren().add(world);
root.setDepthTest(DepthTest.ENABLE);
buildCamera();
buildScenery();
Scene scene = new Scene(root, 320, 240, true, SceneAntialiasing.BALANCED);
scene.setFill(new Color(.4, .4, .4, 1.0));
stage.setTitle("3D Scene");
stage.setScene(scene);
stage.show();
scene.setCamera(camera);
}
public static void main (String[] args) {
launch(args);
}
}
Message was edited by: 3122143 Added images and example code. Wayne
Message was edited by: 3122143 Added image to show flipped texture image. Wayne
Message was edited by: 3122143 Revised code to remove references to external XForm class. Should now run standalone.