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


Java GLES11.glLightfv方法代码示例

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


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

示例1: init

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
protected void init() {
    GLES11.glLightfv(GLES11.GL_LIGHT3, GLES11.GL_AMBIENT, lightAmbient, 0);
    GLES11.glLightfv(GLES11.GL_LIGHT3, GLES11.GL_DIFFUSE, lightAmbient, 0);
    GLES11.glLightfv(GLES11.GL_LIGHT3, GLES11.GL_SPECULAR, lightSpecular, 0);
    GLES11.glLightfv(GLES11.GL_LIGHT3, GLES11.GL_POSITION, lightPosition, 0);
    
    GLES11.glLightf(GLES11.GL_LIGHT3, GLES11.GL_SPOT_CUTOFF, 35.0f);
    GLES11.glLightf(GLES11.GL_LIGHT3, GLES11.GL_SPOT_EXPONENT, 100.0f);
    vertexBuffer = createFaces(VERTEX_DATA, NORMAL_DATA,
            1,   0,   8,   2,   0,   1,   3,   1,   9,   4,   2,   1,   4,   1,   3, 
            4,   7,   6,   5,   0,   2,   5,   2,   6,   6,   2,   4,   7,   5,   6, 
            8,   0,  11,   8,  11,   5,   8,   5,   7,   8,   7,   4,   8,   4,   3, 
            8,   3,  10,   9,   1,   8,   9,   8,  10,   9,  10,   3,  11,   0,   5);
    texCoordBuffer = GlUtils.toFloatBufferPositionZero(TEXTURE_COORDINATE_DATA);
    alite.getTextureManager().addTexture(textureFilename);    
    if (Settings.engineExhaust) {
    	addExhaust(new EngineExhaust(this, 13, 13, 300, -50, 0, 0));
    	addExhaust(new EngineExhaust(this, 13, 13, 300,  50, 0, 0));
    	addExhaust(new EngineExhaust(this,  5,  5, 180, -115, 0, 0, 1.0f, 0.5f, 0.0f, 0.7f));
    	addExhaust(new EngineExhaust(this,  5,  5, 180,  115, 0, 0, 1.0f, 0.5f, 0.0f, 0.7f));
    }
    initTargetBox();
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:25,代码来源:CobraMkIII.java

示例2: performViewTransformation

import android.opengl.GLES11; //导入方法依赖的package包/类
private void performViewTransformation(float deltaTime) {
	// Kudos to Quelo!! 
	// Thanks for getting me started on OpenGL -- from simply
	// looking at this method, one cannot immediately grasp the
	// complexities of the ideas behind it. 
	// And without Quelo, I certainly would not have understood!
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();		
	
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0); 
	
	if (!paused) {
		ship.applyDeltaRotation((float) Math.toDegrees(deltaYawRollPitch.z * deltaTime),
								(float) Math.toDegrees(deltaYawRollPitch.x * deltaTime),
								(float) Math.toDegrees(deltaYawRollPitch.y * deltaTime));
	}

	ship.orthoNormalize();		
	Matrix.invertM(viewMatrix, 0, ship.getMatrix(), 0);
	GLES11.glLoadMatrixf(viewMatrix, 0);		
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:22,代码来源:InGameManager.java

示例3: initGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initGl() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	int windowWidth = visibleArea.width();
	int windowHeight = visibleArea.height();

	float ratio = (float) windowWidth / (float) windowHeight;
	GlUtils.setViewport(visibleArea);
	GLES11.glDisable(GLES11.GL_FOG);
	GLES11.glPointSize(1.0f);
       GLES11.glLineWidth(1.0f);

       GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
       GLES11.glDisable(GLES11.GL_BLEND);
       
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	GLES11.glShadeModel(GLES11.GL_SMOOTH);
	
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT1);

	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT2);

	GLES11.glEnable(GLES11.GL_LIGHTING);
	
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
	GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);
	GLES11.glHint(GLES11.GL_POLYGON_SMOOTH_HINT, GLES11.GL_NICEST);
	GLES11.glEnable(GLES11.GL_CULL_FACE);	
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:43,代码来源:ShipEditorScreen.java

示例4: initGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initGl() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	int windowWidth = visibleArea.width();
	int windowHeight = visibleArea.height();

	float ratio = (float) windowWidth / (float) windowHeight;
	GlUtils.setViewport(visibleArea);
	GLES11.glDisable(GLES11.GL_FOG);
	GLES11.glPointSize(1.0f);
   GLES11.glLineWidth(1.0f);

   GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
   GLES11.glDisable(GLES11.GL_BLEND);

	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	GLES11.glShadeModel(GLES11.GL_SMOOTH);

	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT1);

	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT2);

	GLES11.glEnable(GLES11.GL_LIGHTING);

	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
	GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);
	GLES11.glHint(GLES11.GL_POLYGON_SMOOTH_HINT, GLES11.GL_NICEST);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:43,代码来源:ShipIntroScreen.java

