CHAPTER 7: Well-Rendered Miscellany (^241)
-(void)viewWillAppear:(BOOL)animated;
-(void)viewWillDisappear:(BOOL)animated;
@end
After it’s compiled, do you see something like Figure 7-13 (the final image is left to you,
dear reader, to generate).
Figure 7-13. The left and middle images are from the side; the rightmost image is looking down from above.
And as with our other exercises, tweaking is mandatory.
It’s one thing to see the nice dark shadow, but it’s another thing to actually see how the
shadow is composed. Go to drawShadow() and replace the calls to glDrawElements()
with the following:
glLineWidth(3.0);
glDrawElements( GL_LINES, 6 3, GL_UNSIGNED_BYTE, m_Tfan1);
glDrawElements( GL_LINES, 6 3, GL_UNSIGNED_BYTE, m_Tfan2);
glLineWidth(3.0) is a new call, and when lines are drawn, this specifies how wide they
should be, with 1.0 being the default. Figure 7-14 now shows the flattened image in
wireframe mode.
v
singke
(singke)
#1