List of usage examples for javax.media.j3d TriangleArray setTextureCoordinates
public void setTextureCoordinates(int texCoordSet, int index, float texCoords[])
From source file:AppearanceExplorer.java
Shape3D createTexTris() { Point3f pnt[] = new Point3f[9]; pnt[0] = new Point3f(-0.8f, -0.8f, 0.0f); pnt[1] = new Point3f(-0.5f, -0.7f, 0.0f); pnt[2] = new Point3f(-0.7f, 0.7f, 0.0f); pnt[3] = new Point3f(-0.4f, 0.7f, 0.0f); pnt[4] = new Point3f(0.0f, -0.7f, 0.0f); pnt[5] = new Point3f(0.4f, 0.7f, 0.0f); pnt[6] = new Point3f(0.5f, 0.7f, 0.0f); pnt[7] = new Point3f(0.5f, -0.7f, 0.0f); pnt[8] = new Point3f(0.9f, 0.0f, 0.0f); TexCoord2f texCoord[] = new TexCoord2f[9]; texCoord[0] = new TexCoord2f(0.05f, 0.90f); texCoord[1] = new TexCoord2f(0.25f, 0.10f); texCoord[2] = new TexCoord2f(1.00f, 0.60f); texCoord[3] = texCoord[0];//from w w w . jav a 2s . c o m texCoord[4] = texCoord[1]; texCoord[5] = texCoord[2]; texCoord[6] = texCoord[0]; texCoord[7] = texCoord[1]; texCoord[8] = texCoord[2]; TriangleArray ta = new TriangleArray(9, GeometryArray.COORDINATES | GeometryArray.TEXTURE_COORDINATE_2); ta.setCoordinates(0, pnt); ta.setTextureCoordinates(0, 0, texCoord); return new Shape3D(ta, appearance); }