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


Java GL2.glRotated方法代码示例

本文整理汇总了Java中com.jogamp.opengl.GL2.glRotated方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glRotated方法的具体用法?Java GL2.glRotated怎么用?Java GL2.glRotated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jogamp.opengl.GL2的用法示例。


在下文中一共展示了GL2.glRotated方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
    AWTGraphics3D g = (AWTGraphics3D) graphics;
    GL2 gl = g.getGL2();  // get the OpenGL 2 graphics context
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // clear color and depth buffers
    gl.glLoadIdentity();  // reset the model-view matrix

    gl.glTranslatef(0.0f, 0.0f, -15.0f); // translate into the screen
    gl.glScaled(15, 15, 15);
    gl.glRotated(angleY, 0, 1, 0);

    //Draw Bunny Model
    bunny.draw(g);

    //Draw Bounding Box
    gl.glColor3f(0, 1, 1);
    //g.drawBoundingBox(bunnyVBO.getBoundingBox());
    renderOctree(g, octree);

    //Rotate Model
    if (rotate) {
        angleY += 1;
    }
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:25,代码来源:OctreeRender.java

示例2: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
	AWTGraphics3D g = (AWTGraphics3D) graphics;
	GL2 gl = g.getGL2();  // get the OpenGL 2 graphics context
	gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // clear color and depth buffers
	gl.glLoadIdentity();  // reset the model-view matrix
			
	gl.glTranslatef(0.0f, 0.0f, -5.0f); // translate into the screen
	gl.glScaled(2, 2, 2);
	gl.glRotated(angleY, 0, 1, 0);
	
	g.drawFrustrum(frustrum);
			
	//Draw Bunny Model
	bunny.draw(g);
	
	//Draw Bounding Box
	gl.glColor3f(0, 1, 1);
	renderOctree(g, octree);
			
	//Rotate Model
	if(rotate) {
		angleY += 1;
	}
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:26,代码来源:FrustrumRender.java

示例3: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
	AWTGraphics3D g = (AWTGraphics3D) graphics;
	GL2 gl = g.getGL2();
			
	resetScene(graphics);
	//Draw Scene
	drawFloor(gl);
	
	resetScene(graphics);
	
	angleXY = leftMarker.angleXY(originMarker);
	angleXZ = leftMarker.angleXZ(originMarker);
	angleYZ = leftMarker.angleYZ(originMarker);
	
	//Angle XY turn in Z
	gl.glRotated(angleXY, 0, 0, 1);
	
	drawTile(gl, leftMarker.getX(), leftMarker.getY(), tileSize, marker);

	gl.glFlush();

}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:24,代码来源:RadialMarkerApplication.java

示例4: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
    AWTGraphics3D g = (AWTGraphics3D) graphics;
    GL2 gl = g.getGL2();  // get the OpenGL 2 graphics context
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // clear color and depth buffers
    gl.glLoadIdentity();  // reset the model-view matrix

    gl.glTranslatef(-20.0f, -20.0f, -80.0f); // translate into the screen

    // Rotate Logo
    a += 0.5;
    gl.glRotated(a, 0, 1, 0);

    gl.glScaled(5, 5, 5);

    logo.diffuseRender(gl);
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:18,代码来源:LogoShowApplication.java

示例5: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
	AWTGraphics3D g = (AWTGraphics3D) graphics;
	GL2 gl = g.getGL2();
	
	if(wireFrame) {
		gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
	} else {
		gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
	}
	
	angleY += 0.4;
	
	gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
	//gl.glColor3f(1.0f, 1.0f, 0f);
	g.setColor(color);
	gl.glLoadIdentity();             /* clear the matrix */
	/* viewing transformation  */
	g.getGLU().gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
	gl.glRotated(angleY, 0,1,0);
	gl.glScalef(1.0f, 2.0f, 1.0f);      /* modeling transformation */ 
	g.drawPyramid(1.0f);
	
	gl.glFlush();
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:26,代码来源:PyramidExample.java

