Login  Register

Re: Problem with displaying the line segments

Posted by world on Apr 26, 2017; 9:55pm
URL: https://forum.jogamp.org/Problem-with-displaying-the-line-segments-tp4037890p4037901.html

Continue experiments and apply suggested changes.

4. Comment antialiazing settings in BasicBox2.java
//lineAttr.setLineAntialiasingEnable(true);
Images look like in your second row. Here we can note the following:
1. Lines of internal cube have green color. It seems, it is more correct (then white), because we look at them through the transparent green surface.
2. Not all of lines are displayed on the 2nd image. It can be interpreted as bug, because the surfaces are transparent, and they are displayed on the 3rd picture.

Modified source for this case:
BasicBox4.java

5. Next modification - is addition of shapes to OrderedGroup instead of TransformGroup:
group = new OrderedGroup();
trans.addChild(group);
root.addChild(trans);
//trans.addChild(new Box(w, w, w, app));
//trans.addChild(lineShape(w, lineColor));
group.addChild(new Box(w, w, w, app));
group.addChild(lineShape(w, lineColor));
The result is the following: the internal box is not displayed in the 2nd and 3rd cases:

Modified source for this case:
BasicBox5.java

6. Changing the order of shapes addition to OrderedGroup:
group.addChild(lineShape(w, lineColor));
group.addChild(new Box(w, w, w, app));
The result is different, but also incorrect:

Modified source for this case:
BasicBox6.java

7. Addition of lines:
System.setProperty("sun.awt.noerasebackground", "true");
view.setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY);
doesn't change the result (both with use of OrderedGroup or without it).