----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 242



Daniel:
        There is a bug right now WHEN primitives are rendered with
        the same material/coloring attributes (as is the case in
        the current example), but some primitives have color per vertex
        and others don't. If the primitive with color-per-vertex is
        rendered first(this ofcourse is implementation dependent) then
        the last per-vertex-color defined is used to render the next
        primitive that does not have color-per-vertex.


        So, in this example, Java3D implementation renders the left
        face which has color-per-vertex, the last color sent down is
        (0,0,0,1), the next primitive does not have color-per-vertex
        and so the last color from the previous primitive is used to
        render the current primitive. This bug will be fixed in the next
        release. Please send me a transparency bug example so that I
        can verify if its the same bug.


Thanks
Uma
Java3D Team



----- Begin Included Message -----

>From [EMAIL PROTECTED] Sun Jan 23 09:07:21 2000
From: "Daniel Selman" <[EMAIL PROTECTED]>
To: "Uma Sabada" <[EMAIL PROTECTED]>
Cc: "Java3D" <[EMAIL PROTECTED]>
Subject: 1.2B1 ColoringAttributes problems?
Date: Sun, 23 Jan 2000 16:50:41 -0000
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

Uma,

I've spent this afternoon chasing the problem with Appearances that I
described earlier and trying to come up with a test case for you. I started
with trying to modify the demo AppearanceTest example, and I couldn't
reproduce the bug... but I could still reproduce the problem in my code.

So I factored out most of my code and came up with a shortish example
(attached). In my code I create a Box primitive, and then replace the
coordinates/colors/texture coordinates and normals of the left face. This
seems to be causing the problem under 1.2B1 (worked fine in 1.1.x).

If you comment out the code to modify the left face then the
ColoringAttributes are used for all the faces of the Box. However, if you
modify the left face, the non-modified faces of the Box are black and the
ColoringAttributes is ignored. I imagine this is also the cause of the
problem with Transparency that I described (though I have not verified
this).

Very strange. Please keep me posted.

Sincerely,

Daniel

[EMAIL PROTECTED]
http://www.tornadolabs.com

