| 
 | 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-04/08-04-Rendering.c | 09-01-Rendering.c | |||
|---|---|---|---|---|
| 45 lines 1460 bytes Last modified : Mon Nov 19 00:13:20 2012 | 40 lines 1197 bytes Last modified : Mon Nov 19 04:39:58 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/19b kameda[at]iit.tsukuba.ac.jp | 6 | // 2012/11/19a kameda[at]iit.tsukuba.ac.jp | |
| 7 | // 08.04. 多段階の行列操作 | 7 | // 09.01. 透視投影の導入(暫定) | |
| 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_Perspective(); // 透視投影 | |
| 29 | 29 | |||
| 30 | // (3) 光源の設置 | 30 | // (3) 光源の設置 | |
| 31 | 31 | |||
| 32 | // (4) 物体の描画 | 32 | // (4) 物体の描画 | |
| 33 | ic2_ShowMATRIX ("Before"); | |||
| 34 | glMatrixMode(GL_MODELVIEW); | 33 | glMatrixMode(GL_MODELVIEW); | |
| 35 | //-- 【TR】実装ここから | 34 | glLoadIdentity(); | |
| 36 | glLoadIdentity(); ic2_ShowMATRIX ("After I is loaded"); | |||
| 37 | glTranslatef(0.7, 0, 0); ic2_ShowMATRIX ("After +0.7 along X axis"); | |||
| 38 | glRotatef(45, 0, 0, 1); ic2_ShowMATRIX ("After +45 degree rotation around Z axis"); | |||
| 39 | //-- 【TR】実装ここまで | |||
| 40 | ic2_OpenGLLogo(logoscale); | 35 | ic2_OpenGLLogo(logoscale); | |
| 41 | 36 | |||
| 42 | // (5) 描画バッファの切替 | 37 | // (5) 描画バッファの切替 | |
| 43 | glutSwapBuffers(); | 38 | glutSwapBuffers(); | |
| 44 | } | 39 | } | |
| 45 | 40 |