示例6: paintCovarianceEllipse

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
protected static void paintCovarianceEllipse( double[] pos, double[][] cov, final double nsigmas, float[] color, GL2 gl )
{
	final int no_points_ellipse = 12;

	final double a = cov[0][0];
	final double b = cov[1][0];
	final double c = cov[1][1];
	final double d = Math.sqrt( (((a*a) + (4*b*b)) - (2*a*c)) + (c*c) );
	final double scale1 = Math.sqrt( 0.5 * ( a+c+d ) ) * nsigmas;
	final double scale2 = Math.sqrt( 0.5 * ( (a+c)-d ) ) * nsigmas;
	final double theta = (0.5 * Math.atan2( (2*b), (a-c) ) * 180.0) / Math.PI;

	gl.glPushMatrix();

	gl.glTranslated(pos[0], pos[1], 0);
	gl.glRotated(theta, 0, 0, 1);
	gl.glScaled(scale1, scale2, 1);

	gl.glColor3f( color[0], color[1], color[2] );
	gl.glLineWidth(2);

	gl.glBegin(GL.GL_LINE_LOOP);
	final double angle = (2*Math.PI) / no_points_ellipse;
	for (int i = 0;i<no_points_ellipse;i++) {
		gl.glVertex2d( Math.cos( i*angle ), Math.sin( i*angle ) );
	}
	gl.glEnd();

	gl.glPopMatrix();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:31,代码来源:KalmanEventFilter.java

示例7: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
    AWTGraphics3D g = (AWTGraphics3D) graphics;

    GL2 gl = g.getGL2();  // get the OpenGL 2 graphics context
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // clear color and depth buffers
    gl.glLoadIdentity();  // reset the model-view matrix

    gl.glTranslatef(0.0f, 0.0f, -15.0f); // translate into the screen
    gl.glScaled(15, 15, 15);
    gl.glRotated(angleY, 0, 1, 0);

    //Draw Bounding Box
    gl.glColor3f(1, 0, 0);
    g.drawBoundingBox(clippingBox);

    //Draw Bunny Model
    bunny.draw(gl, intersectedFaces);

    gl.glColor3f(0, 1, 1);
    renderOctree(g, octree);

    //Rotate Model
    if (rotate) {
        angleY += 1;
    }
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:28,代码来源:OctreeClipping.java

示例8: resetScene

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
protected void resetScene(Graphics3D graphics) {
	AWTGraphics3D g = (AWTGraphics3D) graphics;
	GL2 gl = g.getGL2();
	
	g.updateCamera(camera);
	
	gl.glRotated(90, 1, 0, 0);
	
	gl.glRotated(angleX, 1, 0, 0);
	gl.glRotated(angleY, 0, 1, 0);
	gl.glRotated(angleZ, 0, 0, 1);
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:13,代码来源:RadialMarkerApplication.java

示例9: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
	AWTGraphics3D g = (AWTGraphics3D) graphics;
	GL2 gl = g.getGL2();  // get the OpenGL 2 graphics context
	gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // clear color and depth buffers
	gl.glLoadIdentity();  // reset the model-view matrix
	gl.glClearColor(1f,1f,1f,1f);
	
	g.setColor(Color.WHITE);
	gl.glTranslatef(0.0f, 0.0f, -15.0f); // translate into the screen
	//gl.glScaled(150, 150, 150);
	gl.glRotated(angleY, 0, 1, 0);
	
	//Draw Models
	//Start batch
	gl.glEnable(GL.GL_DEPTH_TEST);

	gl.glPushMatrix();
	stone.renderTextured(gl);
	gl.glPopMatrix();
	
	gl.glPushMatrix();
	gl.glDisable(GL.GL_CULL_FACE);
	gl.glEnable(GL.GL_BLEND);
	gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
	
	tree.renderTextured(gl);
	gl.glPopMatrix();
	
	//End batch
	gl.glDisable(GL.GL_DEPTH_TEST);
	
	//Rotate Models
	if(rotate) {
		angleY += 1;
	}
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:38,代码来源:MeshExample.java

示例10: applyTransform

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/**
 * Applies the given transform to the given OpenGL files.
 *
 * @param gl the OpenGL files
 * @param t  the transform
 */
public static final void applyTransform(GL2 gl, Transform t) {
    Vector2 tr = t.getTranslation();
    // apply the translation
    gl.glTranslated(tr.x, tr.y, 0.0);
    // apply the rotation (remember that OpenGL expects degrees not radians)
    gl.glRotated(Math.toDegrees(t.getRotation()), 0.0, 0.0, 1.0);
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:14,代码来源:RenderUtilities.java

示例11: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
	AWTGraphics3D g = (AWTGraphics3D) graphics;
	GL2 gl = g.getGL2();
					
	//Transform by Camera
	lookCamera(graphics);
	
	gl.glRotated(angleX, 1, 0, 0);
	gl.glRotated(angleY, 0, 1, 0);
	gl.glRotated(angleZ, 0, 0, 1);

	//Draw Scene
	drawFloor(gl);
	

	gl.glFlush();

}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:20,代码来源:MarkerApplication.java


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