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


Java GL2.glScaled方法代码示例

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


在下文中一共展示了GL2.glScaled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();  // 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

示例4: 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

示例5: display

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/**
 * Draw the chart view onto OpenGL drawable.
 * The chart is drawn in the rectangular area [0, 0, width-1, height-1].
 */
@Override
public void display(GLAutoDrawable drawable) {
                      drawable.getContext().makeCurrent();
	GL2 gl = drawable.getGL().getGL2();
	gl.glClear(GL.GL_COLOR_BUFFER_BIT);
	gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
	gl.glLoadIdentity();

	// title
	titleRenderer.beginRendering(getWidth(), getHeight());
	titleRenderer.setColor(getForeground());
	titleRenderer.draw(title, titleArea.x, titleArea.y);
	titleRenderer.endRendering();

	// decoration (axes, etc.)
	drawDecoration(gl);

	/* draw body */
	gl.glTranslated(bodyArea.x, bodyArea.y, 0);
	gl.glScaled(bodyArea.width, bodyArea.height, 1);
	// draw background
	gl.glCallList(gridId);

	/* draw series */
	for (Category category : categories) {
		category.draw(gl);
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:33,代码来源:Chart.java

示例6: 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, -6.0f); // translate into the screen
	gl.glColor3f(1, 1, 1); //set the triangle color
	gl.glScaled(5, 5, 5);
			
	bunny.draw(g);
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:14,代码来源:SimpleMeshExample.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


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