OK. Here is part of class Grass from my game in progress
(magicwoods.50megs.com):

the class define Shape3d and textureCoordinates:
--------------------------------------------------------------------------

    public Grass1() {

        Transform3D posTransform3D = new Transform3D();
        Vector3f translationVec = new Vector3f();

        Point3f[] vertex = new Point3f[4];

        TexCoord2f[] texCoord = new TexCoord2f[4];
        texCoord[3] = new TexCoord2f(0.0f, 1);
        texCoord[0] = new TexCoord2f(0.0f, 0.0f);
        texCoord[1] = new TexCoord2f(1, 0.0f);
        texCoord[2] = new TexCoord2f(1, 1);

            float height = 0.5f;

            vertex[0] = new Point3f(0f, 0f, 0f);
            vertex[1] = new Point3f(height / 2, 0f, 0f);
            vertex[2] = new Point3f(height / 2, height, 0f);
            vertex[3] = new Point3f(0f, height, 0f);

            QuadArray geometry = new QuadArray(vertex.length,
GeometryArray.COORDINATES | GeometryArray.TEXTURE_COORDINATE_2);

            geometry.setCoordinates(0, vertex);
            geometry.setTextureCoordinates(0,0, texCoord);

            Shape3D shape = new Shape3D(geometry, MagicWoods.common.appGrass1);

            float transX = 1;
            float transZ = 1;

            translationVec.set(transX,
Renderer.currentTile.getHeightAt(transX, transZ) + 0.2f, transZ);
            posTransform3D.set(translationVec);

            TransformGroup tg = new TransformGroup();
            tg.setTransform(posTransform3D);
            tg.addChild(shape);

        }


And Appearance something like this:
-------------------------------------------------


final static String   filenameGrass1     = "sprites/grass1.gif";
grass1Texture = new TextureLoader(filenameGrass1, renderer).getTexture();
  TextureAttributes textAtt = new TextureAttributes();
  PolygonAttributes polyAttrib = new
PolygonAttributes(PolygonAttributes.POLYGON_FILL,
PolygonAttributes.CULL_NONE, 0.0f);
  TransparencyAttributes transparencyLow = new
TransparencyAttributes(TransparencyAttributes.NICEST, 0.5f);

  appGrass1.setTextureAttributes(textAtt);
  appGrass1.setPolygonAttributes(polyAttrib);
  appGrass1.setTransparencyAttributes(transparencyLow);


Hope It helped!
By!

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