示例5: initGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initGl() {		
		Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
		int windowWidth = visibleArea.width();
		int windowHeight = visibleArea.height();

		float ratio = (float) windowWidth / (float) windowHeight;
		GlUtils.setViewport(visibleArea);
		GLES11.glDisable(GLES11.GL_FOG);
		GLES11.glPointSize(1.0f);
        GLES11.glLineWidth(1.0f);

        GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
        GLES11.glDisable(GLES11.GL_BLEND);
        
		GLES11.glMatrixMode(GLES11.GL_PROJECTION);
		GLES11.glLoadIdentity();
		GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
		GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
		GLES11.glLoadIdentity();

		GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
		GLES11.glShadeModel(GLES11.GL_SMOOTH);
		
		GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
		GLES11.glEnable(GLES11.GL_LIGHT1);

		GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
		GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
		GLES11.glEnable(GLES11.GL_LIGHT2);

		GLES11.glEnable(GLES11.GL_LIGHTING);
		

		GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
		GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);
		GLES11.glHint(GLES11.GL_POLYGON_SMOOTH_HINT, GLES11.GL_NICEST);
//		GLES11.glEnable(GLES11.GL_TEXTURE_2D);
		GLES11.glEnable(GLES11.GL_CULL_FACE);	
		
	}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:46,代码来源:PlanetScreen.java

示例6: initializeGl

import android.opengl.GLES11; //导入方法依赖的package包/类
public void initializeGl(final Rect visibleArea) {		
	float ratio = (float) windowWidth / (float) windowHeight;
	GlUtils.setViewport(visibleArea);
	GLES11.glDisable(GLES11.GL_FOG);
	GLES11.glPointSize(1.0f);
       GLES11.glLineWidth(1.0f);

       GLES11.glTexEnvf(GLES11.GL_TEXTURE_ENV, GLES11.GL_TEXTURE_ENV_MODE, GLES11.GL_MODULATE);
       
    GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE_MINUS_SRC_ALPHA);
       GLES11.glDisable(GLES11.GL_BLEND);
       
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	GLES11.glShadeModel(GLES11.GL_SMOOTH);
	
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT1);

	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT2);

	GLES11.glEnable(GLES11.GL_LIGHTING);
	
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
	GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);
	GLES11.glHint(GLES11.GL_POLYGON_SMOOTH_HINT, GLES11.GL_NICEST);
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);			
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:42,代码来源:FlightScreen.java

示例7: initializeGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initializeGl(final Rect visibleArea) {
	AliteLog.d("Ship Intro Screen", "Initialize GL. glError: " + GLES11.glGetError());
	
	float ratio = (float) windowWidth / (float) windowHeight;
	GlUtils.setViewport(visibleArea);
	GLES11.glDisable(GLES11.GL_FOG);
	GLES11.glPointSize(1.0f);
       GLES11.glLineWidth(1.0f);

       AliteLog.d("Ship Intro Screen", "Initialize GL lineWidth. glError: " + GLES11.glGetError());
       GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE_MINUS_SRC_ALPHA);
       GLES11.glDisable(GLES11.GL_BLEND);
       AliteLog.d("SIS", "Blending: " + GLES11.glGetError());
       
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, ratio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();
	AliteLog.d("SIS", "Matrix Setup: " + GLES11.glGetError());
	
	GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	GLES11.glShadeModel(GLES11.GL_SMOOTH);
	AliteLog.d("SIS", "Clear Color & Shading Model: " + GLES11.glGetError());
	
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_AMBIENT, lightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_DIFFUSE, lightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_SPECULAR, lightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT1, GLES11.GL_POSITION, lightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT1);
	AliteLog.d("SIS", "Defined Light 1: " + GLES11.glGetError());

	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_AMBIENT, sunLightAmbient, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_DIFFUSE, sunLightDiffuse, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_SPECULAR, sunLightSpecular, 0);
	GLES11.glLightfv(GLES11.GL_LIGHT2, GLES11.GL_POSITION, sunLightPosition, 0);
	GLES11.glEnable(GLES11.GL_LIGHT2);
	AliteLog.d("SIS", "Defined Light 2: " + GLES11.glGetError());
	
	GLES11.glEnable(GLES11.GL_LIGHTING);
	AliteLog.d("SIS", "After Enable Lighting: " + GLES11.glGetError());
	
    AliteLog.d("SIS", "After Lighting: " + GLES11.glGetError());
    
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	
	
	AliteLog.d("SIS", "End of Init: " + GLES11.glGetError());
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:52,代码来源:ControlledShipIntroScreen.java


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