Package javax.media.j3d

Examples of javax.media.j3d.TexCoordGeneration


            appearance = (Appearance)appearance.cloneNodeComponent(false);
            // Create texture coordinates if geometry doesn't define its own coordinates
            // and appearance contains a texture
            if (!firstGeometryHasTextureCoordinateIndices
                && appearance.getTexture() != null) {
              appearance.setTexCoordGeneration(new TexCoordGeneration());
            }
          }
          Shape3D shape = new Shape3D(geometryArray, appearance);  
          sceneRoot.addChild(shape);
          scene.addNamedObject(group.getName() + (i == 0 ? "" : String.valueOf(i)), shape);
View Full Code Here


        objectName += String.valueOf(this.shapeIndex++);
       
        // Start a new object at OBJ format
        this.out.write("g " + objectName + "\n");
       
        TexCoordGeneration texCoordGeneration = null;
        if (this.mtlFileName != null) {
          if (appearance != null) {
            texCoordGeneration = appearance.getTexCoordGeneration();
            ComparableAppearance comparableAppearance = new ComparableAppearance(appearance);
            String appearanceName = this.appearances.get(comparableAppearance);
View Full Code Here

            appearance.setTextureAttributes(defaultMaterialAndTexture.getTextureAttributes());
            appearance.setTexture(null);
          } else if (color == null && texture != null) {
            // Change material to white then texture
            appearance.setMaterial(getMaterial(DEFAULT_COLOR, DEFAULT_AMBIENT_COLOR, materialShininess));
            TexCoordGeneration texCoordGeneration = new TexCoordGeneration(TexCoordGeneration.OBJECT_LINEAR,
                TexCoordGeneration.TEXTURE_COORDINATE_2,
                new Vector4f(-pieceSize.x / modelSize.x / texture.getWidth(), 0, 0, 0),
                new Vector4f(0, pieceSize.y / modelSize.y / texture.getHeight(), pieceSize.z / modelSize.z / texture.getHeight(), 0));
            appearance.setTexCoordGeneration(texCoordGeneration);
            appearance.setTextureAttributes(MODULATE_TEXTURE_ATTRIBUTES);
View Full Code Here

    textureAttr.setTextureMode(TextureAttributes.REPLACE);
    textureApp.setTextureAttributes(textureAttr);
    Material mat = new Material();
    mat.setShininess(120.0f);
    textureApp.setMaterial(mat);
    TexCoordGeneration tcg = new TexCoordGeneration(TexCoordGeneration.OBJECT_LINEAR,
                                                    TexCoordGeneration.TEXTURE_COORDINATE_2);

    textureApp.setTexCoordGeneration(tcg);

View Full Code Here

/* 141 */       if (p.t != null) {
/* 142 */         a.setTexture(p.t);
/*     */
/* 144 */         if ((((GeometryArray)shape.getGeometry()).getVertexFormat() & 0x20) == 0)
/*     */         {
/* 146 */           TexCoordGeneration tcg = new TexCoordGeneration();
/* 147 */           a.setTexCoordGeneration(tcg);
/*     */         }
/*     */       }
/*     */
/* 151 */       if (p.transparent) {
View Full Code Here

/* 54 */     super(symbol, control);
/*    */   }
/*    */
/*    */   public void writeObject(DataOutput out) throws IOException {
/* 58 */     super.writeObject(out);
/* 59 */     TexCoordGeneration attr = (TexCoordGeneration)this.node;
/* 60 */     Vector4f vec = new Vector4f();
/* 61 */     out.writeBoolean(attr.getEnable());
/* 62 */     out.writeInt(attr.getFormat());
/* 63 */     out.writeInt(attr.getGenMode());
/* 64 */     attr.getPlaneR(vec);
/* 65 */     this.control.writeVector4f(out, vec);
/* 66 */     attr.getPlaneS(vec);
/* 67 */     this.control.writeVector4f(out, vec);
/* 68 */     attr.getPlaneT(vec);
/* 69 */     this.control.writeVector4f(out, vec);
/* 70 */     attr.getPlaneQ(vec);
/* 71 */     this.control.writeVector4f(out, vec);
/*    */   }
View Full Code Here

/* 71 */     this.control.writeVector4f(out, vec);
/*    */   }
/*    */
/*    */   public void readObject(DataInput in) throws IOException {
/* 75 */     super.readObject(in);
/* 76 */     TexCoordGeneration attr = (TexCoordGeneration)this.node;
/* 77 */     attr.setEnable(in.readBoolean());
/* 78 */     attr.setFormat(in.readInt());
/* 79 */     attr.setGenMode(in.readInt());
/* 80 */     attr.setPlaneR(this.control.readVector4f(in));
/* 81 */     attr.setPlaneS(this.control.readVector4f(in));
/* 82 */     attr.setPlaneT(this.control.readVector4f(in));
/* 83 */     attr.setPlaneQ(this.control.readVector4f(in));
/*    */   }
View Full Code Here

/* 82 */     attr.setPlaneT(this.control.readVector4f(in));
/* 83 */     attr.setPlaneQ(this.control.readVector4f(in));
/*    */   }
/*    */
/*    */   protected SceneGraphObject createNode() {
/* 87 */     return new TexCoordGeneration();
/*    */   }
View Full Code Here

TOP

Related Classes of javax.media.j3d.TexCoordGeneration

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.