| 
 | Generated by diff2html.pl © Yves Bailly, MandrakeSoft S.A. 2001, Ryohei Morita 2007 diff2html.pl is licensed under the GNU GPL. | 
| ../09-01/09-01-Rendering.c | 09-02-Rendering.c | |||
|---|---|---|---|---|
| 40 lines 1197 bytes Last modified : Mon Nov 19 04:39:58 2012 | 41 lines 1275 bytes Last modified : Mon Nov 19 06:29:07 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/19a kameda[at]iit.tsukuba.ac.jp | 6 | // 2012/11/19a kameda[at]iit.tsukuba.ac.jp | |
| 7 | // 09.01. 透視投影の導入(暫定) | 7 | // 09.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_Perspective(); // 透視投影 | 28 | ic2_SetUpCamera_Perspective(); // 透視投影 | |
| 29 | 29 | |||
| 30 | // (3) 光源の設置 | 30 | // (3) 光源の設置 | |
| 31 | 31 | |||
| 32 | // (4) 物体の描画 | 32 | // (4) 物体の描画 | |
| 33 | glMatrixMode(GL_MODELVIEW); | 33 | glMatrixMode(GL_MODELVIEW); | |
| 34 | glLoadIdentity(); | 34 | glLoadIdentity(); | |
| 35 | glTranslatef(0.0, 0.0, -3.0); // 透視投影の描画範囲と対応必要 | |||
| 35 | ic2_OpenGLLogo(logoscale); | 36 | ic2_OpenGLLogo(logoscale); | |
| 36 | 37 | |||
| 37 | // (5) 描画バッファの切替 | 38 | // (5) 描画バッファの切替 | |
| 38 | glutSwapBuffers(); | 39 | glutSwapBuffers(); | |
| 39 | } | 40 | } | |
| 40 | 41 |