本文整理汇总了Java中com.jogamp.opengl.GL2.glTexCoord2d方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glTexCoord2d方法的具体用法?Java GL2.glTexCoord2d怎么用?Java GL2.glTexCoord2d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL2
的用法示例。
在下文中一共展示了GL2.glTexCoord2d方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawPolygon
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawPolygon(final GL2 gl, final int xLowerLeft, final int yLowerLeft, final int width, final int height) {
gl.glPushMatrix();
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
gl.glEnable(GL.GL_BLEND);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
final double xRatio = (double) chip.getSizeX() / (double) width;
final double yRatio = (double) chip.getSizeY() / (double) height;
gl.glBegin(GL2.GL_POLYGON);
gl.glTexCoord2d(0, 0);
gl.glVertex2d(xLowerLeft, yLowerLeft);
gl.glTexCoord2d(xRatio, 0);
gl.glVertex2d(xRatio * width + xLowerLeft, yLowerLeft);
gl.glTexCoord2d(xRatio, yRatio);
gl.glVertex2d(xRatio * width + xLowerLeft, yRatio * height + yLowerLeft);
gl.glTexCoord2d(0, yRatio);
gl.glVertex2d(+xLowerLeft, yRatio * height + yLowerLeft);
gl.glEnd();
gl.glPopMatrix();
}
示例2: drawPolygon
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawPolygon(final GL2 gl, final int width, final int height) {
final double xRatio = (double) chip.getSizeX() / (double) width;
final double yRatio = (double) chip.getSizeY() / (double) height;
gl.glBegin(GL2.GL_POLYGON);
gl.glTexCoord2d(0, 0);
gl.glVertex2d(0, 0);
gl.glTexCoord2d(xRatio, 0);
gl.glVertex2d(xRatio * width, 0);
gl.glTexCoord2d(xRatio, yRatio);
gl.glVertex2d(xRatio * width, yRatio * height);
gl.glTexCoord2d(0, yRatio);
gl.glVertex2d(0, yRatio * height);
gl.glEnd();
}
示例3: drawTile
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawTile(GL2 gl, double x, double y, double tileSize) {
gl.glBegin(GL2.GL_QUADS);
//(0,0)
gl.glTexCoord2d(0, 0);
gl.glVertex3d(x * tileSize, 0, y * tileSize);
//(1,0)
gl.glTexCoord2d(1, 0);
gl.glVertex3d(x * tileSize + tileSize, 0, y * tileSize);
//(1,1)
gl.glTexCoord2d(1, 1);
gl.glVertex3d(x * tileSize + tileSize, 0, y * tileSize + tileSize);
//(0,1)
gl.glTexCoord2d(0, 1);
gl.glVertex3d(x * tileSize, 0, y * tileSize + tileSize);
gl.glEnd();
}
示例4: drawTile
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawTile(GL2 gl, double x, double y, double tileSize) {
gl.glBegin(GL2.GL_QUADS);
//(0,0)
gl.glTexCoord2d(0, 0);
gl.glVertex3d(x*tileSize, 0, y*tileSize);
//(1,0)
gl.glTexCoord2d(1, 0);
gl.glVertex3d(x*tileSize+tileSize, 0, y*tileSize);
//(1,1)
gl.glTexCoord2d(1, 1);
gl.glVertex3d(x*tileSize+tileSize, 0, y*tileSize+tileSize);
//(0,1)
gl.glTexCoord2d(0, 1);
gl.glVertex3d(x*tileSize, 0, y*tileSize+tileSize);
gl.glEnd();
}
示例5: drawTile
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawTile(GL2 gl, double x, double y, double tileSize){
gl.glBegin(GL2.GL_QUADS);
//(0,0)
gl.glTexCoord2d(0, 0);
gl.glVertex3d(x*tileSize, 0, y*tileSize);
//(1,0)
gl.glTexCoord2d(1, 0);
gl.glVertex3d(x*tileSize+tileSize, 0, y*tileSize);
//(1,1)
gl.glTexCoord2d(1, 1);
gl.glVertex3d(x*tileSize+tileSize, 0, y*tileSize+tileSize);
//(0,1)
gl.glTexCoord2d(0, 1);
gl.glVertex3d(x*tileSize, 0, y*tileSize+tileSize);
gl.glEnd();
}
示例6: drawTile
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawTile(GL2 gl, double x, double y, double tileSize) {
gl.glBegin(GL2.GL_QUADS);
//(0,0)
gl.glTexCoord2d(0, 0);
gl.glVertex3d(x*tileSize, 0, y*tileSize);
//(1,0)
gl.glTexCoord2d(1, 0);
gl.glVertex3d(x*tileSize+tileSize, 0, y*tileSize);
//(1,1)
gl.glTexCoord2d(1, 1);
gl.glVertex3d(x*tileSize+tileSize, 0, y*tileSize+tileSize);
//(0,1)
gl.glTexCoord2d(0, 1);
gl.glVertex3d(x*tileSize, 0, y*tileSize+tileSize);
gl.glEnd();
}
示例7: drawBackground
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawBackground(GL2 gl) {
background.enable(gl);
background.bind(gl);
float scale = 2.2f;
float tileSizeW = 16 * scale;
float tileSizeH = 9 * scale;
float x = -0.5f;
float y = -0.5f;
gl.glBegin(GL2.GL_QUADS);
//(0,0)
gl.glTexCoord2d(0, 0);
gl.glVertex3d(x * tileSizeW, 0, y * tileSizeH);
//(1,0)
gl.glTexCoord2d(1, 0);
gl.glVertex3d(x * tileSizeW + tileSizeW, 0, y * tileSizeH);
//(1,1)
gl.glTexCoord2d(1, 1);
gl.glVertex3d(x * tileSizeW + tileSizeW, 0, y * tileSizeH + tileSizeH);
//(0,1)
gl.glTexCoord2d(0, 1);
gl.glVertex3d(x * tileSizeW, 0, y * tileSizeH + tileSizeH);
gl.glEnd();
background.disable(gl);
}
示例8: drawTile
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawTile(GL2 gl, double x, double y, double tileSize, Texture texture) {
texture.enable(gl);
texture.bind(gl);
gl.glBegin(GL2.GL_QUADS);
//(0,0)
gl.glTexCoord2d(0, 0);
gl.glVertex3d(x * tileSize, 0, y * tileSize);
//(1,0)
gl.glTexCoord2d(1, 0);
gl.glVertex3d(x * tileSize + tileSize, 0, y * tileSize);
//(1,1)
gl.glTexCoord2d(1, 1);
gl.glVertex3d(x * tileSize + tileSize, 0, y * tileSize + tileSize);
//(0,1)
gl.glTexCoord2d(0, 1);
gl.glVertex3d(x * tileSize, 0, y * tileSize + tileSize);
gl.glEnd();
texture.disable(gl);
}
示例9: drawTile
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawTile(GL2 gl, double x, double y, double tileSize, Texture texture) {
texture.enable(gl);
texture.bind(gl);
gl.glBegin(GL2.GL_QUADS);
//(0,0)
gl.glTexCoord2d(0, 0);
gl.glVertex3d(x*tileSize, 0, y*tileSize);
//(1,0)
gl.glTexCoord2d(1, 0);
gl.glVertex3d(x*tileSize+tileSize, 0, y*tileSize);
//(1,1)
gl.glTexCoord2d(1, 1);
gl.glVertex3d(x*tileSize+tileSize, 0, y*tileSize+tileSize);
//(0,1)
gl.glTexCoord2d(0, 1);
gl.glVertex3d(x*tileSize, 0, y*tileSize+tileSize);
gl.glEnd();
texture.disable(gl);
}
示例10: drawTile
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
private void drawTile(GL2 gl, double x, double y, double tileSize, Texture texture) {
texture.enable(gl);
texture.bind(gl);
gl.glBegin(GL2.GL_QUADS);
//(0,0)
gl.glTexCoord2d(0, 0);
gl.glVertex3d(x*tileSize-tileSize/2, 0, y*tileSize-tileSize/2);
//(1,0)
gl.glTexCoord2d(1, 0);
gl.glVertex3d(x*tileSize-tileSize/2+tileSize, 0, y*tileSize-tileSize/2);
//(1,1)
gl.glTexCoord2d(1, 1);
gl.glVertex3d(x*tileSize+tileSize-tileSize/2, 0, y*tileSize+tileSize-tileSize/2);
//(0,1)
gl.glTexCoord2d(0, 1);
gl.glVertex3d(x*tileSize-tileSize/2, 0, y*tileSize+tileSize-tileSize/2);
gl.glEnd();
texture.disable(gl);
}