Hello,

I am using the java3d version that is installed with the following binary:

            java3d-1_3_1-windows-i586-opengl-sdk.exe

It is on windows and built on opengl.

I cannot get the CULL_NONE behavior in the PolygonAttributes to work
correctly.  Here is a fragment of code I use to set up a single triangle for
drawing.

        BranchGroup root = new BranchGroup ();
        TransformGroup trans = new TransformGroup ();
        trans.setCapability (TransformGroup.ALLOW_TRANSFORM_WRITE);
        root.addChild (trans);

        Shape3D shape = new Shape3D ();

        TriangleArray ta = new TriangleArray (
            3,
            TriangleArray.COORDINATES |
            TriangleArray.COLOR_3 |
            TriangleArray.NORMALS
        );

        Point3f[] pts = new Point3f[3];
        pts[0] = new Point3f (0.0f, 0.0f, 0.0f);
        pts[1] = new Point3f (0.5f, 0.0f, 0.0f);
        pts[2] = new Point3f (0.0f, 0.5f, 0.0f);

        Color3f[] clrs = new Color3f[3];
        clrs[0] = new Color3f (1.0f, 0.0f, 0.0f);
        clrs[1] = new Color3f (0.0f, 1.0f, 0.0f);
        clrs[2] = new Color3f (0.0f, 0.0f, 1.0f);

        Vector3f[] norms = new Vector3f[3];
        Vector3f tn = new Vector3f (0.0f, 0.0f, -1.0f);
        norms[0] = tn;
        norms[1] = tn;
        norms[2] = tn;

        ta.setCoordinates (0, pts);
        ta.setColors (0, clrs);
        ta.setNormals (0, norms);

        shape.addGeometry (ta);

The triangle is drawn fine as shown here.  If I switch pts[1] and pts[2],
nothing
is drawn.

The direction of the normal (1.0 or -1.0) has no effect on the behavior.
Only
the orientation of the vertices has any effect.  I understand that no front
and
back culling is done by default.  I also explicitly set the culling via a
PolygonAttributes
object, just in case the default was different, but it still did not work
correctly.

I have done a fair bit of OpenGL programming using the same machine as I am
using
for Java3D.  In straight OpenGL calls from C++, the face culling works just
fine.

Any ideas on why this is happening?


Glenn

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