當前位置: 首頁>>代碼示例>>Java>>正文


Java GL10.glLoadIdentity方法代碼示例

本文整理匯總了Java中javax.microedition.khronos.opengles.GL10.glLoadIdentity方法的典型用法代碼示例。如果您正苦於以下問題:Java GL10.glLoadIdentity方法的具體用法?Java GL10.glLoadIdentity怎麽用?Java GL10.glLoadIdentity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.microedition.khronos.opengles.GL10的用法示例。


在下文中一共展示了GL10.glLoadIdentity方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawFadeVeil

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
private void drawFadeVeil(GL10 gl, float alpha) {
       gl.glMatrixMode(GL10.GL_PROJECTION);
       gl.glPushMatrix();

       // orthographic projection is easier to place a 2D object where I want on the screen...
       gl.glLoadIdentity();
       gl.glOrthof( 0, mWidth, 0, mHeight, -10, 10);

       // Allocate object if not done yet
       if (mFadeVeil==null) {
           mFadeVeil = new FadeOutVeil(mWidth,mHeight);
           mFadeVeil.setPosition(mWidth/2, -mHeight/2, 0f);
       }
       mFadeVeil.draw(gl, alpha);

       gl.glPopMatrix();
       gl.glMatrixMode(GL_MODELVIEW);
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:19,代碼來源:CoverRollLayout.java

示例2: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
    mRenderListener.onSurfaceChanged(gl, width, height);

    mEngine.setUpScene();
    if (mEngine.isCameraActive() && mEngine.getCamera() != null)
        mEngine.getCamera().update(width, height);


    // Sets the current view port to the new size.
    gl.glViewport(0, 0, width, height);
    // Select the projection matrix
    gl.glMatrixMode(GL10.GL_PROJECTION);
    // Reset the projection matrix
    gl.glLoadIdentity();
    // Select the modelview matrix
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    // Reset the modelview matrix

    gl.glOrthof(0, width, height, 0, 0, 1f);
}
 
開發者ID:ondramisar,項目名稱:AdronEngine,代碼行數:22,代碼來源:AdrGlRenderer.java

示例3: onDrawFrame

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onDrawFrame(GL10 gl) {
    gl.glClearColor(1.f, 0.f, 0.f, 1.f);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

    gl.glLoadIdentity();
    gl.glTranslatef(0.f, 0.f, -50.f);

    long time = SystemClock.uptimeMillis() % 4000L;
    float angle = 0.090f * ((int) time);
    gl.glRotatef(angle, 0.f, 0.f, 1.f);

    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glColor4f(1.f, 1.f, 1.f, 1.f);
    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
    gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_SHORT, indexBuffer);

    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
}
 
開發者ID:PacktPublishing,項目名稱:Building-Android-UIs-with-Custom-Views,代碼行數:20,代碼來源:GLDrawerES1.java