> -----Original Message-----
> From: Uma Sabada [mailto:[EMAIL PROTECTED]]
> Sent: 21 January 2000 18:25
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] Java 3D API Version 1.2 Beta1: Maintenance Releas
>
>
>
> Daniel:
>
> >Other initial (very brief) impressions are:
> >ColoringAttributes no longer work (?)
> >Material colors seem very dark compared to 1.1x (?)
> >Transparency no longer works (?)
> >Textures seem *very* slow (MIPMAP example)
>
>
>
> Could you please send me a test case for this case? The example
> programs(For e.g.: examples/Appearance/AppearanceTest)
> distributed with Java3D beta works.
>
>
>
> Thanks
> Uma
> Java3D Team
>
>
>
> ----- Begin Included Message -----
>
> >From [EMAIL PROTECTED] Thu Jan 20 20:50:44 2000
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> X-Priority: 3 (Normal)
> X-MSMail-Priority: Normal
> Importance: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
> Date:         Thu, 20 Jan 2000 13:31:31 -0000
> From: Daniel Selman <[EMAIL PROTECTED]>
> Subject:      [JAVA3D] 1.2B1 Texture woes etc
> To: [EMAIL PROTECTED]
>
> All,
>
> Well, I'm sorry to post the first issues for 1.2B1 but I'm afraid
> deadlines
> are pressing and it can't be helped. I have to get the 35 examples for my
> book running on 1.2B1.
>
> Several problems so far, and I have only tried to run the first 3
> examples.
>
> Installing
> ===========
> The first time I installed B1 the JAR files were somehow corrupted
> Nothing would compile - it could not find the javax.media classes
> I ran jar on j3dcore.jar and only 70 Kb of the 3 MB+ files extracted
> When I uninstalled my previous Java 3D and reinstalled everything
> was fine.
> So *unistall* previous versions first to be on the safe side.
>
> Textures
> ========
> More important, I can't get texture mapping to work.
> The JDK TextureTest demo isn't texture mapped and my examples don't work
> either. I am running on a Windows 95B machine, JDK 1.2 with
> software OpenGL.
>
> If I modify:
> quadArray.setTextureCoordinates( 0, texArray, 0, coordArray.length/3 );
>
> to use the new (non-deprecated) version:
> quadArray.setTextureCoordinates( 0, 0, texArray );
>
> It makes no difference.
>
> It seems like somehow the "old" Texture inside the Appearance is not being
> used. From my reading of the docs it seemed like the TextureUnits should
> only be used if applied. Is that not the case? What other
> modifications are
> necessary to get 1.1x texture mapping working with 1.2B1?
>
> The only examples I have that use Textures and work use a GeometryInfo
> object and the Triangulator or use MIPMAPS.
>
> Other initial (very brief) impressions are:
> ColoringAttributes no longer work (?)
> Material colors seem very dark compared to 1.1x (?)
> Transparency no longer works (?)
> Textures seem *very* slow (MIPMAP example)
>
> If anyone can *please* tell me that I've screwed up I'd be very
> grateful. I
> sincerely hope Textures are not broken in what is, after all, a Beta
> release.
>
> Sincerely,
>
> Daniel Selman
>
> [EMAIL PROTECTED]
> http://www.tornadolabs.com
>
> > -----Original Message-----
> > From: Discussion list for Java 3D API
> > [mailto:[EMAIL PROTECTED]]On Behalf Of John A. Tenney
> > Sent: 20 January 2000 06:16
> > To: [EMAIL PROTECTED]
> > Subject: Re: [JAVA3D] Java 3D API Version 1.2 Beta1: Maintenance Release
> > Implementation Now Available
> >
> >
> > And it is a great improvement! Much better performance and much
> > lower memory
> > leakage, as measured in my application.
> >
> > -----Original Message-----
> > From: Discussion list for Java 3D API
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Rob Posadas
> > Sent: Wednesday, January 19, 2000 9:27 AM
> > To: [EMAIL PROTECTED]
> > Subject: [JAVA3D] Java 3D API Version 1.2 Beta1: Maintenance Release
> > Implementation Now Available
> >
> >
> > Java 3D API Version 1.2 Beta1: Maintenance Release Implementation Now
> > Available
> >
> > You can access it from:
> >     http://java.sun.com/products/java-media/3D/index.html
> >
> >
> > Rob Posadas
> >
> > Manager, 3d Graphics Software
> > Sun Microsystems
> > [EMAIL PROTECTED]
> > (650) 786-7873
> >
> > ==================================================================
> > =========
> > 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".
> >
>
> ==================================================================
> =========
> 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".
>
>
> ----- End Included Message -----
>
>

----- End Included Message -----

----------
X-Sun-Data-Type: octet-stream
X-Sun-Data-Name: octet-stream
X-Sun-Charset: us-ascii
X-Sun-Content-Lines: 174

/*
//*****************************************************************************
/*
*       @(#) AppearanceTest.java
*
*       Project:                Java 3D Programming
*       Client:         Manning Publications
*
*       Copyright (c) 2000 Daniel Selman
*       All Rights Reserved.
*
*       @author Daniel Selman: [EMAIL PROTECTED]
*/
//*****************************************************************************

import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.awt.GraphicsConfiguration;

import javax.media.j3d.*;
import javax.vecmath.*;

import javax.media.j3d.*;
import javax.vecmath.*;

import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.geometry.*;

import com.sun.j3d.utils.behaviors.keyboard.KeyNavigatorBehavior;

class AppearanceTest extends Applet
{
        private static int                              m_kWidth = 400;
        private static int                              m_kHeight = 400;

        private Appearance                              m_Appearance = null;

        public AppearanceTest()
        {
                setLayout(new BorderLayout());

                GraphicsConfiguration config =
                SimpleUniverse.getPreferredConfiguration();

                Canvas3D c = new Canvas3D(config);
                add("Center", c);

                m_Appearance = new Appearance();

                // THIS WILL BE IGNORED...
                m_Appearance.setColoringAttributes( new ColoringAttributes( 1,0,0, ColoringAttributes.NICEST ) );

                // Create a simple scene and attach it to the virtual universe
                BranchGroup scene = createSceneBranchGroup();

                Background back = new Background( new Color3f( 0.8f, 0.8f, 0.8f ) );
                back.setApplicationBounds( new BoundingSphere( new Point3d(0,0,0), 100 ) );
                scene.addChild( back );
                SimpleUniverse u = new SimpleUniverse(c);

                // This will move the ViewPlatform back a bit so the
                // objects in the scene can be viewed.
                u.getViewingPlatform().setNominalViewingTransform();

                u.addBranchGraph(scene);
        }

