Examples of Texture2D


Examples of javax.media.j3d.Texture2D

    //Generate a (scaled) image of the texture. Height and width must be
    //powers of 2.
    ImageComponent2D textureIm = textureLoad.getScaledImage(64,128);

    //Generate the texture.
    Texture2D aTexture = new Texture2D(Texture2D.BASE_LEVEL,Texture2D.RGB,
                                            textureIm.getWidth(),
                                            textureIm.getHeight());
    aTexture.setImage(0,textureIm);

    //An Appearance which will use the texture.
    Appearance textureApp = new Appearance();
    textureApp.setTexture(aTexture);
    TextureAttributes textureAttr = new TextureAttributes();
View Full Code Here

Examples of javax.media.j3d.Texture2D

         
          // screen in die textur umwandeln und anzeigen
          ImageComponent2D texImage = new ImageComponent2D(
                  ImageComponent.FORMAT_RGBA4, screen);

          tex = new Texture2D(Texture.BASE_LEVEL, Texture.RGB, 256, 256);
          tex.setImage(0, texImage);
         
          texAttr = new TextureAttributes();
      texAttr.setTextureMode(TextureAttributes.MODULATE);
      textureUnitState[0] = new TextureUnitState(tex, texAttr, null);
View Full Code Here

Examples of javax.media.j3d.Texture2D

/*     */           }
/*     */           else {
/* 309 */             t = new TextureLoader(this.basePath + tFile, "RGB", 1, null);
/*     */           }
/*     */
/* 313 */           Texture2D texture = (Texture2D)t.getTexture();
/* 314 */           if (texture != null) this.cur.t = texture;
/*     */         }
/*     */         catch (FileNotFoundException e)
/*     */         {
/*     */         }
View Full Code Here

Examples of javax.media.j3d.Texture2D

/*     */   Texture getTexture()
/*     */   {
/* 132 */     debugOutputLn(1, "getTexture()");
/* 133 */     if (this.theImage == null)
/* 134 */       return null;
/* 135 */     Texture2D t2d = (Texture2D)textureTable.get(this.theImage);
/* 136 */     if (t2d == null) {
/* 137 */       ImageScaler scaler = new ImageScaler((BufferedImage)this.theImage);
/* 138 */       BufferedImage scaledImage = (BufferedImage)scaler.getScaledImage();
/* 139 */       TextureLoader tl = new TextureLoader(scaledImage);
/* 140 */       t2d = (Texture2D)tl.getTexture();
View Full Code Here

Examples of javax.media.j3d.Texture2D

/*     */
/* 121 */     if ((imageComponent.getWidth() == width) && (imageComponent.getHeight() == height))
/*     */     {
/* 123 */       tex.setImage(0, imageComponent);
/*     */     } else {
/* 125 */       Texture2D newTex = setupTexture(imageComponent);
/*     */
/* 129 */       newTex.setBoundaryModeS(tex.getBoundaryModeS());
/* 130 */       newTex.setBoundaryModeT(tex.getBoundaryModeT());
/* 131 */       newTex.setMinFilter(tex.getMinFilter());
/* 132 */       newTex.setMagFilter(tex.getMagFilter());
/* 133 */       newTex.setEnable(tex.getEnable());
/* 134 */       newTex.setAnisotropicFilterMode(tex.getAnisotropicFilterMode());
/* 135 */       newTex.setAnisotropicFilterDegree(tex.getAnisotropicFilterDegree());
/* 136 */       int pcount = tex.getFilter4FuncPointsCount();
/* 137 */       if (pcount > 0) {
/* 138 */         float[] weights = new float[pcount];
/* 139 */         tex.getFilter4Func(weights);
/* 140 */         newTex.setFilter4Func(weights);
/*     */       }
/* 142 */       Color4f c = new Color4f();
/* 143 */       tex.getBoundaryColor(c);
/* 144 */       newTex.setBoundaryColor(c);
/* 145 */       newTex.setUserData(tex.getUserData());
/* 146 */       getAppearance().setTexture(newTex);
/*     */     }
/*     */   }
View Full Code Here

Examples of javax.media.j3d.Texture2D

/*     */
/*     */   private void updateText2D(String text, Color3f color, String fontName, int fontSize, int fontStyle)
/*     */   {
/* 152 */     ImageComponent imageComponent = setupImage(text, color, fontName, fontSize, fontStyle);
/*     */
/* 155 */     Texture2D t2d = setupTexture(imageComponent);
/*     */
/* 157 */     QuadArray rect = setupGeometry(imageComponent.getWidth(), imageComponent.getHeight());
/*     */
/* 159 */     setGeometry(rect);
/*     */
View Full Code Here

Examples of javax.media.j3d.Texture2D

/* 184 */     return this.rectangleScaleFactor;
/*     */   }
/*     */
/*     */   private Texture2D setupTexture(ImageComponent imageComponent)
/*     */   {
/* 191 */     Texture2D t2d = new Texture2D(1, 6, imageComponent.getWidth(), imageComponent.getHeight());
/*     */
/* 195 */     t2d.setMinFilter(3);
/* 196 */     t2d.setMagFilter(3);
/* 197 */     t2d.setImage(0, imageComponent);
/* 198 */     t2d.setEnable(true);
/* 199 */     t2d.setCapability(7);
/* 200 */     t2d.setCapability(8);
/* 201 */     t2d.setCapability(0);
/* 202 */     t2d.setCapability(2);
/* 203 */     t2d.setCapability(3);
/* 204 */     t2d.setCapability(6);
/* 205 */     t2d.setCapability(12);
/* 206 */     t2d.setCapability(14);
/* 207 */     return t2d;
/*     */   }
View Full Code Here

Examples of javax.media.j3d.Texture2D

/*     */
/*     */   public Texture2DState(SymbolTableData symbol, Controller control) {
/*  56 */     super(symbol, control);
/*     */
/*  59 */     if (this.node != null) {
/*  60 */       Texture2D t = (Texture2D)this.node;
/*  61 */       this.detailImage = control.getSymbolTable().addReference(t.getDetailImage());
/*     */     }
/*     */   }
View Full Code Here

Examples of javax.media.j3d.Texture2D

/* 107 */     this.control.getSymbolTable().incNodeComponentRefCount(this.detailImage);
/*     */   }
/*     */
/*     */   public void buildGraph()
/*     */   {
/* 112 */     Texture2D t = (Texture2D)this.node;
/* 113 */     t.setDetailImage((ImageComponent2D)this.control.getSymbolTable().getJ3dNode(this.detailImage));
/* 114 */     super.buildGraph();
/*     */   }
View Full Code Here

Examples of javax.media.j3d.Texture2D

/* 118 */     return createNode(j3dClass, new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE, Integer.TYPE }, new Object[] { new Integer(this.mipMapMode), new Integer(this.format), new Integer(this.width), new Integer(this.height), new Integer(this.boundaryWidth) });
/*     */   }
/*     */
/*     */   protected SceneGraphObject createNode()
/*     */   {
/* 131 */     return new Texture2D(this.mipMapMode, this.format, this.width, this.height, this.boundaryWidth);
/*     */   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.