| 
 | Generated by UTF-8 version of diff2html.pl © Yves Bailly, MandrakeSoft S.A. 2001, Ryohei Morita 2007 diff2html.pl is licensed under the GNU GPL. | 
| ../08-01/08-01-Rendering.c | 08-02-Rendering.c | |||
|---|---|---|---|---|
| 39 lines 1158 bytes Last modified : Fri Nov 9 08:18:49 2012 | 42 lines 1223 bytes Last modified : Mon Nov 12 04:34:31 2012 | |||
| 1 | // Keisanki Joron 2 (Introduction to Computing II) | 1 | // Keisanki Joron 2 (Introduction to Computing II) | |
| 2 | // Dept. of Engineering Systems, University of Tsukuba | 2 | // Dept. of Engineering Systems, University of Tsukuba | |
| 3 | // [UTF-8 / Unix] | 3 | // [UTF-8 / Unix] | |
| 4 | // 計算機序論2・実習 (筑波大学工学システム学類) | 4 | // 計算機序論2・実習 (筑波大学工学システム学類) | |
| 5 | 5 | |||
| 6 | // 2012/11/09a kameda[at]iit.tsukuba.ac.jp | 6 | // 2012/11/09a kameda[at]iit.tsukuba.ac.jp | |
| 7 | // 08.01. OpenGLライブラリが使う行列 | 7 | // 08.02. 初めての移動 | |
| 8 | 8 | |||
| 9 | #include "ic2-CommonHeaders.h" | 9 | #include "ic2-CommonHeaders.h" | |
| 10 | 10 | |||
| 11 | 11 | |||
| 12 | // *********************************************************************** | 12 | // *********************************************************************** | |
| 13 | // Rendering ************************************************************* | 13 | // Rendering ************************************************************* | |
| 14 | 14 | |||
| 15 | // +++-------------------------------------------------- | 15 | // +++-------------------------------------------------- | |
| 16 | // スクリーンに描画する | 16 | // スクリーンに描画する | |
| 17 | // +++-------------------------------------------------- | 17 | // +++-------------------------------------------------- | |
| 18 | 18 | |||
| 19 | // +---------------------------------------------------- | 19 | // +---------------------------------------------------- | |
| 20 | // 1フレーム分の描画 | 20 | // 1フレーム分の描画 | |
| 21 | // +---------------------------------------------------- | 21 | // +---------------------------------------------------- | |
| 22 | void ic2_DrawFrame (void) { | 22 | void ic2_DrawFrame (void) { | |
| 23 | // (1) 描画バッファの初期化 | 23 | // (1) 描画バッファの初期化 | |
| 24 | // 以前にglClearColor()で指定した色で塗り潰す | 24 | // 以前にglClearColor()で指定した色で塗り潰す | |
| 25 | glClear(GL_COLOR_BUFFER_BIT); | 25 | glClear(GL_COLOR_BUFFER_BIT); | |
| 26 | 26 | |||
| 27 | // (2) カメラの設定 | 27 | // (2) カメラの設定 | |
| 28 | ic2_SetUpCamera_Ortho(); | 28 | ic2_SetUpCamera_Ortho(); | |
| 29 | 29 | |||
| 30 | // (3) 光源の設置 | 30 | // (3) 光源の設置 | |
| 31 | 31 | |||
| 32 | // (4) 物体の描画 | 32 | // (4) 物体の描画 | |
| 33 | ic2_ShowMATRIX ("Rendering"); | 33 | ic2_ShowMATRIX ("Before"); | |
| 34 | glMatrixMode(GL_MODELVIEW); | |||
| 35 | glTranslatef(0.01, 0, 0); | |||
| 36 | ic2_ShowMATRIX ("After"); | |||
| 34 | ic2_OpenGLLogo(logoscale); | 37 | ic2_OpenGLLogo(logoscale); | |
| 35 | 38 | |||
| 36 | // (5) 描画バッファの切替 | 39 | // (5) 描画バッファの切替 | |
| 37 | glutSwapBuffers(); | 40 | glutSwapBuffers(); | |
| 38 | } | 41 | } | |
| 39 | 42 |