Pro OpenGL ES for iOS
258 CHAPTER 8: Putting It All Together^ First we get the cached quaternion from miniGLU, in line 1, along with the viewpoint’s ...
CHAPTER 8: Putting It All Together (^259) Figure 8-4. The hover mode lets you rotate the arth at will. So, that’s part one of to ...
260 CHAPTER 8: Putting It All Together^ Now is the time to dump any image utilities over into their own routine. I’ve created Op ...
CHAPTER 8: Putting It All Together (^261) other texture. Also, UI elements can be drawn to the GL layer as well using these tech ...
262 CHAPTER 8: Putting It All Together^ glTranslatef(scaledX,scaledY,0); scaledSize=zoomBias*size; glScalef(scaledSize,scaledSiz ...
CHAPTER 8: Putting It All Together (^263) glOrthof() in line 3 is a new routine that changes the projection matrix otherwise s ...
264 CHAPTER 8: Putting It All Together^ And from the lens flare object, ensure that renderFlareAt() is called with the new param ...
CHAPTER 8: Putting It All Together (^265) void gluGetScreenLocation(GLfloat xa,GLfloat ya,GLfloat za,GLfloat sx, GLfloat sy,GLfl ...
266 CHAPTER 8: Putting It All Together^ The multiplication is done via another GLUT helper routine at lines 2ff. First the pro ...
CHAPTER 8: Putting It All Together (^267) glPushMatrix(); glTranslatef(-m_Eyeposition.x,-m_Eyeposition.y,-m_Eyeposition.z); //1 ...
268 CHAPTER 8: Putting It All Together^ float distanceBetweenBodies=sqrt(delX*delX+delY*delY); if((distanceBetweenBodies>vani ...
CHAPTER 8: Putting It All Together (^269) gluGetScreenLocation(planetPos.x,-planetPos.y,planetPos.z,sx,sy,sz); //13 glPopMatrix( ...
270 CHAPTER 8: Putting It All Together^ Then we come down to where the flare is actually rendered starting with lines 8ff. Mos ...
CHAPTER 8: Putting It All Together (^271) Figure 8-6. Look, Ma! Lens flare! Seeing Stars Of course, no solar-system model would ...
272 CHAPTER 8: Putting It All Together^ Note A star’s magnitude is its apparent brightness; the larger the value, the dimmer the ...
CHAPTER 8: Putting It All Together (^273) -(void)execute:(BOOL)constOutlinesOn names:(BOOL)constNamesOn { [m_Outlines execute: c ...
274 CHAPTER 8: Putting It All Together^ if (self) { [self init:@"stars"]; } return self; } -(void)init:(NSString *)filename { NS ...
CHAPTER 8: Putting It All Together (^275) if(mag<.2) mag=.2; else if(mag>1.0) mag=1.0; sd->r=sd->g=sd->b=mag; sd- ...
276 CHAPTER 8: Putting It All Together^ In line 1 of Listing 8-13a, we define a structure for each star. Its position is in re ...
CHAPTER 8: Putting It All Together (^277) Note If you want to draw really big stars, there is a limit to the maximum size that v ...
«
9
10
11
12
13
14
15
16
17
18
»
Free download pdf