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


Java GLES11.glMatrixMode方法代码示例

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


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

示例1: performPresent

import android.opengl.GLES11; //导入方法依赖的package包/类
public void performPresent(float deltaTime) {
       GLES11.glPointSize(2.0f);                
    GLES11.glBlendFunc(GLES11.GL_SRC_ALPHA, GLES11.GL_ONE_MINUS_SRC_ALPHA);
       GLES11.glDisable(GLES11.GL_BLEND);

   	GLES11.glDisable(GLES11.GL_LIGHTING);
	GLES11.glMatrixMode(GLES11.GL_TEXTURE);
   	GLES11.glTranslatef(0.0007f, -0.015f, 0.0f);
   	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(cylinder.getMatrix(), 0);
	GLES11.glColor4f(red, green, blue, 1.0f);		
	cylinder.render();
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glPopMatrix();
	GLES11.glPointSize(1.0f);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:18,代码来源:HyperspaceRenderer.java

示例2: performPresent

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void performPresent(float deltaTime) {
	inGame.render(deltaTime, allObjects);
	if (!allObjects.isEmpty()) {
		GLES11.glMatrixMode(GLES11.GL_PROJECTION);
		GLES11.glPushMatrix();		
		GLES11.glLoadIdentity();
		Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
		GlUtils.ortho(game, visibleArea);
		GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
		GLES11.glLoadIdentity();
		GLES11.glColor4f(0.937f, 0.396f, 0.0f, 1.0f);
		GLES11.glMatrixMode(GLES11.GL_PROJECTION);
		GLES11.glPopMatrix();
		GLES11.glMatrixMode(GLES11.GL_MODELVIEW);			
	}
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:18,代码来源:ControlledShipIntroScreen.java

示例3: initializeGl

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initializeGl() {
	float ratio = (float) windowWidth / (float) windowHeight;	     
       GLES11.glMatrixMode(GLES11.GL_PROJECTION);
       GlUtils.setViewport(visibleArea);
       GLES11.glLoadIdentity();
       GlUtils.gluPerspective(game, 45.0f, ratio, 10.0f, 1000.0f);
       GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
       GLES11.glLoadIdentity();        
       GLES11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
       GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT | GLES11.GL_DEPTH_BUFFER_BIT);
       GLES11.glHint(GLES11.GL_PERSPECTIVE_CORRECTION_HINT, GLES11.GL_NICEST);		        
       GLES11.glEnable(GLES11.GL_DEPTH_TEST);
       GLES11.glDepthFunc(GLES11.GL_LEQUAL);
	GLES11.glEnable(GLES11.GL_BLEND);
	GLES11.glBlendFunc(GLES11.GL_ONE, GLES11.GL_ONE);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:17,代码来源:AboutScreen.java

示例4: 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

示例5: renderHud

import android.opengl.GLES11; //导入方法依赖的package包/类
private void renderHud() {
	if (hud == null) {
		return;
	}
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glPushMatrix();		
	GLES11.glLoadIdentity();
	Rect visibleArea = ((AndroidGraphics) alite.getGraphics()).getVisibleArea();
	GlUtils.ortho(alite, visibleArea);		
	
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();
	if (playerControl) {
		alite.getCobra().setRotation(deltaYawRollPitch.z, deltaYawRollPitch.y);
	}
	alite.getCobra().setSpeed(ship.getSpeed());
	hud.render();	
	hud.clear();
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:20,代码来源:InGameManager.java

示例6: renderScroller

import android.opengl.GLES11; //导入方法依赖的package包/类
public void renderScroller(final float deltaTime) {
	GLES11.glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
	GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT);
GLES11.glMatrixMode(GLES11.GL_PROJECTION);
GLES11.glPushMatrix();		
GLES11.glLoadIdentity();
Rect visibleArea = ((AndroidGraphics) alite.getGraphics()).getVisibleArea();
GlUtils.ortho(alite, visibleArea);		

GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
GLES11.glLoadIdentity();
GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
message.render(alite);
if (scrollingText != null) {
	scrollingText.render(deltaTime);
}
GLES11.glMatrixMode(GLES11.GL_PROJECTION);
GLES11.glPopMatrix();
GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:21,代码来源:InGameManager.java

示例7: performHyperspaceJump

import android.opengl.GLES11; //导入方法依赖的package包/类
public boolean performHyperspaceJump() {		
	InGameManager.safeZoneViolated = false;
	if (player.getActiveMissions().size() == 0) {
		player.increaseJumpCounter();
	}
	boolean willEnterWitchSpace = player.getRating().ordinal() > Rating.POOR.ordinal() && Math.random() <= 0.02;
	for (Mission mission: player.getActiveMissions()) {
		willEnterWitchSpace |= mission.willEnterWitchSpace();
	}
	if (player.getCobra().getPitch() <= -2.0f && player.getCobra().getRoll() <= -2.0f) {
		willEnterWitchSpace = true;
	}
	int distance = player.getCurrentSystem() == null ? computeDistance(player.getPosition(), player.getHyperspaceSystem()) : 
			player.getCurrentSystem().computeDistance(player.getHyperspaceSystem());
	if (willEnterWitchSpace) {
		distance >>= 1;
		int x = player.getCurrentSystem() == null ? player.getPosition().x : player.getCurrentSystem().getX();
		int y = player.getCurrentSystem() == null ? player.getPosition().y : player.getCurrentSystem().getY();
	    int dx = player.getHyperspaceSystem().getX() - x;
	    int dy = player.getHyperspaceSystem().getY() - y;
	    int nx = x + (dx >> 1);
	    int ny = y + (dy >> 1);
	    player.setPosition(nx, ny);
	    player.setCurrentSystem(null);
	} else {
		player.setCurrentSystem(player.getHyperspaceSystem());
	}
	player.getCobra().setFuel(player.getCobra().getFuel() - distance);
	FlightScreen fs = new FlightScreen(this, false);
	if (willEnterWitchSpace) {
		fs.enterWitchSpace();
	}
	setScreen(fs);	
   	GLES11.glMatrixMode(GLES11.GL_TEXTURE);
   	GLES11.glLoadIdentity();
	navigationBar.setActiveIndex(2);
	player.setLegalValue(player.getLegalValue() >> 1);
	return true;
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:40,代码来源:Alite.java

示例8: performPresent

import android.opengl.GLES11; //导入方法依赖的package包/类
@Override
public void performPresent(float deltaTime) {
	if (isDisposed) {
		return;
	}
	GLES11.glDisable(GLES11.GL_CULL_FACE);
       GLES11.glClear(GLES11.GL_COLOR_BUFFER_BIT | GLES11.GL_DEPTH_BUFFER_BIT);
       
       counter += 0.72f;
       if (counter > 360) {
       	counter = 0;
       }
       switch (increase) {
       	case 0: red += 0.002f; if (red > 1.0f) red = 1.0f; break;
       	case 1: green += 0.002f; if (green > 1.0f) green = 1.0f; break;
       	case 2: blue += 0.002f; if (blue > 1.0f) blue = 1.0f; break;
       }
       GLES11.glLoadIdentity();
       lookAt(-3.5f, 0, 0,
       	   -3.5f, 1.0f, 0,
       	   (float) Math.sin(Math.toRadians(counter)), 0.0f, (float) Math.cos(Math.toRadians(counter)));
       
       GLES11.glRotatef(counter * 2, 0.0f, 0.0f, 1.0f);
   	GLES11.glVertexPointer(3, GLES11.GL_FLOAT, 0, vertexBuffer);
   	GLES11.glTexCoordPointer(2, GLES11.GL_FLOAT, 0, textureBuffer); 
   	
   	GLES11.glMatrixMode(GLES11.GL_TEXTURE);
   	GLES11.glTranslatef(0.0f, -0.015f, 0.0f);
   	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);

   	GLES11.glColor4f(red, green, blue, 1.0f);
   	GLES11.glDrawArrays(GLES11.GL_TRIANGLE_STRIP, 0, totalIndices);
   	GLES11.glEnable(GLES11.GL_CULL_FACE);
   	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:36,代码来源:AutomaticLaunchScreen.java

示例9: displayShip

import android.opengl.GLES11; //导入方法依赖的package包/类
public void displayShip() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);				
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);		
	GLES11.glLoadIdentity();
	
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);

	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(currentShip.getMatrix(), 0);
	currentShip.render();		
	GLES11.glPopMatrix();
	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	setUpForDisplay(visibleArea);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:29,代码来源:ShipEditorScreen.java

示例10: displayShip

import android.opengl.GLES11; //导入方法依赖的package包/类
public void displayShip() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);				
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 1.0f, 100000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);		
	GLES11.glLoadIdentity();
	
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);

	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(constrictor.getMatrix(), 0);
	constrictor.render();
	GLES11.glPopMatrix();
	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	setUpForDisplay(visibleArea);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:29,代码来源:ConstrictorScreen.java

