本文整理汇总了Java中com.jogamp.opengl.GL2.glClearDepth方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glClearDepth方法的具体用法?Java GL2.glClearDepth怎么用?Java GL2.glClearDepth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL2
的用法示例。
在下文中一共展示了GL2.glClearDepth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
view = new FlyView(0, 3.6f, -10);
view.getAim().setAngleY(180);
cone = new Cone(6, 6, 3);
cylinder = new Cylinder(6, 6, 3);
cylinder.transform.translate(8, 0, 0);
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
}
示例2: 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
view = new UEView(-28, 8, 0);
view.getAim().rotate(Vector3.Y, 90);
//Load motion
//String path = "02_01.bvh";
String path = "anim.bvh";
motion = AnimationLoader.getInstance().loadMotion(path);
startAnimation = System.currentTimeMillis();
loading = 100;
}
示例3: 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
view = new UEView(-10, 0, 0);
view.getAim().rotate(Vector3.Y, 90);
//Load motion
motion = AnimationLoader.getInstance().loadMotion("anim.bvh");
loading = 100;
}
示例4: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
//Init 3d Stuff
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
//Load bunny model
Model bunnyVBO = MeshLoader.getInstance().loadModel("bunny.obj");
bunny = new ModelInstance(bunnyVBO);
bunny.setColor(Color.GHOST_WHITE);
loading = 100;
}
示例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
//Load bunny model
bunnyVBO = MeshLoader.getInstance().loadModel("bunny.obj");
bunny = new ModelInstance(bunnyVBO);
bunny.setColor(Color.GHOST_WHITE);
octree = new VolumeOctree<Face>(bunnyVBO.getBoundingBox());
for (Face face : bunnyVBO.getFaces()) {
Point3D centroid = bunnyVBO.centroid(face);
octree.add(centroid, face);
}
loading = 100;
}
示例6: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
//Init 3d Stuff
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2(); // get the OpenGL graphics context
gl.glClearColor(1.0f, 1.0f, 1.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
//Load logo model
Model logoVBO = MeshLoader.getInstance().loadModel("logo/logo.obj");
logo = new ModelInstance(logoVBO);
loading = 100;
}
示例7: init
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void init(Graphics3D graphics) {
view = new FlyView(0, 3.6f, -10);
view.getAim().setAngleY(180);
cone = new Cone(6, 6, 3);
cylinder = new Cylinder(6, 6, 3);
cylinder.transform.translate(8, 0, 0);
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
}
示例8: 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));
}
示例9: 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));
}
示例10: 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");
}
示例11: 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));
}
示例12: 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
//Load bunny model
bunnyVBO = MeshLoader.getInstance().loadModel("bunny.obj");
bunny = new ModelInstance(bunnyVBO);
bunny.setColor(Color.GHOST_WHITE);
octree = new VolumeOctree<Face>(bunnyVBO.getBoundingBox());
for (Face face : bunnyVBO.getFaces()) {
Point3D centroid = bunnyVBO.centroid(face);
octree.add(centroid, face);
}
clippingBox = new BoundingBox3D(bunnyVBO.getBoundingBox());
clippingBox.getMinPoint().offsetX(-0.1);
clippingBox.getMaxPoint().offsetX(-0.1);
intersectedFaces = octree.getData(clippingBox);
System.out.println("Size: " + bunnyVBO.getFaces().size());
System.out.println("Size: " + intersectedFaces.size());
loading = 100;
}
示例13: 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
frustrum = new Frustrum();
//Load bunny model
bunnyVBO = MeshLoader.getInstance().loadModel("bunny.obj");
bunny = new ModelInstance(bunnyVBO);
bunny.setColor(Color.GHOST_WHITE);
octree = new VolumeOctree<Face>(bunnyVBO.getBoundingBox());
for (Face face:bunnyVBO.getFaces()) {
Point3D centroid = bunnyVBO.centroid(face);
octree.add(centroid, face);
}
loading = 100;
}
示例14: 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
}
示例15: 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;
}