本文整理汇总了Java中com.jogamp.opengl.GL2.glTexEnvi方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glTexEnvi方法的具体用法?Java GL2.glTexEnvi怎么用?Java GL2.glTexEnvi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL2
的用法示例。
在下文中一共展示了GL2.glTexEnvi方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
view = new FlyView(30, 3.6f, 0);
view.getAim().setAngleY(190);
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2(); // get the OpenGL graphics context
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // set background (clear) color
gl.glClearDepth(1.0f); // set clear depth value to farthest
gl.glEnable(GL.GL_DEPTH_TEST); // enables depth testing
gl.glDepthFunc(GL.GL_LEQUAL); // the type of depth test to do
gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); // best perspective correction
gl.glShadeModel(GL2.GL_SMOOTH); // blends colors nicely, and smoothes out lighting
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_DECAL);
xAxis = new BoundingBox(new Vector3(0, -axisWidth/2, -axisWidth/2), new Vector3(axisSize, axisWidth/2, axisWidth/2));
yAxis = new BoundingBox(new Vector3(-axisWidth/2, 0, -axisWidth/2), new Vector3(axisWidth/2, axisSize, axisWidth/2));
zAxis = new BoundingBox(new Vector3(-axisWidth/2, -axisWidth/2, 0), new Vector3(axisWidth/2, axisWidth/2, axisSize));
}
示例2: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
view = new FlyView(30, 3.6f, 0);
view.getAim().setAngleY(190);
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2(); // get the OpenGL graphics context
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // set background (clear) color
gl.glClearDepth(1.0f); // set clear depth value to farthest
gl.glEnable(GL.GL_DEPTH_TEST); // enables depth testing
gl.glDepthFunc(GL.GL_LEQUAL); // the type of depth test to do
gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); // best perspective correction
gl.glShadeModel(GL2.GL_SMOOTH); // blends colors nicely, and smoothes out lighting
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_DECAL);
vAxis = new BoundingBox(new Vector3(-axisSize/8, -axisWidth/2, -axisSize/8), new Vector3(axisSize/8, axisWidth/2, axisSize/8));
hAxis = new BoundingBox(new Vector3(-axisSize/8, -axisSize/8, -axisWidth/2), new Vector3(axisSize/8, axisSize/8, axisWidth/2));
}
示例3: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
view = new FlyView(30, 1.6f, 0);
view.getAim().setAngleY(180);
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2(); // get the OpenGL graphics context
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // set background (clear) color
gl.glClearDepth(1.0f); // set clear depth value to farthest
gl.glEnable(GL.GL_DEPTH_TEST); // enables depth testing
gl.glDepthFunc(GL.GL_LEQUAL); // the type of depth test to do
gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); // best perspective correction
gl.glShadeModel(GL2.GL_SMOOTH); // blends colors nicely, and smoothes out lighting
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_DECAL);
stoneMesh = MeshLoader.getInstance().loadModel("stone/stone.obj");
stone = new ModelInstance(stoneMesh);
stone.setColor(Color.WHITE);
stone.offsetX(35);
stone.offsetY(0.5f);
stone.offsetZ(7);
stone.setScale(0.3f);
tree = new ModelInstance(MeshLoader.getInstance().loadModel("bamboo/bamboo.obj"));
tree.offsetX(30);
tree.offsetY(0.5f);
tree.offsetZ(7);
tree.setColor(Color.WHITE);
tree.setScale(1.5f);
floor = TextureLoader.getInstance().loadTexture("mark.png");
}
示例4: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
view = new FlyView(30, 1.6f, 0);
view.getAim().setAngleY(160);
GL2 gl = g.getGL2(); // get the OpenGL graphics context
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // set background (clear) color
gl.glClearDepth(1.0f); // set clear depth value to farthest
gl.glEnable(GL.GL_DEPTH_TEST); // enables depth testing
gl.glDepthFunc(GL.GL_LEQUAL); // the type of depth test to do
gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); // best perspective correction
gl.glShadeModel(GL2.GL_SMOOTH); // blends colors nicely, and smoothes out lighting
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_DECAL);
cubes = new ArrayList<OrientedBoundingBox>();
cubes.add(new OrientedBoundingBox(1).translate(20, 1, 7));
cubes.add(new OrientedBoundingBox(1).translate(22, 1, 7));
cubes.add(new OrientedBoundingBox(1).translate(24, 1, 7));
cubes.add(new OrientedBoundingBox(1).translate(26, 1, 7));
cubes.add(new OrientedBoundingBox(1).translate(28, 1, 7));
cubes.add(new OrientedBoundingBox(1).translate(30, 1, 7));
cubes.add(new OrientedBoundingBox(1).translate(32, 1, 7));
}
示例5: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2(); // get the OpenGL graphics context
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // set background (clear) color
gl.glClearDepth(1.0f); // set clear depth value to farthest
gl.glEnable(GL.GL_DEPTH_TEST); // enables depth testing
gl.glDepthFunc(GL.GL_LEQUAL); // the type of depth test to do
gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); // best perspective correction
gl.glShadeModel(GL2.GL_SMOOTH); // blends colors nicely, and smoothes out lighting
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_DECAL);
//Load models
stone = new ModelInstance(MeshLoader.getInstance().loadModel("stone/stone.obj"));
stone.setColor(Color.WHITE);
stone.offsetX(-2);
stone.offsetY(0.5f);
stone.setScale(0.5f);
tree = new ModelInstance(MeshLoader.getInstance().loadModel("bamboo/bamboo.obj"));
tree.setColor(Color.WHITE);
tree.setScale(1.5f);
loading = 100;
}