Package javax.media.j3d

Examples of javax.media.j3d.Material


/* 315 */     transp.setTransparency(0.0F);
/* 316 */     Appearance appearance = new Appearance();
/* 317 */     appearance.setTransparencyAttributes(transp);
/* 318 */     appearance.setTexture(t2d);
/*     */
/* 320 */     Material m = new Material();
/* 321 */     m.setLightingEnable(false);
/* 322 */     appearance.setMaterial(m);
/*     */
/* 324 */     return appearance;
/*     */   }
View Full Code Here


/* 2089 */         throw new IllegalArgumentException("Shape3D at index " + s + " is not a GeometryArray");
/*      */       }
/*      */
/* 2093 */       Appearance a = shapes[s].getAppearance();
/* 2094 */       if (a != null) {
/* 2095 */         Material m = a.getMaterial();
/* 2096 */         if (m != null) {
/* 2097 */           m.getDiffuseColor(this.c3f);
/* 2098 */           if (this.vertexColor4) {
/* 2099 */             this.c4f.set(this.c3f.x, this.c3f.y, this.c3f.z, 1.0F);
/* 2100 */             addColor(this.c4f);
/*      */           } else {
/* 2102 */             addColor(this.c3f);
View Full Code Here

/*      */     }
/*      */
/*  877 */     if (this.echoGeometry != null) {
/*  878 */       Appearance a = this.echoGeometry.getAppearance();
/*  879 */       if (this.echoColor != null) {
/*  880 */         Material m = a.getMaterial();
/*  881 */         m.setDiffuseColor(this.echoColor);
/*      */       }
/*  883 */       if (this.echoTransparency != 0.0F) {
/*  884 */         TransparencyAttributes ta = a.getTransparencyAttributes();
/*  885 */         ta.setTransparencyMode(2);
/*  886 */         ta.setTransparency(this.echoTransparency);
View Full Code Here

/*      */     else {
/* 3705 */       this.echoColor.set(color);
/*      */     }
/* 3707 */     if (this.echoGeometry != null) {
/* 3708 */       Appearance a = this.echoGeometry.getAppearance();
/* 3709 */       Material m = a.getMaterial();
/* 3710 */       m.setDiffuseColor(this.echoColor);
/*      */     }
/*      */   }
View Full Code Here

/* 167 */       if (j > k) break;
/* 168 */       vertices[v] = cap1[(j++)];
/* 169 */       normals[(v++)] = cap1Normal;
/*     */     }
/*     */
/* 174 */     Material m = new Material();
/* 175 */     m.setCapability(0);
/* 176 */     m.setCapability(1);
/*     */     int vertexFormat;
/* 178 */     if (enableLighting) {
/* 179 */       int vertexFormat = 3;
/*     */
/* 181 */       m.setLightingEnable(true);
/*     */     }
/*     */     else {
/* 184 */       vertexFormat = 1;
/* 185 */       m.setLightingEnable(false);
/*     */     }
/*     */
/* 188 */     int[] stripCounts = new int[3];
/* 189 */     stripCounts[0] = (2 + 2 * divisions);
/* 190 */     stripCounts[1] = divisions;
View Full Code Here

/* 152 */       vertices[(v++)] = cube[i][3];
/* 153 */       vertices[(v++)] = cube[i][0];
/* 154 */       vertices[(v++)] = axes[i];
/*     */     }
/*     */
/* 158 */     Material m = new Material();
/* 159 */     m.setCapability(0);
/* 160 */     m.setCapability(1);
/*     */     int vertexFormat;
/* 162 */     if (enableLighting) {
/* 163 */       int vertexFormat = 3;
/*     */
/* 165 */       m.setLightingEnable(true);
/*     */     }
/*     */     else {
/* 168 */       vertexFormat = 1;
/* 169 */       m.setLightingEnable(false);
/*     */     }
/*     */
/* 172 */     TriangleArray ta = new TriangleArray(72, vertexFormat);
/* 173 */     ta.setCoordinates(0, vertices);
/*     */
View Full Code Here

/* 54 */     super(symbol, control);
/*    */   }
/*    */
/*    */   public void writeObject(DataOutput out) throws IOException {
/* 58 */     super.writeObject(out);
/* 59 */     Material attr = (Material)this.node;
/* 60 */     Color3f clr = new Color3f();
/* 61 */     attr.getAmbientColor(clr);
/* 62 */     this.control.writeColor3f(out, clr);
/* 63 */     attr.getDiffuseColor(clr);
/* 64 */     this.control.writeColor3f(out, clr);
/* 65 */     attr.getEmissiveColor(clr);
/* 66 */     this.control.writeColor3f(out, clr);
/* 67 */     attr.getSpecularColor(clr);
/* 68 */     this.control.writeColor3f(out, clr);
/*    */
/* 70 */     out.writeBoolean(attr.getLightingEnable());
/* 71 */     out.writeInt(attr.getColorTarget());
/*    */   }
View Full Code Here

