Package javax.media.j3d

Examples of javax.media.j3d.Texture


/*     */   }
/*     */
/*     */   public void readObject(DataInput in) throws IOException
/*     */   {
/* 150 */     super.readObject(in);
/* 151 */     Texture attr = (Texture)this.node;
/* 152 */     attr.setBoundaryColor(this.control.readColor4f(in));
/* 153 */     attr.setBoundaryModeS(in.readInt());
/* 154 */     attr.setBoundaryModeT(in.readInt());
/* 155 */     attr.setEnable(in.readBoolean());
/*     */
/* 157 */     this.imageComponents = new int[in.readInt()];
/* 158 */     for (int i = 0; i < this.imageComponents.length; i++) {
/* 159 */       this.imageComponents[i] = in.readInt();
/*     */     }
/* 161 */     int mag = in.readInt();
/*     */     try {
/* 163 */       attr.setMagFilter(mag);
/*     */     }
/*     */     catch (IllegalArgumentException e)
/*     */     {
/* 168 */       if (mag == 5)
/* 169 */         attr.setMagFilter(3);
/* 170 */       else if (mag == 4)
/* 171 */         attr.setMagFilter(2);
/*     */       else {
/* 173 */         attr.setMagFilter(0);
/*     */       }
/*     */     }
/* 176 */     attr.setMinFilter(in.readInt());
/*     */
/* 178 */     attr.setBaseLevel(in.readInt());
/* 179 */     attr.setMaximumLevel(in.readInt());
/* 180 */     attr.setMinimumLOD(in.readFloat());
/* 181 */     attr.setMaximumLOD(in.readFloat());
/* 182 */     attr.setLodOffset(this.control.readPoint3f(in));
/* 183 */     attr.setAnisotropicFilterMode(in.readInt());
/* 184 */     attr.setAnisotropicFilterDegree(in.readFloat());
/*     */
/* 186 */     int points = in.readInt();
/* 187 */     if (points > 0) {
/* 188 */       float[] lod = new float[points];
/* 189 */       float[] pts = new float[points];
/* 190 */       for (int i = 0; i < points; i++) {
/* 191 */         lod[i] = in.readFloat();
/* 192 */         pts[i] = in.readFloat();
/*     */       }
/* 194 */       attr.setSharpenTextureFunc(lod, pts);
/*     */     }
/*     */
/* 197 */     points = in.readInt();
/* 198 */     if (points >= 4) {
/* 199 */       float[] weights = new float[points];
/* 200 */       for (int i = 0; i < points; i++) {
/* 201 */         weights[i] = in.readFloat();
/*     */       }
/* 203 */       attr.setFilter4Func(weights);
/*     */     }
/*     */   }
View Full Code Here


     
     
     
        Appearance groundApp = new Appearance();

        Texture textureGround = new TextureLoader("img/groundimage3.jpg", this).getTexture();
        groundApp.setTexture(textureGround);
       
        Box ground = new Box(35f,0.1f,35f, groundApp);
       
       
View Full Code Here

public class Appearances {

    public static Appearance fromFile(String textureFileName) {
        final TextureLoader loader = new TextureLoader(textureFileName, null);
        final Texture texture = loader.getTexture();
        final Appearance appearance = new Appearance();
        final TextureAttributes ta = new TextureAttributes();
        ta.setTextureMode(TextureAttributes.COMBINE);
        appearance.setMaterial(new Material());
        appearance.setTexture(texture);
View Full Code Here

TOP

Related Classes of javax.media.j3d.Texture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.