示例4: drawTopFadeOutBand

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
private void drawTopFadeOutBand(GL10 gl) {
       gl.glMatrixMode(GL10.GL_PROJECTION);
       gl.glPushMatrix();

       // orthographic projection is easier to place a 2D object where I want on the screen...
       gl.glLoadIdentity();
       gl.glOrthof( 0, mWidth, 0, mHeight, -10, 10);

       // Allocate object if not done yet
       if (mFadeOutBand==null) {
           mFadeOutBand = new FadeOutBand(mWidth,FADEOUTBAND_HEIGHT);
           mFadeOutBand.setPosition(mWidth/2, -(mHeight-FADEOUTBAND_HEIGHT/2), 0f);
       }
       mFadeOutBand.draw(gl);

       gl.glPopMatrix();
       gl.glMatrixMode(GL_MODELVIEW);
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:19,代碼來源:CoverRollLayout.java

示例5: onDrawFrame

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public synchronized void onDrawFrame(GL10 gl) {

	mObserver.onDrawFrame();

	gl.glClearColor(Color.red(mBackgroundColor) / 255f,
			Color.green(mBackgroundColor) / 255f,
			Color.blue(mBackgroundColor) / 255f,
			Color.alpha(mBackgroundColor) / 255f);
	gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
	gl.glLoadIdentity();

	if (USE_PERSPECTIVE_PROJECTION) {
		gl.glTranslatef(0, 0, -6f);
	}

	for (int i = 0; i < mCurlMeshes.size(); ++i) {
		mCurlMeshes.get(i).onDrawFrame(gl);
	}
}
 
開發者ID:ichason,項目名稱:PageCurl,代碼行數:21,代碼來源:CurlRenderer.java

示例6: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
	gl.glViewport(0, 0, width, height);
	mViewportWidth = width;
	mViewportHeight = height;

	float ratio = (float) width / height;
	mViewRect.top = 1.0f;
	mViewRect.bottom = -1.0f;
	mViewRect.left = -ratio;
	mViewRect.right = ratio;
	updatePageRects();

	gl.glMatrixMode(GL10.GL_PROJECTION);
	gl.glLoadIdentity();
	if (USE_PERSPECTIVE_PROJECTION) {
		GLU.gluPerspective(gl, 20f, (float) width / height, .1f, 100f);
	} else {
		GLU.gluOrtho2D(gl, mViewRect.left, mViewRect.right,
				mViewRect.bottom, mViewRect.top);
	}

	gl.glMatrixMode(GL10.GL_MODELVIEW);
	gl.glLoadIdentity();
}
 
開發者ID:ichason,項目名稱:PageCurl,代碼行數:26,代碼來源:CurlRenderer.java

示例7: endGLElements

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
void endGLElements(GL10 gl) {
    vertexListManager.end();

    gl.glEnable(GL10.GL_DITHER);
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();

    gl.glLineWidth(2);

    vertexListManager.render(gl);
}
 
開發者ID:StringMon,項目名稱:homescreenarcade,代碼行數:13,代碼來源:GLFieldView.java

示例8: onSurfaceCreated

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override public void onSurfaceCreated(GL10 gl, EGLConfig config) {
    gl.glClearColor(0.0f, 0.0f, 0.0f, 1);
    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
    gl.glShadeModel(GL10.GL_FLAT);
    gl.glDisable(GL10.GL_DEPTH_TEST);

    // Alpha support.
    gl.glEnable(GL10.GL_BLEND);
    gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);

    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();

    GLU.gluOrtho2D(gl, 0, getWidth(), getHeight(), 0);
}
 
開發者ID:StringMon,項目名稱:homescreenarcade,代碼行數:16,代碼來源:GLFieldView.java

示例9: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
    if (height == 0) height = 1;
    float aspect = (float) width / height;

    gl.glViewport(0, 0, width, height);
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glOrthof(-10.f, 10.f, 10.f / aspect, -10.f / aspect, 0.1f, 100.f);

    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();

}
 
開發者ID:PacktPublishing,項目名稱:Building-Android-UIs-with-Custom-Views,代碼行數:15,代碼來源:GLDrawerES1.java

