| 
 | Generated by diff2html.pl © Yves Bailly, MandrakeSoft S.A. 2001, Ryohei Morita 2007 diff2html.pl is licensed under the GNU GPL. | 
| ../11-01/ic2-CommonHeaders.h | ic2-CommonHeaders.h | |||
|---|---|---|---|---|
| 50 lines 1591 bytes Last modified : Mon Nov 19 12:13:16 2012 | 93 lines 2887 bytes Last modified : Mon Nov 19 12:27:27 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 | // 11.02. プログラム統合 | |
| 8 | 8 | |||
| 9 | // *********************************************************************** | 9 | // *********************************************************************** | |
| 10 | // CommonHeaders.h : common header files ********************************* | 10 | // CommonHeaders.h : common header files ********************************* | |
| 11 | 11 | |||
| 12 | // +++-------------------------------------------------- | 12 | // +++-------------------------------------------------- | |
| 13 | // どの部分ソースでも利用する可能性が高いライブラリ(関数)に | 13 | // どの部分ソースでも利用する可能性が高いライブラリ(関数)に | |
| 14 | // 相当するヘッダファイル | 14 | // 相当するヘッダファイル | |
| 15 | // +++-------------------------------------------------- | 15 | // +++-------------------------------------------------- | |
| 16 | 16 | |||
| 17 | #include <stdio.h> // printf() | 17 | #include <stdio.h> // printf() | |
| 18 | #include <stdlib.h> // exit() | 18 | #include <stdlib.h> // exit(), calloc(), free() | |
| 19 | #include <GL/glut.h> // gl*(), glut*() | 19 | #include <GL/glut.h> // gl*(), glut*() | |
| 20 | 20 | |||
| 21 | // +++-------------------------------------------------- | 21 | // +++-------------------------------------------------- | |
| 22 | // マクロ | |||
| 23 | // +++-------------------------------------------------- | |||
| 24 | ||||
| 25 | #define IC2DEFAULTMODEL "ic2_DefaultModel.txt" | |||
| 26 | ||||
| 27 | // +++-------------------------------------------------- | |||
| 28 | // 構造体 | |||
| 29 | // +++-------------------------------------------------- | |||
| 30 | ||||
| 31 | // +---------------------------------------------------- | |||
| 32 | // 1つの点の3次元位置のための構造体 | |||
| 33 | // +---------------------------------------------------- | |||
| 34 | struct ic2POINT { | |||
| 35 | float x; | |||
| 36 | float y; | |||
| 37 | float z; | |||
| 38 | }; | |||
| 39 | ||||
| 40 | // +---------------------------------------------------- | |||
| 41 | // RGB反射率のための構造体 | |||
| 42 | // +---------------------------------------------------- | |||
| 43 | struct ic2COLOR { | |||
| 44 | float r; | |||
| 45 | float g; | |||
| 46 | float b; | |||
| 47 | }; | |||
| 48 | ||||
| 49 | // +---------------------------------------------------- | |||
| 50 | // 1つの三角形パッチのための構造体 | |||
| 51 | // 次の三角形パッチへのポインタを持つ。 | |||
| 52 | // +---------------------------------------------------- | |||
| 53 | struct ic2PATCH { | |||
| 54 | struct ic2POINT s; // 頂点s | |||
| 55 | struct ic2POINT t; // 頂点t | |||
| 56 | struct ic2POINT u; // 頂点u | |||
| 57 | struct ic2COLOR c; // 色の強度 (通常は0.0 - 1.0) | |||
| 58 | struct ic2PATCH *next; // 次の三角形パッチへのポインタ | |||
| 59 | }; | |||
| 60 | ||||
| 61 | // +++-------------------------------------------------- | |||
| 22 | // この授業で作った関数のプロトタイプ | 62 | // この授業で作った関数のプロトタイプ | |
| 23 | // +++-------------------------------------------------- | 63 | // +++-------------------------------------------------- | |
| 24 | 64 | |||
| 25 | // 07-04-Callback.c | 65 | // 07-04-Callback.c | |
| 26 | void ic2_timerhandler(int keynumber); | 66 | void ic2_timerhandler(int keynumber); | |
| 27 | void ic2_NormalKeyInput(unsigned char key, int x, int y); | 67 | void ic2_NormalKeyInput(unsigned char key, int x, int y); | |
| 28 | 68 | |||
| 29 | // 07-03-EmbededObjects.c | 69 | // 07-03-EmbededObjects.c | |
| 30 | void ic2_OpenGLLogo (float s); | 70 | void ic2_OpenGLLogo (float s); | |
| 31 | 71 | |||
| 32 | // 07-03-Initialization.c | 72 | // 07-03-Initialization.c | |
| 33 | void ic2_BootWindow (char winname[]); | 73 | void ic2_BootWindow (char winname[]); | |
| 34 | 74 | |||
| 35 | // 09-01-Projection.c | 75 | // 09-01-Projection.c | |
| 36 | void ic2_SetUpCamera_Ortho (void); | 76 | void ic2_SetUpCamera_Ortho (void); | |
| 37 | void ic2_SetUpCamera_Perspective (void); | 77 | void ic2_SetUpCamera_Perspective (void); | |
| 38 | 78 | |||
| 39 | // 07-03-Rendering.c | 79 | // 07-03-Rendering.c | |
| 40 | void ic2_DrawFrame (void); | 80 | void ic2_DrawFrame (void); | |
| 41 | 81 | |||
| 42 | // 08-01 | 82 | // 08-01 | |
| 43 | void ic2_ShowMATRIX (char *str); | 83 | void ic2_ShowMATRIX (char *str); | |
| 44 | 84 | |||
| 85 | // 10-02-ReadModel.c | |||
| 86 | int ic2_ReadModel(char *, struct ic2PATCH **); | |||
| 87 | ||||
| 45 | // +++-------------------------------------------------- | 88 | // +++-------------------------------------------------- | |
| 46 | // この授業で使う大域変数の外部宣言 | 89 | // この授業で使う大域変数の外部宣言 | |
| 47 | // +++-------------------------------------------------- | 90 | // +++-------------------------------------------------- | |
| 48 | 91 | |||
| 49 | // 07-05-MainFunction.c | 92 | // 07-05-MainFunction.c | |
| 50 | extern float logoscale; | 93 | extern float logoscale; |