示例11: displayShip

import android.opengl.GLES11; //导入方法依赖的package包/类
public void displayShip() {
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);				
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 1.0f, 100000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);		
	GLES11.glLoadIdentity();
	
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);

	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(cougar.getMatrix(), 0);
	cougar.render();
	GLES11.glPopMatrix();
	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	setUpForDisplay(visibleArea);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:29,代码来源:CougarScreen.java

示例12: setUpForDisplay

import android.opengl.GLES11; //导入方法依赖的package包/类
protected final void setUpForDisplay(Rect visibleArea) {		
	GLES11.glDisable(GLES11.GL_CULL_FACE);
	GLES11.glDisable(GLES11.GL_LIGHTING);
	GLES11.glBindTexture(GLES11.GL_TEXTURE_2D, 0);
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);

	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.ortho(game, visibleArea);

	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);	
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:16,代码来源:AliteScreen.java

示例13: initDisplay

import android.opengl.GLES11; //导入方法依赖的package包/类
private void initDisplay(final Rect visibleArea) {
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 1.0f, 900000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
	GLES11.glLoadIdentity();

	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glPushMatrix();
	  GLES11.glMultMatrixf(skysphere.getMatrix(), 0);
      skysphere.render();
	GLES11.glPopMatrix();

	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);
	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);

	GLES11.glDisable(GLES11.GL_BLEND);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:30,代码来源:ShipIntroScreen.java

示例14: afterDisplay

import android.opengl.GLES11; //导入方法依赖的package包/类
public void afterDisplay() {		
	Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
	float aspectRatio = (float) visibleArea.width() / (float) visibleArea.height();
	GLES11.glEnable(GLES11.GL_TEXTURE_2D);
	GLES11.glEnable(GLES11.GL_CULL_FACE);				
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glLoadIdentity();
	GlUtils.gluPerspective(game, 45.0f, aspectRatio, 20000.0f, 1000000.0f);
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);		
	GLES11.glLoadIdentity();
	
	GLES11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GLES11.glEnableClientState(GLES11.GL_NORMAL_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_VERTEX_ARRAY);
	GLES11.glEnableClientState(GLES11.GL_TEXTURE_COORD_ARRAY);

	GLES11.glEnable(GLES11.GL_DEPTH_TEST);
	GLES11.glDepthFunc(GLES11.GL_LESS);
	GLES11.glClear(GLES11.GL_DEPTH_BUFFER_BIT);
	GLES11.glPushMatrix();
	GLES11.glMultMatrixf(planet.getMatrix(), 0);
	planet.render();
	GLES11.glPopMatrix();
	
	GLES11.glDisable(GLES11.GL_DEPTH_TEST);		
	GLES11.glDisable(GLES11.GL_TEXTURE_2D);
	setUpForDisplay(visibleArea);
	
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:30,代码来源:PlanetScreen.java

示例15: renderButtons

import android.opengl.GLES11; //导入方法依赖的package包/类
private void renderButtons() {
	if (hud == null) {
		return;
	}
	buttons.render();
	
	GLES11.glMatrixMode(GLES11.GL_PROJECTION);
	GLES11.glPopMatrix();
	GLES11.glMatrixMode(GLES11.GL_MODELVIEW);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:11,代码来源:InGameManager.java


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