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

FX8 3D TriangleMesh : 'Small' triangle causes exception to be thrown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      Win 7-64, JRE 8-b84

      Description

      This valid triangle causes the following exception:

      float[] points = new float[]{-0.001f, 0.142854f, -0.025393f,
                                            -0.001f, 0.142603f, -0.025318f,
                                            -0.000951f, 0.142652f, -0.025057f};
      float[] texCoords = new float[]{0.0f, 0.0f};
      int[] faces = new int[]{0,0, 1,0, 2,0};
      TriangleMesh triaMesh = new TriangleMesh(points, texCoords, faces);

      MeshView triaMeshView = new MeshView(triaMesh);
      triaMeshView.setMaterial(new PhongMaterial(Color.RED));
       
      But it works fine if the vertices are scaled by 10:

      float[] pointsScaled = new float[]{-0.01f, 1.42854f, -0.25393f,
                                                      -0.01f, 1.42603f, -0.25318f,
                                                      -0.00951f, 1.42652f, -0.25057f};

      java.lang.RuntimeException: nativeObject.buildGeometry failed
              at com.sun.javafx.sg.prism.NGTriangleMesh.updateNativeIfNeeded(NGTriangleMesh.java:62)
              at com.sun.javafx.sg.prism.NGTriangleMesh.getNativeObject(NGTriangleMesh.java:50)
              at com.sun.javafx.sg.prism.NGShape3D.getNativeObject(NGShape3D.java:80)
              at com.sun.javafx.sg.prism.NGShape3D.renderContent(NGShape3D.java:165)
              at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:428)
              at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:69)
              at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1277)
              at com.sun.javafx.sg.prism.NGGroup.renderChildren(NGGroup.java:242)
              at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:208)
              at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:428)
              at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:69)
              at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1277)
              at com.sun.javafx.sg.prism.NGGroup.renderChildren(NGGroup.java:242)
              at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:208)
              at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:428)
              at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:69)
              at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1277)
              at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:116)
              at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(AbstractPainter.java:219)
              at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:93)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
              at com.sun.prism.render.RenderJob.run(RenderJob.java:56)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:131)
              at java.lang.Thread.run(Thread.java:722)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yaow Yao Wang (Inactive)
              Reporter:
              alammersdjfx August Lammersdorf (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: