hi I have problem about background . I create indexedtiranglearray
IndexedTriangleArray mapGeom1 = new IndexedTriangleArray(5,
GeometryArray.COORDINATES | GeometryArray.COLOR_3,12);

       mapGeom1.setCoordinate(0, new Point3f(  0.0f, -0.4f,  0.0f ));
       mapGeom1.setCoordinate(1, new Point3f(   -12.5f, -0.4f, -250.0f ));
       mapGeom1.setCoordinate(2, new Point3f(   -12.5f, -0.4f, 250.0f ));
       mapGeom1.setCoordinate(3, new Point3f(   12.5f, -0.4f,  250.0f ));
       mapGeom1.setCoordinate(4, new Point3f(    12.5f, -0.4f, -250.0f ));

       mapGeom1.setCoordinateIndex( 0, 0);
       mapGeom1.setCoordinateIndex( 1, 1);
       mapGeom1.setCoordinateIndex( 2, 2);
       mapGeom1.setCoordinateIndex( 3, 0);
       mapGeom1.setCoordinateIndex( 4, 2);
       mapGeom1.setCoordinateIndex( 5, 3);
       mapGeom1.setCoordinateIndex( 6, 0);
       mapGeom1.setCoordinateIndex( 7, 3);
       mapGeom1.setCoordinateIndex( 8, 4);
       mapGeom1.setCoordinateIndex( 9, 0);
       mapGeom1.setCoordinateIndex(10, 4);
       mapGeom1.setCoordinateIndex(11, 1);

it is square area. i want creat background which have bounding box and same
size as indextrianglearray.
i try to program
       //Set Appearance for Background
               BoundingBox bounds = new BoundingBox();
               Appearance backgroundApp = new Appearance();

               //create colored material
               Color3f aColor = new Color3f(0.8f, 0.8f, 0.8f);
               Material m = new Material(aColor, aColor, aColor, aColor, 80.0f);

               //enable lighting and assign material
               m.setLightingEnable(true);
               backgroundApp.setMaterial(m);

               //render the box as a wire frame
               PolygonAttributes polyAttributes = new PolygonAttributes();
               polyAttributes.setPolygonMode( PolygonAttributes.POLYGON_FILL);
               polyAttributes.setCullFace(PolygonAttributes.CULL_NONE);
               backgroundApp.setPolygonAttributes(polyAttributes);

               //create the box and assign the appearance
               Box box = new Box( 1.0f, 1.0f, 1.0f, Box.GENERATE_NORMALS |
                                                                                                                                                       Box.GENERATE_NORMALS_INWARD|
                                                                                                                                                       Box.GENERATE_TEXTURE_COORDS,backgroundApp);

               Background bg = new Background();
       bg.setApplicationBounds(bounds);
               BranchGroup backGeoBranch = new BranchGroup();

       backGeoBranch.addChild(box);
       bg.setGeometry(backGeoBranch);
       bgMap.addChild(bg);

       TextureLoader tex = new TextureLoader("bg.jpg",new String("RGB"),
this );
       if (tex != null)
           backgroundApp.setTexture(tex.getTexture());
               TextureAttributes texAttr = new TextureAttributes();
               texAttr.setTextureMode(TextureAttributes.MODULATE);
               backgroundApp.setTextureAttributes(texAttr);

but it 's not cover indexedtrianglearray. Please help me. Thank you


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus

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