Examples of Texture


Examples of javax.media.j3d.Texture

      Shape3D clonedShape = (Shape3D)shape.cloneNode(false);
      Appearance appearance = shape.getAppearance();
      if (appearance != null) {
        // Force only duplication of node's appearance except its texture
        Appearance clonedAppearance = (Appearance)appearance.cloneNodeComponent(true);       
        Texture texture = appearance.getTexture();
        if (texture != null) {
          clonedAppearance.setTexture(texture);
        }
        clonedShape.setAppearance(clonedAppearance);
      }
View Full Code Here

Examples of javax.media.j3d.Texture

    } else if (node instanceof Light) {
      ((Light)node).setEnable(false);
    } else if (node instanceof Shape3D) {
      Appearance appearance = ((Shape3D)node).getAppearance();
      if (appearance != null) {
        Texture texture = appearance.getTexture();
        if (texture != null) {
          // Share textures data as much as possible
          Texture sharedTexture = TextureManager.getInstance().shareTexture(texture);
          if (sharedTexture != texture) {
            appearance.setTexture(sharedTexture);
          }
          TextureAttributes textureAttributes = appearance.getTextureAttributes();
          if (textureAttributes == null) {
View Full Code Here

Examples of javax.media.j3d.Texture

        Color3f col = new Color3f(GUIPreferences.getInstance().getMapTextColor());
        ypos = 1;

        // This is a bit convoluted in order to reduce work done on a full update,
        // which happens fairly often.
        Texture tex = tileManager.getTexture(hex, 1.0f);
        if (tex != floor.getAppearance().getTexture()) {
            setEffect(current, tex);
        }

        int keep = (surface == null?KEEP:KEEP+1);
View Full Code Here

Examples of mdesl.graphics.Texture

   * @param filter
   * @param wrap
   * @throws LWJGLException
   */
  public FrameBuffer(int width, int height, int filter, int wrap) throws LWJGLException {
    this(new Texture(width, height, filter, wrap), true);
  }
View Full Code Here

Examples of net.sourceforge.dsnk.model.Texture

   * @return texture or null if given index has length -1
   * @throws IOException
   *             if an io error occurs
   */
  public Texture read(TexIdx idx) throws IOException {
    Texture texture = new Texture(idx);

    if (idx.getLength() == -1) {
      return null;
    }

    int width = 0;
    int height = 0;
    switch (idx.getLength()) {
    case -1:
      return null;

    case TexIdx.SMALL_TEXTURE:
      width = 64;
      height = 64;
      break;

    case TexIdx.BIG_TEXTURE:
      width = 128;
      height = 128;
      break;

    default:
      return null;
    }

    BufferedImage image = new BufferedImage(width, height,
        BufferedImage.TYPE_INT_ARGB);
    WritableRaster wr = image.getRaster();

    // get texture data for index
    byte[] texData = new byte[idx.getLength()];
    System.arraycopy(data, idx.getStart(), texData, 0, idx.getLength());

    // draw data to image
    drawData(wr, texData, width, height);
    texture.setImage(image);

    return texture;
  }
View Full Code Here

Examples of org.getspout.spoutapi.block.design.Texture

*/
public class DefenseTowerBlock extends GenericCubeCustomBlock{

  public DefenseTowerBlock(Plugin plugin) {   
     super(plugin, "DefenseTowerBrick", ConflictPlugin.DEFENSETOWERBLOCKID, "", 16);
     this.getBlockDesign().setTexture(plugin, new Texture(plugin, "http://tossat.de/~mcbukkit/images/defblock.png", 16, 16, 16));
     this.setHardness(ConflictPlugin.deffBlockHardness);
  }
View Full Code Here

Examples of org.newdawn.slick.opengl.Texture

      //GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
      //getTexture().bind();
      GL11.glColor3d(1, 1, 1);
      //GL11.glColor3d(.25, .25, .25);
     
      Texture tex;
      GL11.glDisable(GL11.GL_TEXTURE_2D);
      for(int i = 0; i < hearts.length; i++){
        if(hearts[i] == 1){
          tex = full;
        } else if (hearts[i] == .5){
          tex = half;
        } else {
          tex = empty;
        }
        tex.bind();
        GL11.glBegin(GL11.GL_QUADS);
          GL11.glNormal3d(0, 0, 1);
          GL11.glTexCoord2d(0.0, 0.0);
          GL11.glVertex3d(x + heartWidth*i, y, zIndex);
          GL11.glTexCoord2d(1.0, 0.0);
View Full Code Here

Examples of org.newdawn.slick.opengl.Texture

   * @throws IOException
   *             Indicates a failure to access the resource
   */
  public static Texture getTexture(String resourceName,
      BufferedImage resourceImage) throws IOException {
    Texture tex = getTexture(resourceName, resourceImage,
        GL11.GL_TEXTURE_2D, // target
        GL11.GL_RGBA, // dest pixel format
        GL11.GL_LINEAR, // min filter (unused)
        GL11.GL_LINEAR);

View Full Code Here

Examples of org.newdawn.slick.opengl.Texture

     * The colour has to be set independently of this method.
     *
     * @param shape The shape to draw.
     */
    public static final void draw(Shape shape) {
        Texture t = TextureImpl.getLastBind();
        TextureImpl.bindNone();
       
        float points[] = shape.getPoints();
       
        LSR.start();
        for(int i=0;i<points.length;i+=2) {
          LSR.vertex(points[i], points[i + 1]);
        }
       
        if (shape.closed()) {
          LSR.vertex(points[0], points[1]);
        }
       
        LSR.end();
       
        if (t == null) {
          TextureImpl.bindNone();
        } else {
          t.bind();
        }
    }
View Full Code Here

Examples of org.newdawn.slick.opengl.Texture

     * @param fill The fill to apply
     */
    public static final void draw(Shape shape, ShapeFill fill) {
        float points[] = shape.getPoints();
       
        Texture t = TextureImpl.getLastBind();
        TextureImpl.bindNone();

        float center[] = shape.getCenter();
        GL.glBegin(SGL.GL_LINE_STRIP);
        for(int i=0;i<points.length;i+=2) {
            fill.colorAt(shape, points[i]-center[0], points[i + 1]-center[1]).bind();
            Vector2f offset = fill.getOffsetAt(shape, points[i], points[i + 1]);
            GL.glVertex2f(points[i] + offset.x, points[i + 1] + offset.y);
        }
       
        if (shape.closed()) {
          fill.colorAt(shape, points[0]-center[0], points[1]-center[1]).bind();
          Vector2f offset = fill.getOffsetAt(shape, points[0], points[1]);
          GL.glVertex2f(points[0] + offset.x, points[1] + offset.y);
        }
        GL.glEnd();
       
        if (t == null) {
          TextureImpl.bindNone();
        } else {
          t.bind();
        }
    }
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.