Login  Register

Re: Using Java 3D scene tree in a headless environment?

Posted by Manu on Apr 24, 2016; 9:43pm
URL: https://forum.jogamp.org/Using-Java-3D-scene-tree-in-a-headless-environment-tp4026340p4036657.html

I found a solution for this issue : when you set "j3d.rend" System property to "noop", the 3D pipeline is handled by the javax.media.j3d.NoopPipeline class which is implemented to do nothing. Just what I needed, except... on a headless computer where a test in javax.media.j3d.VirtualUniverse class was added to avoid some bad error messages when you try to do some real 3D in an headless environment.
To circumvent this issue, you just have to replace the following lines in VirtualUniverse.java:
if (java.awt.GraphicsEnvironment.isHeadless()) {
  throw new java.awt.HeadlessException();
}
by:
if (!"noop".equals(System.getProperty("j3d.rend")) 
    && java.awt.GraphicsEnvironment.isHeadless()) {
  throw new java.awt.HeadlessException();
}
Emmanuel Puybaret