Java3D 1.6.1 Release

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Java3D 1.6.1 Release

hharrison
Changes since 1.6.0:

- update ant build to work with JDK 1.8
- build with 1.6 classfile format compatibility
- BUGFIX: account for HiDPI in Windows 10 (thanks to Ian Brown)

Downloadable here:

https://github.com/hharrison/java3d-core/releases/tag/1.6.1

Cheers,

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Java3D 1.6.1 Release

gouessej
Administrator
Thanks.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Java3D 1.6.1 Release

Manu
Many thanks Harvey
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Java3D 1.6.1 Release

Manu
If Canvas3D instances are correctly displayed and resized with HiDPI screens in Java 3D 1.6.1, mouse event coordinates are not correctly scaled yet
The xscale and yscale fields added to Canvas3D should also be used to scale mouse coordinates, probably in addMouseListener, addMouseMotionListener, addMouseWheelListener  overridden methods of Canvas3D, which would scale these coordinates before calling user listeners. But maybe, it's more tricky than that, because MouseBehavior class handles mouse events too.

Meanwhile, here's a dirty hack that you can use to convert your coordinates if needed. The following method will return fixed mouse coordinates with Java 3D 1.6.1:
Point getMouseLocation(MouseEvent ev) {
  try {
    Field xscaleField = Canvas3D.class.getDeclaredField("xscale");
    xscaleField.setAccessible(true);
    double xscale = (Double)(xscaleField.get(ev.getSource()));
    Field yscaleField = Canvas3D.class.getDeclaredField("yscale");
    yscaleField.setAccessible(true);
    double yscale = (Double)(yscaleField.get(ev.getSource()));
    return new Point((int)(ev.getX() * xscale), (int)(ev.getY() * yscale));
  } catch (Exception ex) {
    return ev.getPoint();
  }
}
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Java3D 1.6.1 Release

philjord
This mouse coordinate problem for HiDPI screens is now fixed in Java 1.7, and the screen scale detection improved slightly.

Thanks for reporting it and the workaround