本文整理匯總了Java中javax.media.opengl.GL2.glGetDoublev方法的典型用法代碼示例。如果您正苦於以下問題:Java GL2.glGetDoublev方法的具體用法?Java GL2.glGetDoublev怎麽用?Java GL2.glGetDoublev使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.media.opengl.GL2
的用法示例。
在下文中一共展示了GL2.glGetDoublev方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: reshape
import javax.media.opengl.GL2; //導入方法依賴的package包/類
public void reshape(GLAutoDrawable drawable, int x, int y, int width,
int height) {
GL2 gl = drawable.getGL().getGL2();
this.drawable = drawable;
this.width = width;
this.height = height;
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0, width, height, 0, -1, 1);
gl.glViewport(0, 0, width, height);
gl.glGetDoublev(GL2.GL_MODELVIEW_MATRIX, modelview);
gl.glGetDoublev(GL2.GL_PROJECTION_MATRIX, projection);
gl.glGetIntegerv(GL2.GL_VIEWPORT, viewport);
}
示例2: apply
import javax.media.opengl.GL2; //導入方法依賴的package包/類
/**
* Apply the camera to a GL context.
*
* @param gl GL context.
*/
public void apply(GL2 gl) {
// 3D projection
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
// Perspective.
glu.gluPerspective(35, ratio, 1, 1000);
glu.gluLookAt(distance * sinZ, distance * -cosZ, height, // pos
0, 0, .5, // center
0, 0, 1 // up
);
// Change back to model view matrix.
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
// Store the matrixes for reference.
gl.glGetIntegerv(GL.GL_VIEWPORT, viewp, 0);
gl.glGetDoublev(GLMatrixFunc.GL_MODELVIEW_MATRIX, modelview, 0);
gl.glGetDoublev(GLMatrixFunc.GL_PROJECTION_MATRIX, projection, 0);
}
示例3: get2dPoint
import javax.media.opengl.GL2; //導入方法依賴的package包/類
protected DoubleBuffer get2dPoint( final GL2 gl, final double x, final double y, final double z )
{
final DoubleBuffer model = DoubleBuffer.allocate(16);
gl.glGetDoublev( GLMatrixFunc.GL_MODELVIEW_MATRIX, model );
final DoubleBuffer proj = DoubleBuffer.allocate(16);
gl.glGetDoublev( GLMatrixFunc.GL_PROJECTION_MATRIX, proj );
final IntBuffer view = IntBuffer.allocate(4);
gl.glGetIntegerv( GL.GL_VIEWPORT, view );
final DoubleBuffer winPos = DoubleBuffer.allocate(3);
final boolean b = this.glu.gluProject( x, y, z, model, proj, view, winPos );
if( !b ) System.out.println( "FAIL ");
return winPos;
}
示例4: display
import javax.media.opengl.GL2; //導入方法依賴的package包/類
public void display(GLAutoDrawable drawable) {
GL2 gl = drawable.getGL().getGL2();
this.drawable = drawable;
// Apply transformations
double transx = -origin.getX(), transy = -origin.getY();
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0, width, height, 0, -1, 1);
gl.glViewport(0, 0, width, height);
gl.glTranslated(transx + zoomPos.getX(), transy + zoomPos.getY(), 0);
gl.glScaled(scaleFactor, scaleFactor, 1);
gl.glTranslated(-zoomPos.getX(), -zoomPos.getY(), 0);
gl.glGetDoublev(GL2.GL_MODELVIEW_MATRIX, modelview);
gl.glGetDoublev(GL2.GL_PROJECTION_MATRIX, projection);
gl.glGetIntegerv(GL2.GL_VIEWPORT, viewport);
gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
// Draw edges, arrows and vertices
edgeRenderer.transform(transx, transy, scaleFactor);
edgeRenderer.render();
if (animateLabels) {
labelRenderer.scale(scaleFactor);
labelRenderer.drawLabels();
}
vertexRenderer.transform(transx, transy, scaleFactor);
vertexRenderer.render();
}