示例10: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
    public void onSurfaceChanged(GL10 gl, int width, int height) {
Log.d("OGLChart", "onSurfaceChanged : start, chart title is " + this.mstrChartTitle);
        if(height == 0) {                         //Prevent A Divide By Zero By
            height = 1;                         //Making Height Equal One
        }

        mdChartWindowHeight = height;
        mdChartWindowWidth = width;
        
        gl.glViewport(0, 0, width, height);     //Reset The Current Viewport

        gl.glMatrixMode(GL10.GL_PROJECTION);     //Select The Projection Matrix
        gl.glLoadIdentity();                     //Reset The Projection Matrix
        //Calculate The Aspect Ratio Of The Window, tan(28.0725/2) = 0.25
        //GLU.gluPerspective(gl, PROJECT_Y_OVERALL_ANGLE, (float)width / (float)height, PROJECT_Z_NEAR - 1, PROJECT_Z_FAR + 1);
        GLU.gluPerspective(gl, PROJECT_Y_OVERALL_ANGLE, (float)width / (float)height, PROJECT_Z_NEAR, PROJECT_Z_FAR);

		double dFarXLength = PROJECT_Z_FAR * Math.tan(PROJECT_Y_OVERALL_ANGLE * Math.PI / 360) * 2
				* width / height;
		double dFarYLength = PROJECT_Z_FAR * Math.tan(PROJECT_Y_OVERALL_ANGLE * Math.PI / 360) * 2;
        mp3OriginInTO = new Position3D(0, 0, (-PROJECT_Z_NEAR - PROJECT_Z_FAR)/2.0);
        double dFarMinFarXYLen = Math.min(dFarXLength, dFarYLength);
        mdXAxisLenInTO = dFarMinFarXYLen * 3/4;    //* 5 / 9;
        mdYAxisLenInTO = dFarMinFarXYLen * 3/4;    //* 5 / 9;;
        mdZAxisLenInTO = dFarMinFarXYLen * 3/4;    //* 5 / 9;;
		
        setMapperFROM2TO();
		update();
Log.d("OGLChart", "onSurfaceChanged : end");
    }
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:32,代碼來源:OGLChart.java

示例11: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
public void onSurfaceChanged(GL10 gl, int width, int height) {
    gl.glViewport(0, 0, width, height);

    /*
     * Set our projection matrix. This doesn't have to be done
     * each time we draw, but usually a new projection needs to
     * be set when the viewport is resized.
     */

    float ratio = (float) width / height;
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:15,代碼來源:CompassActivity.java

示例12: onDrawFrame

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onDrawFrame(GL10 gl) {

    // Draw 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, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);

    // Draw square
    mSquare.draw(gl);

    // Create a rotation for the triangle

    // Use the following code to generate constant rotation.
    // Leave this code out when using TouchEvents.
    // long time = SystemClock.uptimeMillis() % 4000L;
    // float angle = 0.090f * ((int) time);

    gl.glRotatef(mAngle, 0.0f, 0.0f, 1.0f);

    // Draw triangle
    mTriangle.draw(gl);
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:29,代碼來源:MyGLRenderer.java

示例13: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
    // Adjust the viewport based on geometry changes
    // such as screen rotations
    gl.glViewport(0, 0, width, height);

    // make adjustments for screen ratio
    float ratio = (float) width / height;
    gl.glMatrixMode(GL10.GL_PROJECTION);        // set matrix to projection mode
    gl.glLoadIdentity();                        // reset the matrix to its default state
    gl.glFrustumf(-ratio, ratio, -1, 1, 3, 7);  // apply the projection matrix
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:13,代碼來源:MyGLRenderer.java

示例14: onDrawFrame

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
@Override
        public void onDrawFrame(GL10 gl) {
//            gl.glClearColor(1.0f, 1.0f, 0.0f, 1.0f);
//            Log.d(TAG,"5->" + System.currentTimeMillis());
            gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
            gl.glTranslatef(0, 0, -4);
            gl.glLoadIdentity();
            mGraph.draw(gl);
        }
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:10,代碼來源:OpenGLActivity.java

示例15: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //導入方法依賴的package包/類
/**
 * Update view-port with the new surface
 * 
 * @param gl the surface
 * @param width new width
 * @param height new height
 */
public void onSurfaceChanged(GL10 gl, int width, int height) {
    // set view-port
    gl.glViewport(0, 0, width, height);
    // set projection matrix
    float ratio = (float) width / height;
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);
}
 
開發者ID:peter10110,項目名稱:Android-SteamVR-controller,代碼行數:17,代碼來源:CubeRenderer.java


注:本文中的javax.microedition.khronos.opengles.GL10.glLoadIdentity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。