        protected BranchGroup createSceneBranchGroup()
        {
                BranchGroup objRoot = new BranchGroup();
                Bounds bounds = new BoundingSphere( new Point3d(0,0,0), 100 );

                TransformGroup zoomTg = new TransformGroup();
                zoomTg.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE );
                zoomTg.setCapability( TransformGroup.ALLOW_TRANSFORM_READ );

                // attach a navigation behavior to the position of the viewer
                KeyNavigatorBehavior key = new KeyNavigatorBehavior( zoomTg );
                key.setSchedulingBounds( bounds );
                key.setEnable( true );
                objRoot.addChild( key );

                Transform3D t3d = new Transform3D();
                t3d.rotY( 2 );
                TransformGroup objTrans1 = new TransformGroup( t3d );

                // Set up the global lights
                Color3f lColor1 = new Color3f(0.7f, 0.7f, 0.7f);
                Vector3f lDir1  = new Vector3f(-1.0f, -1.0f, -1.0f);
                Color3f alColor = new Color3f(0.2f, 0.2f, 0.2f);

                AmbientLight aLgt = new AmbientLight(alColor);
                aLgt.setInfluencingBounds( bounds );
                DirectionalLight lgt1 = new DirectionalLight(lColor1, lDir1);
                lgt1.setInfluencingBounds( bounds  );

                objRoot.addChild(aLgt);
                objRoot.addChild(lgt1);

                float nScale = 0.5f;

                Box box = new Box(nScale,nScale,nScale, Primitive.GENERATE_NORMALS | Primitive.GENERATE_TEXTURE_COORDS, m_Appearance );

                // BEGINNING OF COMMENT...

                Shape3D frontFace = box.getShape( Box.LEFT );

                // create a new left face so we can
                // assign per-vertex colors

                GeometryArray geometry = new QuadArray( 4,      GeometryArray.COORDINATES |
                                                                                                                                        GeometryArray.NORMALS |
                                                                                                                                        GeometryArray.COLOR_4 |
                                                                                                                                        GeometryArray.TEXTURE_COORDINATE_2 );

                nScale = 0.4f;

                final float[] verts =
                {
                        // left face
                        -1.0f * nScale, -1.0f * nScale,  1.0f * nScale,
                        -1.0f * nScale,  1.0f * nScale,  1.0f * nScale,
                        -1.0f * nScale,  1.0f * nScale, -1.0f * nScale,
                        -1.0f * nScale, -1.0f * nScale, -1.0f * nScale
                };

                final float[] colors =
                {
                        // left face
                        1,0,0,0,
                        0,1,0,0.2f,
                        0,0,1,0.8f,
                        0,0,0,1,
                };

          float[] tcoords =
                {
                        // left
                        1, 0,
                        1, 1,
                        0, 1,
                        0, 0
                };

                Vector3f normalVector = new Vector3f(-1.0f,  0.0f,  0.0f);

                geometry.setColors( 0, colors, 0, 4 );

                for( int n = 0; n < 4; n++ )
                        geometry.setNormal( n, normalVector );

                geometry.setTextureCoordinates( 0, 0, tcoords );
                geometry.setCoordinates( 0, verts );

                frontFace.setGeometry( geometry );

                // END OF COMMENT

                // connect the scenegraph
                objTrans1.addChild( box );
                zoomTg.addChild( objTrans1 );
                objRoot.addChild( zoomTg );

                return objRoot;
        }

        public static void main(String[] args)
        {
                AppearanceTest appearanceTest = new AppearanceTest();
                new MainFrame( appearanceTest, 256, 256);
        }
}

===========================================================================
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".

Reply via email to