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


Java GLU.gluLookAt方法代码示例

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


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

示例1: setCamera

import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
private void setCamera(GL2 gl, GLU glu) 
{
	gl.glMatrixMode(GL2.GL_PROJECTION);
	gl.glLoadIdentity();

	
	glu.gluPerspective(75, 1, 0.01, 1000);		
	//look at the player from 1.5 units directly above the player 
	glu.gluLookAt(
			inst.player.pos.x, inst.player.pos.y, 1.5, 
			inst.player.pos.x, inst.player.pos.y, 0,
			 0, 1, 0);

	gl.glMatrixMode(GL2.GL_MODELVIEW);
	gl.glLoadIdentity();
}
 
开发者ID:ben-j-c,项目名称:TopDownGame,代码行数:17,代码来源:Display.java

示例2: setCameraMapping

import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
private void setCameraMapping(GL2 gl, GLU glu) 
{
	gl.glMatrixMode(GL2.GL_PROJECTION);
	gl.glLoadIdentity();

	gl.glOrtho(-1, 1, -1, 1, 0.01, 1000);
	
	//look at the player from 2.5 units directly above the player 
	glu.gluLookAt(
			inst.player.pos.x + inst.offset.x, inst.player.pos.y + inst.offset.y, 1.5, 
			inst.player.pos.x + inst.offset.x, inst.player.pos.y + inst.offset.y, 0,
			 0, 1, 0);

	gl.glMatrixMode(GL2.GL_MODELVIEW);
	gl.glLoadIdentity();
}
 
开发者ID:ben-j-c,项目名称:TopDownGame,代码行数:17,代码来源:Display.java

示例3: setCamera

import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
private void setCamera(GLAutoDrawable drawable, GLU glu, float distance) {
	GL2 gl = drawable.getGL().getGL2();

	// Change to projection matrix.
	gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
	gl.glLoadIdentity();
	//gl.glEnable(GL.GL_DEPTH_TEST);
	//gl.glTranslatef( 0f, 0f, 800);
	//gl.glTranslatef( chip.getSizeX()/2, chip.getSizeX()/2, chip.getSizeX()/2 );
	//gl.glRotatef(45, 0, 1, 0);

	// Perspective.
	float widthHeightRatio = getWidth() / getHeight();
	//glu.gluPerspective(60, widthHeightRatio, 200, 1200);
	glu.gluPerspective(60, widthHeightRatio, 50, 2000);
	glu.gluLookAt(xeye, yeye, distance, 0, 0, 0, 0, 1, 0);

	// Change back to model view matrix.
	gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
	gl.glLoadIdentity();

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:Triangulation3DViewer.java

示例4: lookCamera

import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
protected void lookCamera(Graphics3D graphics) {
	AWTGraphics3D g = (AWTGraphics3D) graphics;
	GL2 gl = g.getGL2();
	GLU glu = g.getGLU();
	
	gl.glMatrixMode(GL2.GL_MODELVIEW);
	gl.glLoadIdentity();

	double targetx = 0;
	double targety = 0;
	double targetz = 0;
	
	glu.gluLookAt( camera.position.x, camera.position.y, camera.position.z, targetx, targety, targetz, 0, 1, 0 );
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:15,代码来源:GridMenuApplication.java

示例5: lookCamera

import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
protected void lookCamera(Graphics3D gl) {
	AWTGraphics3D g = (AWTGraphics3D) gl;
	GLU glu = g.getGLU();
	
	gl.glMatrixMode(GL2.GL_MODELVIEW);
	gl.glLoadIdentity();

	double targetx = 0;
	double targety = 0;
	double targetz = 0;
	
	glu.gluLookAt( camera.position.x, camera.position.y, camera.position.z, targetx, targety, targetz, 0, 1, 0 );
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:14,代码来源:MarkerApplication.java

示例6: display

import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
@Override
public void display(GLAutoDrawable arg0) {
    GLU glu = GLU.createGLU(m_kGL);

    g_numGeoPasses = 0;

    m_kGL.glMatrixMode(GL2.GL_MODELVIEW);
    m_kGL.glLoadIdentity();
    glu.gluLookAt(g_pos[0], g_pos[1], g_pos[2], g_pos[0], g_pos[1], 0, 0, 1, 0);
    m_kGL.glRotatef(g_rot[0], 1, 0, 0);
    m_kGL.glRotatef(g_rot[1], 0, 1, 0);
    m_kGL.glTranslatef(g_bbTrans[0], g_bbTrans[1], g_bbTrans[2]);
    m_kGL.glScalef(g_bbScale, g_bbScale, g_bbScale);

    switch (g_mode) {
        case DUAL_PEELING_MODE:
            RenderDualPeeling(m_kGL);
            break;
        case F2B_PEELING_MODE:
            RenderFrontToBackPeeling(m_kGL);
            break;
        case WEIGHTED_AVERAGE_MODE:
            RenderAverageColors(m_kGL);
            break;
        case WEIGHTED_SUM_MODE:
            RenderWeightedSum(m_kGL);
            break;
    }

    /* Call swapBuffers to render on-screen: */
    arg0.swapBuffers();
}
 
开发者ID:java-opengl-labs,项目名称:oit,代码行数:33,代码来源:DualDepthPeeling.java

示例7: renderPreObjects

import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
private void renderPreObjects(GL2 gl, GLU glu) {
	// camera position and look-at point
	glu.gluLookAt(aCam.aPos[0], aCam.aPos[1], aCam.aPos[2], aCam.aLookAt[0], aCam.aLookAt[1], aCam.aLookAt[2],
			aCam.aUp[0], aCam.aUp[1], aCam.aUp[2]);
}
 
开发者ID:trent2,项目名称:bGLOOP,代码行数:6,代码来源:GLRenderer.java

示例8: followAgent

import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
public void followAgent(final IAgent a, final GLU glu) {
	final ILocation l = a.getLocation();
	setPosition(l.getX(), l.getY(), l.getZ());
	glu.gluLookAt(0, 0, (float) (getRenderer().getMaxEnvDim() * 1.5), 0, 0, 0, 0.0f, 0.0f, 1.0f);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:6,代码来源:FreeFlyCamera.java


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