Hello,
I am having a problem getting my textures to tile correctly.  I am filling
an array of verticies and then building a GeometryInfo object with it.  I
then build a Shape3D from the GeometryInfo and assign an apperance to the
Shape3D.  When I then use the setTexCoordGeneration( ) method in the
appearance, the texture is tiled *way* too many times across the geometry.
Is there a way to control the number of tiles that are used, or a better way
to build texture coordinates from an arbitrary mesh?  The code I am using is
below:

Point3f verts[];
verts = new Point3f[numVerts*3];

// fill verts array
...

GeometryInfo geoInfo = new GeometryInfo( GeometryInfo.TRIANGLE_ARRAY );
geoInfo.setCoordinates( verts );

TextureLoader loader = new TextureLoader( imageURL, m_applet );
ImageComponent2D image = loader.getImage( );
Texture2D tex = new Texture2D( Texture.BASE_LEVEL, Texture.RGB,
image.getHeight(),image.getWidth());
tex.setImage( 0, image );
tex.setEnable( true );
tex.setBoundaryModeS( Texture.WRAP );
tex.setBoundaryModeT( Texture.WRAP );
tex.setMagFilter( Texture.NICEST );
tex.setMinFilter( Texture.NICEST );
Apperance app;
app.setTexture( tex );

Shape3D currShape = new Shape3D( geoInfo.getGeometryArray( ), app );
// generate texture coordinates
currShape.getAppearance().setTexCoordGeneration( new
TexCoordGeneration( ) );



Thanks!
SteveD
--
http://www.ecst.csuchico.edu/~detwiler

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to