Extend Shape3D and set geometry with your specific box shape that is created
with TriangleStripArray

        GeometryArray   geoArray = new TriangleStripArray(24,   // 4 poings
per face * 6 faces
                                        TriangleStripArray.COORDINATES|
//                                        TriangleStripArray.NORMALS|
//
TriangleStripArray.TEXTURE_COORDINATE_2|
                                        TriangleStripArray.COLOR_3,
                                        stripVertexCounts);
        geoArray.setCoordinates(0, vertsArray);
//        geoArray.setNormals(0, normalsArray);
//        geoArray.setTextureCoordinates(0, 0, textureCoordsArray);
        geoArray.setColors(0, colorArray);

where
    private int[] stripVertexCounts = {4, 4, 4, 4, 4, 4};
    private static final Point3f[] vertsArray = {
        t0, b0, t1, b1, // front
        t1, b1, t2, b2, // right
        t2, b2, t3, b3, // back
        t3, b3, t0, b0, // left
        t3, t0, t2, t1, // top
        b0, b3, b1, b2, // bottom
    };
   and t0-t3, b0-b3 are Point3f specified.


----- Original Message -----
From: "Andy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 10, 2002 11:27 AM
Subject: [JAVA3D] Box


> Hi, I would like to know how to use TriangleStripArray to generate a box.
I
> know I can use primitive Box in Java3D API but when I set the Box into
> wireframe, it doesn't show wireframe, instead it shows white faces, thus I
> cannot look at it and learn the way it generate a box.  May someone tell
me
> how to generate a box by using TriangleStripArray?  Thanks
>
> Sincerely,
>
> Andy
>
>
===========================================================================
> 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".

Reply via email to