Class TextureCoords

java.lang.Object
com.jogamp.opengl.util.texture.TextureCoords

public class TextureCoords extends Object
Specifies texture coordinates for a rectangular area of a texture. Note that some textures are inherently flipped vertically from OpenGL's standard coordinate system. This class takes care of this vertical flip so that the "bottom" and "top" coordinates may sometimes be reversed. From the point of view of code rendering textured polygons, it can always map the bottom and left texture coordinates from the TextureCoords to the lower left point of the textured polygon and achieve correct results.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TextureCoords(float left, float bottom, float right, float top)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the bottommost (y) texture coordinate of this rectangle.
    float[]
    getST_LB_RB_LT_RT(float[] d, int d_off, float ss, float ts)
    Transfers {s * ss, t * ts} from this object into the given float[8+d_off] in the following order:
    float
    Returns the leftmost (x) texture coordinate of this rectangle.
    float
    Returns the rightmost (x) texture coordinate of this rectangle.
    float
    top()
    Returns the topmost (y) texture coordinate of this rectangle.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TextureCoords

      public TextureCoords(float left, float bottom, float right, float top)
  • Method Details

    • getST_LB_RB_LT_RT

      public float[] getST_LB_RB_LT_RT(float[] d, int d_off, float ss, float ts)
      Transfers {s * ss, t * ts} from this object into the given float[8+d_off] in the following order:
         left,  bottom
         right, bottom
         left,  top
         right  top
       
    • left

      public float left()
      Returns the leftmost (x) texture coordinate of this rectangle.
    • right

      public float right()
      Returns the rightmost (x) texture coordinate of this rectangle.
    • bottom

      public float bottom()
      Returns the bottommost (y) texture coordinate of this rectangle.
    • top

      public float top()
      Returns the topmost (y) texture coordinate of this rectangle.
    • toString

      public String toString()
      Overrides:
      toString in class Object