当前位置: 首页>>代码示例>>Java>>正文


Java GL2.glTexCoord2d方法代码示例

本文整理汇总了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();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:RoShamBoCNN.java

示例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();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:17,代码来源:ChipRendererDisplayMethodRGBA.java

示例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();
    }
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:23,代码来源:StampApplication.java

示例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();
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:22,代码来源:Perspective.java

示例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();
	}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:23,代码来源:Ortographic.java

示例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();
	}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:23,代码来源:GridPerspective.java

示例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);
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:34,代码来源:CollisionApplication.java

示例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);
    }
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:28,代码来源:CollisionApplication.java

示例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);
	}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:28,代码来源:GridMenuApplication.java

示例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);
	}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:28,代码来源:RadialMarkerApplication.java


注:本文中的com.jogamp.opengl.GL2.glTexCoord2d方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。