/* 71 */     out.writeInt(attr.getColorTarget());
/*    */   }
/*    */
/*    */   public void readObject(DataInput in) throws IOException {
/* 75 */     super.readObject(in);
/* 76 */     Material attr = (Material)this.node;
/* 77 */     attr.setAmbientColor(this.control.readColor3f(in));
/* 78 */     attr.setDiffuseColor(this.control.readColor3f(in));
/* 79 */     attr.setEmissiveColor(this.control.readColor3f(in));
/* 80 */     attr.setSpecularColor(this.control.readColor3f(in));
/* 81 */     attr.setLightingEnable(in.readBoolean());
/* 82 */     attr.setColorTarget(in.readInt());
/*    */   }
View Full Code Here

/* 81 */     attr.setLightingEnable(in.readBoolean());
/* 82 */     attr.setColorTarget(in.readInt());
/*    */   }
/*    */
/*    */   protected SceneGraphObject createNode() {
/* 86 */     return new Material();
/*    */   }
View Full Code Here

  BranchGroup makeTheRobot(){
    BranchGroup base = new BranchGroup();
   
    // appearance platform
    Appearance appP = new Appearance();
    Material matP = new Material();
    matP.setEmissiveColor(0, 0, 0);
    //matP.setEmissiveColor(0.8f,0.8f,0.8f);
    appP.setMaterial(matP);
   
    //platform
    Transform3D trPlat = new Transform3D();
    Vector3f vPlat = new Vector3f(0f,4.5f,0f);
    trPlat.set(vPlat);
    TransformGroup tgPlat = new TransformGroup(trPlat);
    tgPlat.addChild(new Box(3f,0.15f,3f,appP));
   
   
    //leg1
    Transform3D trleg1 = new Transform3D();
    Vector3f vLeg1 = new Vector3f(2f,3.5f,2f);
    trleg1.set(vLeg1);
    TransformGroup tgLeg1 = new TransformGroup(trleg1);
    tgLeg1.addChild(aLeg(0,30));
   
    //leg2
    Transform3D trleg2 = new Transform3D();
    Vector3f vLeg2 = new Vector3f(2f,3.5f,-2f);
    trleg2.set(vLeg2);
    TransformGroup tgLeg2 = new TransformGroup(trleg2);
    tgLeg2.addChild(aLeg(0,70));
   
    //leg3
    Transform3D trleg3 = new Transform3D();
    Vector3f vLeg3 = new Vector3f(-2f,3.5f,2f);
    trleg3.set(vLeg3);
    TransformGroup tgLeg3 = new TransformGroup(trleg3);
    tgLeg3.addChild(aLeg(0,30));
   
    //leg4
    Transform3D trleg4 = new Transform3D();
    Vector3f vLeg4 = new Vector3f(-2f,3.5f,-2f);
    trleg4.set(vLeg4);
    TransformGroup tgLeg4 = new TransformGroup(trleg4);
    tgLeg4.addChild(aLeg(-30,30));
   
   
   
   
    base.addChild(tgPlat);
    base.addChild(tgLeg1);
    base.addChild(tgLeg2);
    base.addChild(tgLeg3);
    base.addChild(tgLeg4);
   
   
   
    //obstacol
    // appearance platform
    Appearance appObs = new Appearance();
    Material matObs = new Material();
    matObs.setEmissiveColor(0.9f,0.9f,0.0f);
    appObs.setMaterial(matObs);
/*   
    Transform3D trObs = new Transform3D();
    Vector3f vObs = new Vector3f(0f,0.6f,-3.5f);
    trObs.set(vObs);
View Full Code Here

TOP

Related Classes of javax.media.j3d.Material

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.