GLU gluLookAt - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GLU gluLookAt method.

This code example shows how to use the following methods:gluLookAt, gluPerspective, glLoadIdentity, glMatrixMode
	public Vector3 getLookAt() { 
		return lookAt;
	} 
	 
	public void setMatrices(GL10 gl) {
		gl.glMatrixMode(GL10.GL_PROJECTION);
		gl.glLoadIdentity();
		GLU.gluPerspective(gl, fieldOfView, aspectRatio, near, far);
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
		GLU.gluLookAt(gl, position.x, position.y, position.z, lookAt.x, lookAt.y, lookAt.z, up.x, up.y, up.z);
	} 
	 
	public void setMatrices(GL10 gl, float fov) {
		this.fieldOfView = fov;
		this.setMatrices(gl);
	} 
} 
6
CodeRank
This code example shows how to use the following methods:gluLookAt, glClear, glDisable, glLoadIdentity, glMatrixMode
			 
	} 
	 
	public void onDrawFrame(GL10 gl) {
		// TODO Auto-generated method stub 
		gl.glDisable(GL10.GL_DITHER);
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
		 
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
		GLU.gluLookAt(gl, 0, 0, -5, 0, 0, 0, 0, 2, 0);
 
		long time = SystemClock.uptimeMillis() % 4000L;
		float angle = .090f * ((int)time);
		gl.glRotatef(angle, 0, 0, 1);
		 
		tri.draw(gl);
	} 
 
	public void onSurfaceChanged(GL10 gl, int width, int height) {

6
CodeRank
This code example shows how to use the following methods:gluLookAt, gluPerspective, glClearColor, glLoadIdentity, glMatrixMode
	   coordsBuff = makeFloatBuffer(coords);
	  } 
 
	  @Override 
	  public void onSurfaceChanged(GL10 gl, int width, int height) {
	   gl.glViewport(0, 0, width, height);
	   gl.glMatrixMode(GL10.GL_PROJECTION);
	   gl.glLoadIdentity();
	   GLU.gluPerspective(gl, 45.0f, (float)width/(float)height, 1f, 100f);
	   GLU.gluLookAt(gl, 0, 0, 3, 0, 0, 0, 0, 1, 0);
	    
	   //背面塗り潰し色の指定 
	   gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);//黒
	  } 
 
	  @Override 
	  public void onDrawFrame(GL10 gl) {
	   calendar = Calendar.getInstance();
	   second = calendar.get(Calendar.SECOND);
	    
6
CodeRank
This code example shows how to use the following methods:gluLookAt, glClear, glLoadIdentity, glMatrixMode, glRotatef
	//	cube = new GLCube(); 
	} 
 
	public void onDrawFrame(GL10 gl) {
		// TODO Auto-generated method stub 
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
		 
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
		GLU.gluLookAt(gl, 0, 0, -5f, 0, 0, 0, 0, 2f, 0);
		 
		 
		long time = SystemClock.uptimeMillis() % 4000L;
		float angle = .090f * ((int)time);
		 
		gl.glRotatef(angle, 1, 0, 0);
		gl.glRotatef(angle, 0, 1, 0);
		 
	//	cube.draw(gl); 
		 

6
CodeRank
This code example shows how to use the following methods:gluLookAt, glFrustumf, glLoadIdentity, glMatrixMode, glViewport
 
		@Override 
		public void onSurfaceChanged(GL10 gl, int width, int height) {
			// TODO Auto-generated method stub 
			// ����OpenGL������СΪ��Ļ��С 
			gl.glViewport(0, 0, width, height);
			// ���õ�ǰ����ΪͶӰ���� 
			gl.glMatrixMode(GL10.GL_PROJECTION);
			// ���õ�ǰ���� 
			gl.glLoadIdentity();
			// �����ӿڴ�С 
			gl.glFrustumf(-(float) width / height, (float) width / height, -1,
					1, 1, 10); 
			// ���ù۲��� 
			GLU.gluLookAt(gl, 0, 0, 2.8f, 0, 0, 0, 0, 1, 0);
			// ���õ�ǰ����Ϊģ�͹۲����� 
			gl.glMatrixMode(GL10.GL_MODELVIEW);
			// ����ģ�͹۲����� 
			gl.glLoadIdentity();
   

6
CodeRank
This code example shows how to use the following methods:gluLookAt, gluPerspective, glLoadIdentity, glMatrixMode
	private float _cameraPosZ = 9.82f;
	private void setTablePersp(GL10 gl) {
		_cameraPosY += touchDeltaY * 0.001f;
		_cameraPosZ += touchDeltaX * 0.001f;
		 
		gl.glMatrixMode(GL10.GL_PROJECTION);
		gl.glLoadIdentity();
		GLU.gluPerspective(gl, 45.0f, _aspect, 0.1f, 100.0f);
		//gl.glFrustumf(-_aspect, _aspect, -1, 1, 0.1f, 100.0f);  // apply the projection matrix 
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
		 
		// When using GL_MODELVIEW, you must set the camera view 
		GLU.gluLookAt(gl, 0, _cameraPosY, _cameraPosZ,
		//GLU.gluLookAt(gl, 0, 75.3f, 9.82f, 
						  0, 0, 0, 
						  0, 1, 0); 
	} 
	 
//	private float _cameraPosY = 12.09f; 
6
CodeRank
This code example shows how to use the following methods:gluLookAt, glClear, glLoadIdentity, glMatrixMode, glRotatef
	 
	float xrot = 0.0f;
	float yrot = 0.0f;
	 
	public void onDrawFrame(GL10 gl) {		
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
	 
		setupCube(gl);
		 
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
		GLU.gluLookAt(gl, 0, 0, 3, 0, 0, 0, 0, 1, 0);
	 
		gl.glRotatef(xrot, 1, 0, 0);
		gl.glRotatef(yrot, 0, 1, 0);
	 
		drawCube(gl);
		 
		xrot += 1.0f;
		yrot += 0.5f;

6
CodeRank
This code example shows how to use the following methods:gluLookAt, glClear, glColor4f, glDrawArrays, glLoadIdentity
	// called for each redraw of the GLSurfaceView 
	@Override 
    public void onDrawFrame(GL10 gl) {
		 
        // Redraw background color 
        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
         
        // Set GL_MODELVIEW transformation mode 
        gl.glMatrixMode(GL10.GL_MODELVIEW);
        gl.glLoadIdentity();   // reset the matrix to its default state
         
        // When using GL_MODELVIEW, you must set the view point 
        GLU.gluLookAt(gl, 0, 0, -5, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
         
        // Use the mAngle member as the rotation value 
        gl.glRotatef(mAngle, 0.0f, 0.0f, 1.0f);
        /* 
        // Create a rotation for the triangle 
        long time = SystemClock.uptimeMillis() % 4000L; 
        float angle = 0.090f * ((int) time); 

6
CodeRank
This code example shows how to use the following methods:gluLookAt, glFrustumf, glLoadIdentity, glMatrixMode, glViewport
		gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 16, 4);
		gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 20, 4);
	} 
 
	public void onSurfaceChanged(GL10 gl, int width, int height) {
		gl.glViewport(0, 0, width, height);
 
		float ratio = (float) width / height;
		gl.glMatrixMode(GL10.GL_PROJECTION);
		gl.glLoadIdentity();
		gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);
 
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
		GLU.gluLookAt(gl, 0, 0, 4.2f, 0, 0, 0, 0, 1, 0);
	} 
 
	public void onSurfaceCreated(GL10 gl, EGLConfig config) {
		gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
 
6
CodeRank
This code example shows how to use the following methods:gluLookAt, glClear
 
    //描画のために毎フレーム呼び出される 
    public void onDrawFrame(GL10 gl)
    { 
    	//描画用バッファをクリア 
    	gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
 
    	//カメラ位置をセット 
    	GLU.gluLookAt(
    			gl, 0.0f, 0.0f, 200.0f,
    			0.0f, 0.0f, 0.0f, 
    			0.0f, 1.0f, 0.0f); 
 
    	//ポリゴンの描画メソッドを呼ぶ 
    	PolygonDrawer.drawBoard(gl, 0.0f, 0.0f, 128, 128, 255, 0, 0, 255);
    	PolygonDrawer.drawBoard(gl, -60.0f, -120.0f, 64, 64, 0, 0, 255, 255);
    } 
 
    //サーフェイスのサイズ変更時に呼び出される 
    public void onSurfaceChanged(GL10 gl, int width, int height)
    { 
6
CodeRank

Related GLU gluLookAt Questions & Answers:

gluLookAt Method Overview
Define a viewing transformation in terms of an eye point, a center of view, and an up vector.
See Code Examples for other Android GLU Methods: