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


Java GL2.glTexEnvi方法代码示例

本文整理汇总了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));
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:24,代码来源:PositionAxis.java

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

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

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

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


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