Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8123163

PhongMaterial: visible seam on sphere

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • JDK 1.8.0 b96 64bit, JavaFX 8.0, Windows 7 64bit, NetBeans 7.3

      When using the following code, as the sphere rotates due to the transition, a visible colored seam appears that goes from the north pole to the south pole when the back of the sphere is shown, probably on the 360->0 degree line. The color appears slightly different and a darker tone of orange (in this example - with any other bright color including white): when the line appears on screen, the sphere looks darker on the left side and brighter on the right side.

      Color diffuseColor = Color.ORANGE;
      Color specularLight = Color.rgb(55, 55, 55);
      PhongMaterial material = new PhongMaterial(diffuseColor, null, null, null, null);
      material.setSpecularColor(specularLight);
      Sphere sphere = new Sphere(200);
      sphere.setMaterial(material);
      sphere.setLayoutX(300);
      sphere.setLayoutY(300);
      AmbientLight ambientLight = new AmbientLight();
      ambientLight.setColor(Color.rgb(255, 255, 255, 0.15));
      PointLight pointLight = new PointLight();
      pointLight.setColor(Color.WHITE);
      pointLight.setLayoutX(200);
      pointLight.setLayoutY(-100);
      pointLight.setTranslateZ(-1100);
      pointLight.getScope().add(sphere);
      Group content = new Group();
      content.getChildren().addAll(sphere, pointLight, ambientLight);
      Scene scene = new Scene(content , 600, 600);
      scene.setFill(Color.BLACK);
      PerspectiveCamera camera = new PerspectiveCamera(false);
      scene.setCamera(camera);
      primaryStage.setTitle("3D World");
      primaryStage.setScene(scene);
      primaryStage.show();
      RotateTransition rotateTransition = new RotateTransition();
      rotateTransition.setAxis(new Point3D(0, 1, 0));
      rotateTransition.setDuration(Duration.seconds(30));
      rotateTransition.setByAngle(360);
      rotateTransition.setCycleCount(Timeline.INDEFINITE);
      rotateTransition.setInterpolator(Interpolator.LINEAR);
      rotateTransition.setNode(sphere);
      rotateTransition.play();

      This should not happen, the sphere should have a uniform orange tone on all its sides.

        1. WhiteSpecular.JPG
          WhiteSpecular.JPG
          33 kB
        2. Button.JPG
          Button.JPG
          68 kB
        3. Bug.java
          3 kB

            yaow Yao Wang (Inactive)
            fbouyajfx Fabrice Bouyé (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: