本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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 );
}
示例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 );
}
示例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();
}
示例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]);
}
示例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);
}