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

a Pointlight spot problem

XMLWordPrintable

    • x86_64
    • linux_ubuntu

      A DESCRIPTION OF THE PROBLEM :
      in javafx16 when i bind a PointLight translate x, y, z properties with a Box shape the spot of light positioned in the center of the box, when i run the same app with javafx17 sdk the spot don't positioned in the center of the Box but far left.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      make the PointLight spot position in the center like any 3d shape at it was before

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      the PointLight spot position when binding with Box positioned to the center of the Box
      ACTUAL -
      when i bind a PointLight translate x, y, z properties with a Box shape the spot of light positioned in the center of the box, when i run the same app with javafx17 sdk the spot don't positioned in the center of the Box but far left
      no error message occured

      ---------- BEGIN SOURCE ----------
      public final void bindGameObject(GameObject gameObject1,
              GameObject gameObject2, double xOffset,double yOffset, double zOffset)
          {
              var node1 = gameObject1.node();
              var node2 = gameObject2.node();
              
              unbindGameObject(gameObject1);
              
              node1.translateXProperty().bind(node2.translateXProperty().add(xOffset));
              node1.translateYProperty().bind(node2.translateYProperty().add(yOffset));
              node1.translateZProperty().bind(node2.translateZProperty().add(zOffset));
          }

      public class LightObject extends GameObject
      {
          public LightObject(double x, double y, Color lightColor)
          {
              super(null, new Point2D(x, y), new PointLight(lightColor));
          }
          
          @Override
          protected Shape createShape()
          {
              return null;
          }
      //////////////////////////////////////////////////////////////////////////////
          @Override
          public void create()
          {
          }

          @Override
          public PointLight node()
          {
              return (PointLight) super.node();
          }

      ///////////////////////////////////////////////////////////////////////////////////////////
              LightObject lightObject1 = new LightObject(0, 0, Color.WHITE);
              addGameObject("house", "light1", lightObject1);
              lightObject1.node().setMaxRange(300);
              gameManager().bindGameObject(lightObject1,
                  gameManager().player().gameObject(), 0, 0, -250);
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      problem is with the PointLight i can do anything

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: