JDK-8093983 : 3D Rotation results in truncated view with default parallel camera
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0
  • Priority: P5
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2011-05-29
  • Updated: 2015-06-12
  • Resolved: 2014-01-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Duplicate :  
Relates :  
Description
Rotating any shape on any 3D axis results in a truncated scene view. Below is a simple example that illustrates this bug.  We should see a 4 sided polygon, but we only see a triangle instead.

import javafx.application.Application;
import javafx.geometry.Point3D;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.Polygon;
import javafx.scene.transform.Rotate;
import javafx.scene.transform.Translate;
import javafx.stage.Stage;

public class RotationBug extends Application {
   @Override
   public void start(Stage stage) throws Exception {
      Group g = new Group();
      Scene scene = new Scene(g, 400, 400);
      Polygon p = new Polygon(new double[] { 0, 0, 0, 100, 100, 100, 100, 0, 0, 0 });
      p.setStrokeWidth(5);
      p.getTransforms().add(new Translate(200, 200));
      p.getTransforms().add(new Rotate(45, 0, 0, 0, new Point3D(1, 1, 0)));
      g.getChildren().add(p);
      stage.setScene(scene);
      stage.setVisible(true);
   }
   public static void main(String[] args) {
      Application.launch(RotationBug.class, args);
   }
}
Comments
This is a duplicate of RT-32092
23-01-2014

> If you add a PerspectiveCamera to the scene, which is the expected way to use 3D transforms, this will work fine. It depends on size of polygon, big polys will be clipped even with perspective cameras. In order not to be clipped (by zNear) it requires to set small camera FOV. In that case camera will be located far behind Z=0. But not very small in order no to be clipped by far z-plane. For total control we need to add an API controlling zNear, zFar in camera space as well as camera position.
03-06-2011

I still think there might be an issue with the default parallel camera view transform. It seems counter-intuitive for the Z=0 plane to be at the front clipping plane, which is what it seems like is happening. I'll reopen this bug, but leave it at a low priority.
01-06-2011

Sorry for false issue. Thank you for the follow up information. After I posted this bug it occurred to me that the 'background plane (z=0)' is what was cutting it in half. If I translate the rotated shape so that all of it is in front of the background plane, then that works also, even with parallel camera
01-06-2011

The bug appears to be with the default, parallel camera. If you add a PerspectiveCamera to the scene, which is the expected way to use 3D transforms, this will work fine.
31-05-2011