Hi Ingo,
The new test program add both shape3d in both g1 and g2
so there is no different which child to select. It always show
two shape under v1.2.1, v1.3 and the next v1.3.1 beta1 release.
As mention previously the transparency bug is already fixed in next release.
Stay tuned.
- Kelvin
---------------
Java 3D Team
Sun Microsystems Inc.
Ingo Brunberg wrote:
Hi Kelvin,
I slightly modified the test program and finally managed to get it to
demonstrate the problem. I am not quite happy with this one, since it
uses cloneTree(), so you might think it is a cloneTree() bug, but
maybe it is enough to get started.
Regards,
Ingo
Hi Ingo,
This first one is bug
4713671 - Problem with Transparency sorting on Switch group
which is fixed in next v1.3.1 beta release.
I just test that this test program works fine.
For the second one we need a test case to investigate.
Thanks.
- Kelvin
----------
Java 3D Team
Sun Microsystems Inc.
Ingo Brunberg wrote:
Hello,
I noticed that two of the bugs I once reported against the first beta
of Java 3D 1.3 are still present in the fcs version.
1) Use of TRANSPARENCY_SORT_GEOMETRY (a transparency sorting policy):
There are rendering artifacts with transparent objects if they are
switched off. This is demonstrated with the following test
program. This shows a triangle which, after 5 seconds, is replaced
with a translated one. You can see that the first triangle remains
visible although it should become completely invisible.
2) Use of USE_COORD_INDEX_ONLY in IndexedTriangleArrays with per
vertex colors present:
The vertex colors are ignored during rendering, that means you just
see a white object. I tried to demonstrate this with the test
program, too, but this bug seems only to be observable in more
complex scenes or with more complex geometries.
----------------------------------------------------------------------
import javax.swing.JFrame;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.universe.*;
import java.util.Timer;
import java.util.TimerTask;
public class Test extends JFrame {
public Test() {
Canvas3D canvas = new Canvas3D(
SimpleUniverse.getPreferredConfiguration());
SimpleUniverse universe = new SimpleUniverse(canvas);
universe.addBranchGraph(createSceneGraph());
//universe.getViewer().getView().setTransparencySortingPolicy(
//View.TRANSPARENCY_SORT_GEOMETRY);
Transform3D vpLocation = new Transform3D();
TransformGroup vptg = universe.getViewingPlatform(
).getViewPlatformTransform();
vptg.getTransform(vpLocation);
vpLocation.setTranslation(new Vector3d(0.0, 0.0, 8.0));
vptg.setTransform(vpLocation);
canvas.setSize(300, 300);
getContentPane().add(canvas);
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
}
public static void main(String[] args) {
Test frame = new Test();
frame.show();
}
private BranchGroup createSceneGraph() {
BranchGroup branch = new BranchGroup();
final Switch sg = new Switch(0);
sg.setCapability(Switch.ALLOW_SWITCH_WRITE);
branch.addChild(sg);
DirectionalLight light = new DirectionalLight();
light.setInfluencingBounds(new BoundingSphere(new Point3d(), 1000));
branch.addChild(light);
// Add a Background
Background background = new Background(new Color3f(1.0f, 1.0f, 1.0f));
background.setApplicationBounds(new BoundingSphere(new Point3d(),
1000));
branch.addChild(background);
Appearance app = new Appearance();
app.setMaterial(new Material());
app.setTransparencyAttributes(
new TransparencyAttributes(TransparencyAttributes.NICEST, 0.5f));
Transform3D t3d1 = new Transform3D();
t3d1.setTranslation(new Vector3f(-1.0f, 0.0f, 0.0f));
Transform3D t3d2 = new Transform3D();
t3d2.setTranslation(new Vector3f(1.0f, 0.0f, 0.0f));
TransformGroup t1 = new TransformGroup(t3d1);
TransformGroup t2 = new TransformGroup(t3d2);
Group g1 = new Group();
Group g2 = new Group();
t1.addChild(new Shape3D(createTriangleArray(), app));
t2.addChild(new Shape3D(createTriangleArray(), app));
g1.addChild(t1);
g1.addChild(t2);
g2.addChild(t1.cloneTree());
g2.addChild(t2.cloneTree());
sg.addChild(g1);
sg.addChild(g2);
new Timer().schedule(new TimerTask() {
public void run() {
sg.setWhichChild(1);
}
}, 5000l);
//branch.compile();
return branch;
}
private IndexedTriangleArray createTriangleArray() {
int vertexFormat = GeometryArray.COORDINATES | GeometryArray.NORMALS
| GeometryArray.COLOR_3 | GeometryArray.USE_COORD_INDEX_ONLY;
IndexedTriangleArray geom = new IndexedTriangleArray(
3, vertexFormat, 3);
geom.setCoordinates(0, new float[] {-1, 0, 0, 1, 0, 0, 0, 2, 0});
geom.setColors(0, new float[] {1, 0, 0, 0, 1, 0, 0, 0, 1});
geom.setNormals(0, new float[] {-0.6f, 0, 0.8f, 0.6f, 0, 0.8f, 0, 0.6f,
0.8f});
int[] indices = new int[] {0, 1, 2};
geom.setCoordinateIndices(0, indices);
//geom.setColorIndices(0, indices);
//geom.setNormalIndices(0, indices);
//geom.setDuplicateOnCloneTree(true);
return geom;
}
}
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".