Hi Ingo,
We can reproduce it and
Bug 4622680 - Transparency not work if Material is
shared between Appearance
is submitted for investigation.
Thanks for your bug report.
- Kelvin
----------------
Java 3D Team
Sun Microsystems Inc.
>Delivered-To: [EMAIL PROTECTED]
>X-Authentication-Warning: oc30.uni-paderborn.de: ib set sender to
[EMAIL PROTECTED] using -f
>Date: Fri, 11 Jan 2002 13:19:45 +0100
>From: Ingo Brunberg <[EMAIL PROTECTED]>
>Subject: [JAVA3D] Another transparency/appearance bug
>To: [EMAIL PROTECTED]
>
>Here is another transparency bug I could isolate with j3d 1.3b1. I
>think it's a serious one and am sure it's independet of your
>configuration.
>
>Take the following test program. The left cylinder has a transparency
>of 50 percent. But you cannot see that, unless you move the right
>cylinder out of view. It looks right, if the two appearances of the
>cylinders use different materials.
>
>Regards,
>
>Ingo
>
>
>
>===File ~/TProbsTest.java===================================
>import javax.swing.JFrame;
>import javax.media.j3d.*;
>import javax.vecmath.*;
>import com.sun.j3d.utils.universe.*;
>import com.sun.j3d.utils.behaviors.mouse.*;
>import com.sun.j3d.utils.geometry.Cylinder;
>
>public class TProbsTest extends JFrame {
> public TProbsTest() {
> Canvas3D canvas = new Canvas3D(
> SimpleUniverse.getPreferredConfiguration());
> SimpleUniverse universe = new SimpleUniverse(canvas);
> universe.addBranchGraph(createSceneGraph());
>
> 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) {
> TProbsTest frame = new TProbsTest();
> frame.show();
> }
>
> private BranchGroup createSceneGraph() {
> BranchGroup branch = new BranchGroup();
>
> TransformGroup tg = new TransformGroup();
> tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
> tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
> branch.addChild(tg);
>
> MouseRotate myMouseRotate = new MouseRotate();
> myMouseRotate.setTransformGroup(tg);
> myMouseRotate.setSchedulingBounds(new BoundingSphere());
> branch.addChild(myMouseRotate);
>
> MouseTranslate myMouseTranslate = new MouseTranslate();
> myMouseTranslate.setTransformGroup(tg);
> myMouseTranslate.setSchedulingBounds(new BoundingSphere());
> branch.addChild(myMouseTranslate);
>
> DirectionalLight light = new DirectionalLight();
> light.setInfluencingBounds(new BoundingSphere(new Point3d(), 1000));
> branch.addChild(light);
>
> Appearance appearance1 = new Appearance();
> appearance1.setTransparencyAttributes(
> new TransparencyAttributes(
> TransparencyAttributes.NICEST, 0.5f));
> Material material = new Material();
> appearance1.setMaterial(material);
> Appearance appearance2 = new Appearance();
>
> // If a new material is used, it looks right.
> appearance2.setMaterial(material);
>
> Cylinder cylinder1 = new Cylinder(1.0f, 2.0f, appearance1);
> Cylinder cylinder2 = new Cylinder(1.0f, 2.0f, appearance2);
> Transform3D t3d1 = new Transform3D();
> t3d1.setTranslation(new Vector3f(-2.0f, 0.0f, 0.0f));
> Transform3D t3d2 = new Transform3D();
> t3d2.setTranslation(new Vector3f(2.0f, 0.0f, 0.0f));
> TransformGroup tg1 = new TransformGroup(t3d1);
> TransformGroup tg2 = new TransformGroup(t3d2);
>
> tg1.addChild(cylinder1);
> tg2.addChild(cylinder2);
> tg.addChild(tg1);
> tg.addChild(tg2);
>
> return branch;
> }
>}
>============================================================
>
>===========================================================================
>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".