Pro OpenGL ES for iOS
CHAPTER 3: Building a 3D World (^77) Figure 3-15. The back faces are now visible, while the front ones are culled. Building a So ...
78 CHAPTER 3: Building a 3D World^ The first thing to do is create a new project derived from the bouncy square example. But ins ...
CHAPTER 3: Building a 3D World (^79) //Vertices GLfloat vPtr = m_VertexData = (GLfloat)malloc(sizeof(GLfloat) 3 ((m_Slices2+2) ...
80 CHAPTER 3: Building a 3D World^ //Get x-y-z for the first vertex of stack. vPtr [0] = m_Scale*cosPhi0 * cosTheta; //10 vPtr [ ...
CHAPTER 3: Building a 3D World (^81) The first and last stacks contain the two poles, in which case they are more of a triangl ...
82 CHAPTER 3: Building a 3D World^ Lines 3 and 4 allocate the memory for both the vertices and the colors. Later other arrays ...
CHAPTER 3: Building a 3D World (^83) Figure 3-17. A triangle strip of six vertices In line 11, the color array is generated, a ...
84 CHAPTER 3: Building a 3D World^ You should now recognize many of the elements from the cube examples. First, in line 1, tel ...
CHAPTER 3: Building a 3D World (^85) Listing 3-9 shows the master execute method. As with the cube, we translate the earth on th ...
86 CHAPTER 3: Building a 3D World^ Listing 3-11. The new drawInRect for the Solar System (void)glkView:(GLKView *)view drawInRe ...
CHAPTER 3: Building a 3D World (^87) As with the previous examples, let’s play around with some of the parameters and see what h ...
88 CHAPTER 3: Building a 3D World^ If you want to look at the actual wireframe structure of the sphere, in Planet.m, change GL_T ...
CHAPTER 3: Building a 3D World (^89) Figure 3-21. Someone is setting the zNear clipping plane too close. And one final exercise: ...
90 CHAPTER 3: Building a 3D World^ Figure 3-22. What does it take to get this? And lastly, for extra credit, make it bounce like ...
Chapter 4 Turning On the Lights You must be strong now. You must never give up. And when people [or code] make you cry and you a ...
92 CHAPTER 4: Turning On the Lights^ to fully understand how to take colored pigments suspended in oil and to apply them on a ca ...
CHAPTER 4: Turning On the Lights (^93) Note Young was a particularly colorful fellow. (Someone had to say it.) Not only was he t ...
94 CHAPTER 4: Turning On the Lights^ Figure 4-2. O S X ’ s s t a n d a r d c o l o r p i c k e r s -----RGB, CMYK, HSV, and the ...
CHAPTER 4: Turning On the Lights (^95) Diffuse light can be said to come from one direction such as the sun or a flashlight. It ...
96 CHAPTER 4: Turning On the Lights^ Note OpenGL ES has a number of utility functions, with glGet*() being one of the most commo ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf