manual.dvi
|
|
- やすもり しばもと
- 5 years ago
- Views:
Transcription
1 ' & VR CompleXcope $ % { {6 1) kage@tokitheorynifsacjp 2) sato@tokitheorynifsacjp
2 CompleXcope Programming Guide, Ver 1, by A Kageyama and T Sato, August 1998
3 1 CompleXcope 5 11 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5 12 CompleXcope : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5 13 CompleXcope : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 6 14 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 7 2 OpenGL 9 21 OpenGL : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 9 22 Web : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : OpenGL : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : OpenGL : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : OpenGL : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : OpenGL : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : aux : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : glu library : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : ( ) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : aux library : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : ( ) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : ( ) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : ( ) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : ( ) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 57 3
4 4 232 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 60 3 CAVE CompleXcope : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : CAVE : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : CAVE : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : Conguration File : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : CompleXcope : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : CAVE : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : ( ) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : CompleXcope : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 94 A CAVE 95 B OpenGL 97 C C (diff f c) 101 C1 C : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 101 C2 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 102 C3 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 103 C4 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 103 C5 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 104 C6 if : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 104 C7 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 104 C8 for : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 106 C9 while : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 106 C10 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 107 C11 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 108 C12 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 110 D 113 D1 : : : : : : : : : : : : : : : : : : : : : : : : 113 D2 x2texture : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 113
5 1 CompleXcope 11 ( ) AVS (VR) VR VR VR (Head Mounted Display, HMD) (Univ Illinois, Chicago) Electronic Visualization Laboratory (EVL) 1 CAVE VR VR 1996 ( ) CAVE CAVE 1997 CAVE VR (complex) CompleXcope 12 CompleXcope CompleXcope 10 ( ) ( 1 5
6 6 CompleXcope ) CompleXcope CAVE ( ) ( ) ( ) ( ) cm CompleXcope CompleXcope CAVE CompleXcope 13 CompleXcope CAVE CAVE EVL CAVE UNIX VR CompleXcope CAVE 1 2 ( ) 3 ( ) 4 CompleXcope OpenGL 2 OpenGL CompleXcope OpenGL CAVE OpenGL CAVE CompleXcope 2 Iris GL Open Inventor, Iris Performer
7 OpenGL CAVE CompleXcope \ " 14 CompleXcope CompleXcope OpenGL CG CompleXcope OpenGL OpenGL CG CompleXcope OpenGL ( ) OpenGL CG CompleXcope \ OpenGL " AVS OpenGL AVS CAVE library OpenGL CAVE library ( ) Web CAVE library (OpenGL ) OpenGL CompleXcope X ( ) CompleXcope CAVE library Appendix A CAVE Appendix B OpenGL CompleXcope C( C++) Fortran C Appendix C Fortran C C C Appendix D ( ) pict gif
8 8 CompleXcope
9 2 OpenGL 21 OpenGL OpenGL 1 SGI (Silicon Graphics, Inc) GL OpenGL ARB (Architecture Review Board) OpenGL (CG) (1) (2) (3) ( ) (4) (5) (6) ( ) (7) CG (1) (5) OpenGL (6) (7) OpenGL (7) OpenGL OpenGL 120 OpenGL X Window Macintosh Windows95/NT Be OpenGL CG OpenGL CG CompleXcope CompleXcope X Window OpenGL X Window OpenGL glut library[1] M Kilgard OpenGL glut library aux library 2 1 \OpenGL" \Open GL" 2 Xlib Motif Tcl/Tk 9
10 10 OpenGL \aux" aux library CompleXcope (7) CAVE library CAVE library \CAVE" CompleXcope aux library (5) ( ) CompleXcope ( ) OpenGL CompleXcope CAVE CAVE OpenGL 22 Web OpenGL \OpenGL Programming Guide" [2, 3] 1993 [4, 5] 1997 aux library glut library OpenGL OpenGL OpenGL \OpenGL Reference Manual" [6] OpenGL man OpenGL (R) (B) (G) glut \OpenGL Programming for the X Window System"[1] OpenGL [7] OpenGL OpenGL OpenGL WEB OpenGL Japan OpenGL FAQ OpenGL Mesa Mesa Avid Technology, Inc Brian Paul 23 OpenGL OpenGL ( ) X
11 24 OpenGL 11 aux library glu library glx library glut library `aux' aux library `glu' X Window `glx' X Window OpenGL `glut' aux library glu library glx glut 24 OpenGL simplec aux library OpenGL OpenGL z =0 1: #include <GL/glh> 2: #include "auxh" 3: 4: main() { 5: 6: auxinitdisplaymode (AUX_SINGLE AUX_RGB); 7: auxinitposition (0, 0, 500, 500); 8: auxinitwindow ("simplec"); 9: 10: glclearcolor (00, 00, 00, 00); 11: glclear(gl_color_buffer_bit); 12: glcolor3f(10, 10, 10); 13: glmatrixmode (GL_PROJECTION); 14: glloadidentity (); 15: glortho(-10, 10, -10, 10, -10, 10); 16: glbegin(gl_polygon); 17: glvertex3f(-05, -05, 00); 18: glvertex3f(-05, 05, 00); 19: glvertex3f( 05, 05, 00); 20: glvertex3f( 05, -05, 00); 21: glend(); 22: glflush(); 23: sleep (10); 24:
12 12 OpenGL OpenGL include 3 OpenGL OpenGL (CompleXcope )OpenGL aux library include aux library OpenGL CompleXcope include main aux library (1) (2) RGB RGB Red, Green, Blue (0,0) (500, 500) (X Window ) +x +y auxinitwindow() \gl" OpenGL glclearcolor() R, G, B, A 0 1 A Alpha RGBA 0 color buer depth buer stencil buer (R; G; B) =(1:0; 1:0; 1:0) glortho() ( ) (glbegin glend ) glbegin() GL_POLYGON x,y,z (-05, -05, 00) glend() glflush() 4 (OpenGL ) C (glflush ) ( ) sleep(10) 10 sleep 3 /usr/local/include/gl/glh 4 OpenGL
13 25 OpenGL OpenGL OpenGL \gl" ( \glclearcolor") \GL_" \glcolor3f()" ( \3f") 3 \glcolor4f()" \3f" \f" oat \3f" OpenGL b 8 GLbyte i 32 GLint f 32 GLfloat d 64 GLdouble C int oat GLint GLoat OpenGL OpenGL \v" \v" ( ) OpenGL float color_array[] = {00, 00, 10; /* */ glcolor3f(10, 10, 00); /* */ glcolor3fv(color_array); /* */ 26 OpenGL OpenGL \ " \ " \ " \ " \ " \glcolor3f" \simplec" 16 glbegin() 21 glend() \draw_rectangle()"
14 14 OpenGL glcolor3f(10, 10, 10); draw_rectangle(); /* */ glcolor3f(10, 00, 00); draw_rectangle(); /* */ draw_rectangle(); /* */ glcolor3f(10, 10, 00); draw_rectangle(); /* */ glcolor3f() \ " \ " 27 OpenGL (vertex) z = simple2c #include <GL/glh> #include <mathh> /* (sin, cos) */ #include "auxh" main() { float pi; float x0, x1, x2, x3, x4, x5; float y0, y1, y2, y3, y4, y5; auxinitdisplaymode (AUX_SINGLE AUX_RGB); auxinitposition (0, 0, 500, 500);
15 27 15 auxinitwindow ("simple2c"); glclearcolor (00, 00, 00, 00); /* */ glclear (GL_COLOR_BUFFER_BIT); /* */ glcolor3f(00, 10, 00); /* */ glpointsize (50); /* 5 */ glmatrixmode (GL_PROJECTION); glloadidentity (); glortho (-15, 15, -15, 15, -15, 15); /* */ pi = ; x0 = cos(0*pi/3); y0 = sin(0*pi/3); x1 = cos(1*pi/3); y1 = sin(1*pi/3); x2 = cos(2*pi/3); y2 = sin(2*pi/3); x3 = cos(3*pi/3); y3 = sin(3*pi/3); x4 = cos(4*pi/3); y4 = sin(4*pi/3); x5 = cos(5*pi/3); y5 = sin(5*pi/3); glbegin(gl_points); glvertex3f(x0, y0, 00); /* o o */ glvertex3f(x1, y1, 00); /* */ glvertex3f(x2, y2, 00); /* o o */ glvertex3f(x3, y3, 00); /* */ glvertex3f(x4, y4, 00); /* o o */ glvertex3f(x5, y5, 00); /* */ glend(); glflush(); sleep (10); n end of simple2c / \glbegin" \glend" \glvertex()" glbegin glend glbegin(gl_points); for (i=0; i<6; i++) { x = cos(i*pi/3); y = sin(i*pi/3); glvertex3f(x, y, 00); glend(); simple3c
16 16 OpenGL #include <GL/glh> #include <mathh> /* (sin, cos) */ #include "auxh" main() { float pi, x, y; int i; auxinitdisplaymode (AUX_SINGLE AUX_RGB); auxinitposition (0, 0, 500, 500); auxinitwindow ("simple3c"); glclearcolor (00, 00, 00, 00); /* */ glclear (GL_COLOR_BUFFER_BIT); /* */ glcolor3f(00, 10, 00); /* */ glpointsize (50); /* 5 */ glmatrixmode (GL_PROJECTION); glloadidentity (); glortho (-15, 15, -15, 15, -15, 15); /* */ pi = ; glbegin(gl_points); for (i=0; i<6; i++) { x = cos(i*pi/3); y = sin(i*pi/3); glvertex3f(x, y, 00); glend(); glflush(); sleep (10); n end of simple3c / \glbegin()" \GL_POINTS" \GL_POLYGON"
17 simple4c #include <GL/glh> #include <mathh> #include "auxh" main() { int i; float pi, x, y; auxinitdisplaymode (AUX_SINGLE AUX_RGB); auxinitposition (0, 0, 500, 500); auxinitwindow ("simple4c"); glclearcolor (00, 00, 00, 00); /* */ glclear (GL_COLOR_BUFFER_BIT); /* */ glcolor3f(00, 10, 00); /* */ glmatrixmode (GL_PROJECTION); glloadidentity (); glortho (-15, 15, -15, 15, -15, 15); /* */ pi = ; glbegin(gl_polygon); /* <---- */ for (i=0; i<6; i++) { x = cos(i*pi/3); y = sin(i*pi/3); glvertex3f(x, y, 00); glend(); glflush(); sleep (10); n end of simple4c / GL_POLYGON GL_POLYGON 28 \glbegin()" \GL_POINTS" \GL_POLYGON" \GL_POLYGON" \GL_POLYGON" v0, v1,, v7 x y z
18 18 OpenGL float v0[] = {-10, -10, -10; float v1[] = { 10, -10, -10; /* v4 v5 */ glbegin(gl_polygon); /* */ glvertex3fv(v0); /* / / */ glvertex3fv(v1); /* v v7 */ glvertex3fv(v3); /* v3 / */ glvertex3fv(v2); /* / */ glend(); /* */ /* v0 v1 */ glbegin(gl_polygon); glvertex3fv(v2); glvertex3fv(v3); glvertex3fv(v5); glvertex3fv(v4); glend(); /* glbegin() glend() */ \GL_POLYGON" GL_POINTS GL_LINES GL_POLYGON GL_TRIANGLES GL_QUADS GL_LINE_STRIP GL_LINE_LOOP GL_TRIANGLE_STRIP GL_TRIANGLE_FAN GL_QUAD_STRIP glbegin() 5 5 \ " \ " :::
19 28 19 v0 v0 v2 v1 v2 x / / / v3 / v3 x x v1 / / v1 v0 x v2 v4 v5 v3 GL_POINTS GL_LINES GL_LINE_STRIP v2 v3 v2 v3 v0 v1 / v1 / v /+++/ v5 \ /+++/ v4 v5 /\ \++++/ v v0 / \ v4 \++/ v3 v2 /++++++/ \/ GL_LINE_LOOP v0 v7 v6 GL_POLYGON GL_QUADS v1 v3 v5 v6 v0 v \+++++/ v5 v4 / / \+++/ ++++/ / / \+/ +++/ / / + ++/ v1 +/ v0 v2 v4 v5 v3 / GL_QUAD_STRIP GL_TRIANGLES v4 v3 v v1 v3 v5 \ /+\ v \ /+++\ /+\+++++/+\+++++/ \ /+++/ /+++\+++/+++\+++/ \++ ++/++/ /+++++\+/+++++\+/ \+ +/+/ \ // v0 v2 v4 v0 GL_TRIANGLE_STRIP GL_TRIANGLE_FAN glbegin() glend() glvertex3f glvertex3fv(v0), glvertex3fv(v1), glvertex3fv(v2), glvertex3fv(v3), 111 glbegin()
20 20 OpenGL glbegin(gl_quad_strip); glvertex3fv(v0); glvertex3fv(v1); glvertex3fv(v2); glvertex3fv(v3); glvertex3fv(v4); glvertex3fv(v5); glvertex3fv(v6); glvertex3fv(v7); glvertex3fv(v0); glvertex3fv(v1); glend(); glbegin(gl_quads); glvertex3fv(v0); glvertex3fv(v4); glvertex3fv(v1); glvertex3fv(v5); glend(); glvertex3fv(v2); glvertex3fv(v6); glvertex3fv(v3); glvertex3fv(v7); 29 3 CG 1 2 ( ) 3 OpenGL OpenGL 2 CG 6 OpenGL OpenGL 6
21 CG OpenGL ( ) 210 OpenGL 8 o=================================== 36 o======================== 24 o================== 18 o============== 14 o=========== 11 depth buffer 3D OBJECT o========= 9 o======== 8 o======== 8 o========= 9 (depth buer) 9 (= ) (OBJ-X ) OBJ-X ( ) OBJ-X 10 (1) OBJ-X (P ) D (2) P (I,J) (3) (I,J) D D ( P ) P D 7 \ " 8 9 Z 10
22 22 OpenGL o x=========== 36 --> 11 o x============ 24 --> 12 o----x============= 18 --> 13 X============== 14 X o=========== 11 OBJ-X X o========= 9 X o======== 8 X o======== 8 X o========= 9 OpenGL ( ) glenable(gl_depth_test); ( OFF )GL_DEPTH_TEST ON glenable() OpenGL ON 11 ( ) glclear(gl_depth_buffer_bit) ( ) ( ) glclear(gl_color_buffer_bit); glclear(gl_depth_buffer_bit); glclear(gl_color_buffer_bit GL_DEPTH_BUFFER_BIT); glenable() glclear() aux library auxinitdisplaymode ( simplec (p11) ) (AUX_SINGLE AUX_RGB AUX_DEPTH) 11 glenable(gl FOG) ( ) ON glenable(gl LIGHTING) ON (p25)
23 ON glnormal3f(); ( ) glnormal3fv(); 3 ( (2) ) (1) (2) 1 (3) float n0[] = {00, 00, 10; /* */ float n1[] = {00, 00, 10; /* */ float n2[] = {00, 00, 10; /* */ float v0[] = {10, 00, 00; /* */ float v1[] = {00, 00, 00; /* */ float v2[] = {00, 15, 00; /* */ glbegin(gl_poylgon); /* n1 */ glnormal3fv(n0); /* n0 */ glvertex3fv(v0); /* */ glnormal3fv(n1); /* + n2 */ glvertex3fv(v1); /* + */ glnormal3fv(n2); /* */ glvertex3fv(v2); /* + */ glend(); sqrt() glnormal OpenGL
24 24 OpenGL OpenGL ( ) OpenGL OpenGL CompleXcope o ( ) o o OFF glcolor CompleXcope \ " ( ) ( ) \ " CompleXcope (\Welcome to CompleXcope" )
25 o glcolor ( ) o ( ) 2122 OpenGL glenable(gl_ligthting); glenable(gl_ligtht0); glenable() OpenGL ON glenable() ON OpenGL glenable(gl_light0) 0 glenable(gl_ligthting); glenable(gl_ligtht0); glenable(gl_ligtht1); ( ) (GL_LIGHT0 ) ( ) OpenGL o o RGB o ( ) o o ( RGB ) o o RGB o RGB CG \ "
26 26 OpenGL 2123 (ambient light) 14 RGB \ / \ / \ / ---- OBJ ---- / \ / \ / \ (diuse light) ( ) ( ) ~s ~n ~s ~n ( ) ~s ~n ( ) 15 \ / \ / -- S S -- / \ / \ / / / / / / / / / / / / / / / / ( ) ( )
27 (specular light) ~s ~n ~v ~s + ~v ~n \ / V1 ( ) -- S -- / \ V2 ( ) / / V3 ( ) / / / / / / CG CG (0; 0; 0) 1 ( ) +z 16 x +1 ( ) 17 ( ) \ " (0; 0; 1) (1; 0; 0) (x < 0) ( ) ( ) ( ) \ " ( ) 16 OpenGL 17 OpenGL
28 28 OpenGL ( ) ( ) ( ) (CompleXcope ) OpenGL 0 1( ) gllightf() gllightfv() GLfloat light_position[] = {100, 50, 30, 10; /* */ gllightfv(gl_light0, GL_POSITION, light_position); glenable(gl_lighting); /* ON */ glenable(gl_light0); /* 0 ON */ ( light_position ) x; y; z 1:0 x; y; z gllightfv() (lx; ly; lz; lw) (lx=lw; ly=lw; lz=lw) 00 (lx; ly; lz) OpenGL 00 10
29 GLfloat light_position[] = {100, 50, 30, 00; /* */ GLfloat light_diffuse[] = {10, 10, 10, 00; /* */ GLfloat light_ambient[] = {03, 03, 03, 00; /* */ GLfloat light_specular[] = {08, 08, 08, 00; /* */ gllightfv(gl_light0, GL_POSITION, light_position); /* */ gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); /* */ gllightfv(gl_light0, GL_SPECURAR, light_specular); /* */ gllightfv(gl_light0, GL_AMBIENT, light_ambient); /* */ glenable(gl_lighting); /* ON */ glenable(gl_light0); /* 0 ON */ 213 (R,G,B) glmaterialfv() ( ) ( ) GLfloat light_position[] = {100, 50, 30, 00; /* */ GLfloat light_diffuse[] = {10, 10, 10, 00; GLfloat light_ambient[] = {03, 03, 03, 00; GLfloat light_specular[] = {08, 08, 08, 00; GLfloat ball_1_diffuse[] = {10, 00, 00, 00; /* 1 */ GLfloat ball_1_ambient[] = {10, 00, 00, 00; GLfloat ball_1_specular[] = {08, 08, 08, 00; GLfloat ball_2_diffuse[] = {00, 10, 00, 00; /* 2 */
30 30 OpenGL GLfloat ball_2_ambient[] = {00, 10, 00, 00; GLfloat ball_2_specular[] = {00, 00, 00, 00; gllightfv(gl_light0, GL_POSITION, light_position); /* */ gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); /* */ gllightfv(gl_light0, GL_SPECURAR, light_specular); /* */ gllightfv(gl_light0, GL_AMBIENT, light_ambient); /* */ glenable(gl_lighting); /* ON */ glenable(gl_light0); /* 0 ON */ glenable(gl_depth_test); /* ( ) ON */ glclear(gl_color_buffer_bit GL_DEPTH_BUFFER_BIT); /* */ /* */ glmaterialfv(gl_front, GL_DIFFUSE, ball_1_diffuse); glmaterialfv(gl_front, GL_AMBIENT, ball_1_amnient); glmaterialfv(gl_front, GL_SPECULAR, ball_1_specular); glmaterialf(gl_front, GL_SHININESS, 1100); /* */ make_ball_1(); /* */ /* */ glmaterialfv(gl_front, GL_DIFFUSE, ball_2_diffuse); glmaterialfv(gl_front, GL_AMBIENT, ball_2_amnient); glmaterialfv(gl_front, GL_SPECULAR, ball_2_specular); make_ball_2(); GL_SHININESS glmaterialfv() glmaterialf() ( 1100)
31 (a) ( )x(r,g,b) (b) (c) OpenGL ( ) (1) (a)-(c) RGB (2) RGB ( ) ( ) 215 OpenGL CG OpenGL \ " ( ) AVS CG OpenGL X Window 21 aux aux 216 aux aux (auxinitdisplaymode ) (auxinitwindow) OpenGL 19 aux auxwiresphere(gldouble radius); auxsolidsphere(gldouble radius); Wire Solid Wire Solid 19
32 32 OpenGL auxwirecube(gldouble size); auxsolidcube(gldouble size); auxwirebox(gldouble width, GLdouble height, GLdouble depth); auxsolidbox(gldouble width, GLdouble height, GLdouble depth); auxwiretorus(gldouble minorradius, GLdouble majorradius); auxsolidtorus(gldouble minorradius, GLdouble majorradius); auxwirecylinder(gldouble radius, GLdouble height); auxsolidcylinder(gldouble radius, GLdouble height); auxwirecone(gldouble radius); auxsolidcone(gldouble radius); auxwiretetrahedron(gldouble radius); auxsolidtetrahedron(gldouble radius); auxwireoctahedron(gldouble radius); auxsolidoctahedron(gldouble radius); auxwiredodecahedron(gldouble radius); auxsoliddodecahedron(gldouble radius); auxwireicosahedron(gldouble radius); auxsolidicosahedron(gldouble radius);
33 217 glu library 33 auxwireteapot(gldouble size); auxsolidteapot(gldouble size); "auxh" include 217 glu library aux aux \ " ( ) glu glu glu GLUquadricObj* glunewquadric(void); \Quadric" glu library 2 a 1 x 2 + a 2 y 2 + a 3 z 2 + a 4 xy + a 5 yz + a 6 zx + a 7 x + a 8 y + a 9 z + a 10 =0 glu ( a 1 a 10 ) gluneqquadric glu void glusphere(gluquadricobj *qobj, GLdouble radius, GLinit slices, GLint stacks); glunewquadric slices stacks glu void glucylinder(gluquadricobj *qobj, GLdouble baseradius, GLdouble topradius, GLdouble height, GLinit slices, GLint stacks); glu void gludisk(gluquadricobj *qobj, GLdouble innerradius, GLdouble outerradius, GLinit slices, GLint stacks);
34 34 OpenGL OpenGL Programming Gluid, Second Edition [4], p431 glusphere (Xballc; p72) 218 (viewing) CG CG CG \ " x{y z ( ) x{y \ " x v OpenGL ( t = 0 ) t x = vt (glvertex3f x vt \( ) " OpenGL (x; y; z; w) w
35 ( ) ( ) OpenGL <-----> <-----> v(x,y,z,w) M v 0 = Mv v 0 P v 00 = Pv 0 = PMv v 00 (x; y; z; x) CG 21 (x; y; z) x y z z ' 0 1 C A cos ' 0 sin ' 0 0 sin ' cos ' gluperspective(f,aspect,znear,zfarr) 0 1 C A cot (f=2) aspect cot (f=2) zFar3zNear znear0zfar zfar+znear 0 0 znear0zfar C A 219 x{y \F" F \ " x=20 21 OpenGL
36 36 OpenGL y y= x x=0 x=20 (x=0) F F \ " drawf() drawf(): (` ') x=0, y=0 F y=0 x=0 drawf() x=20 F (1) (2) OpenGL (1) (2) K' - - K" -
37 gltranslatef(glfloat x, GLfloat y, GLfloat z) gltranslatef(200, 00, 00) K x 20 K' ' y y' y= x x' x=0 x=20 glrotatef(glfloat angle, GLfloat axis_y, GLfloat axis_y, GLfloat axis_z) glrotatef(300, 00, 00, 10) z 30 x-y 030: = 330:0 K' (K ) z " y x" y= x y" x=0 x=20 K"
38 38 OpenGL x=20 F (1) K" (2) K" y" F K" drawf() 1 x 20 K' 2 z +90 K" 3 K" F OpenGL glpushmatrix(); gltranslatef(200, 00, 00); glrotatef(900, 00, 00, 10); drawf(); glpopmatrix(); glpushmatrix glpopmatrix ( ) ( ) CompleXcope CompleXcope 23 CompleXcope CAVE library 24 void gluortho(gldouble left, GLdouble right, GLdouble top, GLdouble bottom, GLdouble near, GLdouble far); CompleXcope 24
39 z 0z void gluperspective(gldouble fovy, GLdouble aspect, GLdouble znear, GLdouble zfar); 25 (0,0,0) 0z fovy fovy=2 fovy=2 (0 fovy 180:0) aspect / (0; 0; 0) (0; 0; 0) z ( ) gluperspective fovy aspect zfar zfar zfar znear ( ) zfar \ " znear zfar 221 CompleXcope CAVE library X Window OpenGL CG OpenGL OpenGL - gluperspective - z -z - 26 glviewport aux library Window aux library X Window OpenGL \ " 25 glu library OpenGL glu 26
40 40 OpenGL 222 ( ) z 05 auxwireteapot (p31) (0; 0:0) 0z 5 OpenGL 0z gluperspective znear zfar 3:0 10: wire teapotc /* * wire_teapotc \* An OpenGL sample program - A wire teapot by the aux library - No lighting - Perspective view by the glu library - No animation */ #include <GL/glh> #include <GL/gluh> #include "auxh" void display (void) { glclear(gl_color_buffer_bit); glcolor3f (10, 10, 10); glpushmatrix(); gltranslatef (00, 00, -50); auxwireteapot(10); /* */ glpopmatrix(); glflush(); void reshape(int width, int height) { GLdouble ang = 600; GLdouble near = 30; GLdouble far = 100;
41 223 aux library 41 glviewport (0, 0, width, height); glmatrixmode (GL_PROJECTION); glloadidentity (); gluperspective (ang, (GLdouble)width/(GLdouble)height, near, far); glmatrixmode (GL_MODELVIEW); glloadidentity (); int main(int argc, char** argv) { auxinitdisplaymode (AUX_SINGLE AUX_RGB); auxinitposition (0, 0, 500, 500); auxinitwindow (argv[0]); auxreshapefunc (reshape); auxmainloop(display); n end of wire teapotc / 223 aux library wire teapotc aux library main auxinitdisplaymode ( ) auxinitdisplaymode(aux_single AUX_RGB); ( CG ) [ ] auxinitdisplaymode(aux_single AUX_RGB AUX_DEPTH); ( 27 ) ( CG ) [ ] auxinitdisplaymode(aux_double AUX_RGB AUX_DEPTH); auxinitposition auxinitwindow 27 ( 229 )
42 42 OpenGL auxinitposition(glint x, GLint y, GLsize width, GLsize height) (x; y) ( ) (width; height) ( ) auxinitwindow(glbyte *titlestring) auxreshapefunc(void (*function)(glsizei, GLsizei)) auxreshapefuc function function auxmainloop(void (*displayfunc)(void)) ( ) displayfunc 224 ( ) torusc
43 224 ( ) 43 /* * torusc \* An OpenGL sample program - A torus by the aux library - With the lighting - Perspective view by the glu library - No animation */ #include <GL/glh> #include <GL/gluh> #include "auxh" void initial(void) { GLfloat light_diffuse[] = { 10, 10, 10, 10 ; GLfloat light_ambient[] = { 05, 05, 05, 10 ; GLfloat light_specular[] = { 10, 10, 10, 10 ; GLfloat light_position[] = { 10, 10, 10, 00 ; gllightfv(gl_light0, GL_AMBIENT, light_ambient); gllightfv(gl_light0, GL_SPECULAR, light_specular); gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); gllightfv(gl_light0, GL_POSITION, light_position); glenable(gl_lighting); glenable(gl_light0); gldepthfunc(gl_less); glenable(gl_depth_test); void display (void) { GLfloat mat_diffuse[] = { 10, 10, 10, 10 ; GLfloat mat_ambient[] = { 01, 01, 01, 10 ; GLfloat mat_specular[] = { 09, 09, 09, 10 ; glclear( GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT ); glmaterialfv(gl_front, GL_DIFFUSE, mat_diffuse); glmaterialfv(gl_front, GL_AMBIENT, mat_ambient); glmaterialfv(gl_front, GL_SPECULAR, mat_specular); glmaterialf (GL_FRONT, GL_SHININESS, 640); glpushmatrix(); gltranslatef (00, 00, -50); auxsolidtorus(02,10); /* */ glpopmatrix(); glflush(); void reshape(int width, int height) {
44 44 OpenGL GLdouble ang = 600; GLdouble near = 30; GLdouble far = 100; glviewport (0, 0, width, height); glmatrixmode (GL_PROJECTION); glloadidentity (); gluperspective (ang, (GLdouble)width/(GLdouble)height, near, far); glmatrixmode (GL_MODELVIEW); glloadidentity (); int main(int argc, char **argv) { auxinitdisplaymode (AUX_SINGLE AUX_RGB AUX_DEPTH); auxinitposition (0, 0, 500, 500); auxinitwindow (argv[0]); initial(); auxreshapefunc (reshape); auxmainloop(display); n end of torusc / 45 torus2c gltranslate 76 (2; 1; 09) /* * torus2c \* An OpenGL sample program - Two tori (see torusc) - No animation */
45 224 ( ) 45 #include <GL/glh> #include <GL/gluh> #include "auxh" void initial(void) { GLfloat light_diffuse[] = { 10, 10, 10, 10 ; GLfloat light_ambient[] = { 05, 05, 05, 10 ; GLfloat light_specular[] = { 10, 10, 10, 10 ; GLfloat light_position[] = { 10, 10, 10, 00 ; gllightfv(gl_light0, GL_AMBIENT, light_ambient); gllightfv(gl_light0, GL_SPECULAR, light_specular); gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); gllightfv(gl_light0, GL_POSITION, light_position); glenable(gl_lighting); glenable(gl_light0); gldepthfunc(gl_less); glenable(gl_depth_test); void display (void) { GLfloat mat_diffuse[] = { 10, 10, 10, 10 ; GLfloat mat_ambient[] = { 01, 01, 01, 10 ; GLfloat mat_specular[] = { 09, 09, 09, 10 ; glclear( GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT ); glmaterialfv(gl_front, GL_DIFFUSE, mat_diffuse); glmaterialfv(gl_front, GL_AMBIENT, mat_ambient); glmaterialfv(gl_front, GL_SPECULAR, mat_specular); glmaterialf (GL_FRONT, GL_SHININESS, 640); glpushmatrix(); gltranslatef (00, 00, -50); auxsolidtorus(02,10); gltranslatef (20, 10, -40); auxsolidtorus(02,10); glpopmatrix(); glflush(); void reshape(int width, int height) { GLdouble ang = 600; GLdouble near = 30; GLdouble far = 100; glviewport (0, 0, width, height); glmatrixmode (GL_PROJECTION); glloadidentity ();
46 46 OpenGL gluperspective (ang, (GLdouble)width/(GLdouble)height, near, far); glmatrixmode (GL_MODELVIEW); glloadidentity (); int main(int argc, char **argv) { auxinitdisplaymode (AUX_SINGLE AUX_RGB AUX_DEPTH); auxinitposition (0, 0, 500, 500); auxinitwindow (argv[0]); initial(); auxreshapefunc (reshape); auxmainloop(display); n end of torus2c / 225 ( ) ( ) glrotate torus rotatedc torusc display glpushmatrix glpopmatrix glpushmatrix(); gltranslatef (00, 00, -50); glrotatef (-600, 10, 00, 00); auxsolidtorus(02,10); glpopmatrix(); gltranslatef glrotatef ( )2( ) 6= ( )2( )
47 226 ( ) ( ) torus2 rotatedc torusc display glpushmatrix glpopmatrix glpushmatrix(); gltranslatef (00, 00, -50); glrotatef(-600, 10, 00, 00); auxsolidtorus(02,10); gltranslatef (00, 40, 00); auxsolidtorus(02,10); glpopmatrix(); 1 ( ) 0z 2 x y OpenGL ( ) glpushmatrix glpopmatix()
48 48 OpenGL 28 current matrix current matrix glpushmatrix push current matrix push current matrix glpopmatrix pop current matrix glpushmatrix current matrix OpenGL ( ) glpushmatrix glpopmatrix OpenGL glpushmatrix glpopmatrix \ " OpenGL glpushmatrix glpopmatrix 29 push pop torus2 rotatedc torus2 rotated2c torusc display glpushmatrix glpopmatrix gltranslatef (00, 00, -50); glpushmatrix(); glrotatef(-600, 10, 00, 00); auxsolidtorus(02,10); glpopmatrix(); glpushmatrix(); gltranslatef (00, 10, 00); 28 UNIX 29 glmatrixmode
49 228 ( ) 49 auxsolidtorus(02,10); glpopmatrix(); 228 ( ) push pop linkc /* * linkc \* An OpenGL sample program - Three linked tori (with a ball) - No animation */ #include <GL/glh> #include <GL/gluh> #include "auxh" void initial(void) { GLfloat light_diffuse[] = { 10, 10, 10, 10 ; GLfloat light_ambient[] = { 05, 05, 05, 10 ; GLfloat light_specular[] = { 10, 10, 10, 10 ; GLfloat light_position[] = { 10, 10, 10, 00 ; gllightfv(gl_light0, GL_AMBIENT, light_ambient); gllightfv(gl_light0, GL_SPECULAR, light_specular); gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); gllightfv(gl_light0, GL_POSITION, light_position); glenable(gl_lighting); glenable(gl_light0);
50 50 OpenGL gldepthfunc(gl_less); glenable(gl_depth_test); void set_mat_color(glfloat *diffuse, GLfloat *ambient, GLfloat *specular) { glmaterialfv(gl_front, GL_DIFFUSE, diffuse); glmaterialfv(gl_front, GL_AMBIENT, ambient); glmaterialfv(gl_front, GL_SPECULAR, specular); void display (void) { GLfloat diffuse0[] = { 10, 10, 10, 10 ; GLfloat ambient0[] = { 01, 01, 01, 10 ; GLfloat specular0[] = { 09, 09, 09, 10 ; GLfloat diffuse1[] = { 10, 10, 00, 10 ; GLfloat ambient1[] = { 01, 01, 00, 10 ; GLfloat specular1[] = { 09, 09, 00, 10 ; GLfloat diffuse2[] = { 10, 00, 10, 10 ; GLfloat ambient2[] = { 01, 00, 01, 10 ; GLfloat specular2[] = { 09, 00, 09, 10 ; GLfloat diffuse3[] = { 00, 10, 10, 10 ; GLfloat ambient3[] = { 00, 01, 01, 10 ; GLfloat specular3[] = { 00, 09, 09, 10 ; glclear( GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT ); glmaterialf (GL_FRONT, GL_SHININESS, 640); gltranslatef(00, 00, -50); glrotatef(-700, 10, 00, 00); glpushmatrix(); set_mat_color(diffuse0, ambient0, specular0); auxsolidtorus(02,10); glpushmatrix(); gltranslatef(10, 00, 00); glrotatef(900, 10, 00, 00); set_mat_color(diffuse1, ambient1, specular1); auxsolidtorus(015,05); glpushmatrix(); glrotatef(300, 00, 00, 10); gltranslatef(05, 00, 00); glrotatef(-500, 00, 10, 00); gltranslatef(02, 00, 00); set_mat_color(diffuse3, ambient3, specular3); auxsolidsphere(005); glpopmatrix(); glpopmatrix(); glpushmatrix(); glrotatef(1200, 00, 00, 10); gltranslatef(10, 00, 00); glrotatef(900, 10, 00, 00); set_mat_color(diffuse2, ambient2, specular2);
51 auxsolidtorus(015,05); glpopmatrix(); glpushmatrix(); glrotatef(2400, 00, 00, 10); gltranslatef(10, 00, 00); glrotatef(900, 10, 00, 00); set_mat_color(diffuse3, ambient3, specular3); auxsolidtorus(015,05); glpopmatrix(); glpopmatrix(); glflush(); void reshape(int width, int height) { GLdouble ang = 600; GLdouble near = 30; GLdouble far = 100; glviewport (0, 0, width, height); glmatrixmode (GL_PROJECTION); glloadidentity (); gluperspective (ang, (GLdouble)width/(GLdouble)height, near, far); glmatrixmode (GL_MODELVIEW); glloadidentity (); int main(int argc, char **argv) { auxinitdisplaymode (AUX_SINGLE AUX_RGB AUX_DEPTH); auxinitposition (0, 0, 500, 500); auxinitwindow (argv[0]); initial(); auxreshapefunc (reshape); auxmainloop(display); n end of linkc / 229 ( ) CG ( A ) OpenGL ( B ) A B A ( A) B B OpenGL
52 52 OpenGL 1 main auxinitdisplaymode() AUX_DOUBLE 2 main auxidlefunc() 3 auxidlefunc() auxmainloop() 4 glflush() glxswapbuffers() glxswapbuers glx glxswapbuers glflush glflush glxswapbuers swing torusc /* * swing_torusc \* An OpenGL sample program - Animation - A rotating torus (see torusc) */ #include <GL/glh> #include <GL/gluh> #include "auxh" static GLdouble spin=00; void initial(void) { GLfloat light_diffuse[] = { 10, 10, 10, 10 ; GLfloat light_ambient[] = { 05, 05, 05, 10 ; GLfloat light_specular[] = { 10, 10, 10, 10 ; GLfloat light_position[] = { 10, 10, 10, 00 ; gllightfv(gl_light0, GL_AMBIENT, light_ambient);
53 gllightfv(gl_light0, GL_SPECULAR, light_specular); gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); gllightfv(gl_light0, GL_POSITION, light_position); glenable(gl_lighting); glenable(gl_light0); glenable(gl_depth_test); void display (void) { GLfloat mat_diffuse[] = { 10, 10, 10, 10 ; GLfloat mat_ambient[] = { 01, 01, 01, 10 ; GLfloat mat_specular[] = { 09, 09, 09, 10 ; glclear( GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT ); glmaterialfv(gl_front, GL_DIFFUSE, mat_diffuse); glmaterialfv(gl_front, GL_AMBIENT, mat_ambient); glmaterialfv(gl_front, GL_SPECULAR, mat_specular); glmaterialf (GL_FRONT, GL_SHININESS, 640); glpushmatrix(); gltranslatef (00, 00, -50); glrotatef (spin, 10, 00, 00); glrotatef (spin, 00, 10, 10); auxsolidtorus(02,10); glpopmatrix(); glxswapbuffers(auxxdisplay(), auxxwindow()); void rotation(void) { spin += 15; if (spin > 3600) spin -= 3600; display(); void reshape(int width, int height) { GLdouble ang = 600; GLdouble near = 30; GLdouble far = 100; glviewport (0, 0, width, height); glmatrixmode (GL_PROJECTION); glloadidentity (); gluperspective (ang, (GLdouble)width/(GLdouble)height, near, far); glmatrixmode (GL_MODELVIEW); glloadidentity (); int main(int argc, char **argv) { auxinitdisplaymode (AUX_DOUBLE AUX_RGBA AUX_DEPTH);
54 54 OpenGL auxinitposition (0, 0, 500, 500); auxinitwindow (argv[0]); initial(); auxreshapefunc (reshape); auxidlefunc(display); auxmainloop(rotation); n end of swing torusc / link animec linkc ( ) ( ) /* * link_anmimec \* An OpenGL sample program - Animation */ #include <GL/glh> #include <GL/gluh> #include "auxh" static GLdouble toroidal_spin = 00; static GLdouble ball1_spin = 00; static GLdouble ball2_spin = 00; static GLdouble ball3_spin = 00; void initial(void) {
55 GLfloat light_diffuse[] = { 10, 10, 10, 10 ; GLfloat light_ambient[] = { 05, 05, 05, 10 ; GLfloat light_specular[] = { 10, 10, 10, 10 ; GLfloat light_position[] = { 10, 10, 10, 00 ; gllightfv(gl_light0, GL_AMBIENT, light_ambient); gllightfv(gl_light0, GL_SPECULAR, light_specular); gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); gllightfv(gl_light0, GL_POSITION, light_position); glenable(gl_lighting); glenable(gl_light0); gldepthfunc(gl_less); glenable(gl_depth_test); void set_mat_color(glfloat *diffuse, GLfloat *ambient, GLfloat *specular) { glmaterialfv(gl_front, GL_DIFFUSE, diffuse); glmaterialfv(gl_front, GL_AMBIENT, ambient); glmaterialfv(gl_front, GL_SPECULAR, specular); void display (void) { GLfloat diffuse0[] = { 10, 10, 10, 10 ; GLfloat ambient0[] = { 01, 01, 01, 10 ; GLfloat specular0[] = { 09, 09, 09, 10 ; GLfloat diffuse1[] = { 10, 10, 00, 10 ; GLfloat ambient1[] = { 01, 01, 00, 10 ; GLfloat specular1[] = { 09, 09, 00, 10 ; GLfloat diffuse2[] = { 10, 00, 10, 10 ; GLfloat ambient2[] = { 01, 00, 01, 10 ; GLfloat specular2[] = { 09, 00, 09, 10 ; GLfloat diffuse3[] = { 00, 10, 10, 10 ; GLfloat ambient3[] = { 00, 01, 01, 10 ; GLfloat specular3[] = { 00, 09, 09, 10 ; glclear( GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT ); glmaterialf (GL_FRONT, GL_SHININESS, 640); glpushmatrix(); gltranslatef(00, 00, -50); glrotatef(-700, 10, 00, 00); glrotatef(toroidal_spin, 00, 00, 10); glpushmatrix(); set_mat_color(diffuse0, ambient0, specular0); auxsolidtorus(02,10); glpushmatrix(); gltranslatef(10, 00, 00); glrotatef(900, 10, 00, 00); set_mat_color(diffuse1, ambient1, specular1); auxsolidtorus(015,05); glpushmatrix();
56 56 OpenGL glrotatef(ball1_spin, 00, 00, 10); gltranslatef(05, 00, 00); glrotatef(ball1_spin*5, 00, 10, 00); gltranslatef(018, 00, 00); set_mat_color(diffuse3, ambient3, specular3); auxsolidsphere(005); glpopmatrix(); glpopmatrix(); glpushmatrix(); glrotatef(1200, 00, 00, 10); gltranslatef(10, 00, 00); glrotatef(900, 10, 00, 00); set_mat_color(diffuse2, ambient2, specular2); auxsolidtorus(015,05); glpushmatrix(); glrotatef(ball2_spin, 00, 00, 10); gltranslatef(05, 00, 00); glrotatef(ball2_spin*5, 00, 10, 00); gltranslatef(018, 00, 00); set_mat_color(diffuse1, ambient1, specular1); auxsolidsphere(005); glpopmatrix(); glpopmatrix(); glpushmatrix(); glrotatef(2400, 00, 00, 10); gltranslatef(10, 00, 00); glrotatef(900, 10, 00, 00); set_mat_color(diffuse3, ambient3, specular3); auxsolidtorus(015,05); glpushmatrix(); glrotatef(ball3_spin, 00, 00, 10); gltranslatef(05, 00, 00); glrotatef(ball3_spin*5, 00, 10, 00); gltranslatef(030, 00, 00); set_mat_color(diffuse2, ambient2, specular2); auxsolidcube(020); glpopmatrix(); glpopmatrix(); glpopmatrix(); glpopmatrix(); glxswapbuffers(auxxdisplay(), auxxwindow()); void rotation(void) { toroidal_spin += 10; ball1_spin += 80; ball2_spin += 40; ball3_spin += 10; display();
57 void reshape(int width, int height) { GLdouble ang = 600; GLdouble near = 30; GLdouble far = 100; glviewport (0, 0, width, height); glmatrixmode (GL_PROJECTION); glloadidentity (); gluperspective (ang, (GLdouble)width/(GLdouble)height, near, far); glmatrixmode (GL_MODELVIEW); glloadidentity (); int main(int argc, char **argv) { auxinitdisplaymode (AUX_DOUBLE AUX_RGB AUX_DEPTH); auxinitposition (0, 0, 500, 500); auxinitwindow (argv[0]); initial(); auxreshapefunc (reshape); auxidlefunc(display); auxmainloop(rotation); n end of link animec / 231 OpenGL \ " OpenGL ( ) \ " (gltranslatef ) (gluperspective ) CompleXcope p15 simple3c glbegin(gl_points); for (i=0; i<6; i++) { x = cos(i*pi/3); y = sin(i*pi/3); glvertex3f(x, y, 00); glend();
58 58 OpenGL ( ) OpenGL ( ) OpenGL OpenGL glnewlist glendlist OpenGL GLuint int list_no = 1; glnewlist(list_no, GL_COMPILE); glendlist(); glcalllist(1); (1) (2) (3) (4)
59 circlesc /* * circlesc \* An OpenGL sample program - No Lighting - Display List */ #include <mathh> #include <GL/glh> #include <GL/gluh> #include "auxh" #define PI #define TWOPI (2*PI) GLuint list1 = 1; void initial(void) { int i; GLfloat x,y; glnewlist(list1, GL_COMPILE); glcolor3f(10, 10, 00); gltranslatef(15, 00, 00); glbegin(gl_line_loop); for (i=0; i<100; i++) { x = 08*cos(TWOPI*i/1000); y = 08*sin(TWOPI*i/100); glvertex3f(x,y,00); glend(); gltranslatef(-15, 00, 00); glrotatef(200, 00, 00, 10); gltranslatef(00, 00, -10); glendlist(); glshademodel(gl_flat); void display (void) { int i; glclear(gl_color_buffer_bit); gltranslatef (00, 00, -50); glpushmatrix(); for (i=0; i<200; i++) glcalllist(list1); glpopmatrix(); glflush();
60 60 OpenGL void reshape(int width, int height) { GLdouble ang = 600; GLdouble near = 30; GLdouble far = 10000; glviewport (0, 0, width, height); glmatrixmode (GL_PROJECTION); glloadidentity (); gluperspective (ang, (GLdouble)width/(GLdouble)height, near, far); glmatrixmode (GL_MODELVIEW); glloadidentity (); int main(int argc, char** argv) { auxinitdisplaymode (AUX_SINGLE AUX_RGB); auxinitposition (0, 0, 500, 500); auxinitwindow (argv[0]); initial(); auxreshapefunc (reshape); auxmainloop(display); n end of circlesc / OpenGL OpenGL GLuint glgenlists(1); n n GLuint glgenlists(n); n ` ` +1, ` +2, 111, ` + n p24 OpenGL ( ) CG
61 RGB GLubyte image[width][height][3] RGB (0 255) R,G,B WIDTH 2 HEIGHT WIDTH HEIGHT 2 64 OpenGL pict gif AVS (*x) AVS width height ARGB AVS width height ( A) Appendix D ( \texturesample256x256") OpenGL OpenGL Programming Guide [4, 5] width height texturec
62 62 OpenGL /* * texturec \* An OpenGL sample program - Texuture Mapping */ #include <stdioh> #include <GL/glh> #include <GL/gluh> #include "auxh" #define IMAGEWIDTH 256 #define IMAGEHEIGHT 256 char image[imagewidth][imageheight][3]; GLuint texidx = 1; void initial(void) { FILE *fp; fp = fopen("texturesample256x256","r"); if (fp==null) { printf(" open err; image file\n"); exit(9); fread(image, 1, IMAGEWIDTH*IMAGEHEIGHT*3, fp); fclose(fp); glpixelstorei(gl_unpack_alignment, 1); gltexenvf(gl_texture_env, GL_TEXTURE_ENV_MODE, GL_DECAL); gltexparameterf(gl_texture_2d, GL_TEXTURE_MAG_FILTER, GL_NEAREST); gltexparameterf(gl_texture_2d, GL_TEXTURE_MIN_FILTER, GL_NEAREST); gltexparameterf(gl_texture_2d, GL_TEXTURE_WRAP_S, GL_CLAMP); gltexparameterf(gl_texture_2d, GL_TEXTURE_WRAP_T, GL_CLAMP); glnewlist(texidx, GL_COMPILE); glteximage2d(gl_texture_2d, 0, 3, IMAGEWIDTH, IMAGEHEIGHT, 0, GL_RGB, GL_UNSIGNED_BYTE, &image[0][0][0]); glpushmatrix(); glbegin(gl_quads); gltexcoord2f(00, 10); glvertex3f(-10, -10, 00); gltexcoord2f(10, 10); glvertex3f( 10, -10, 00); gltexcoord2f(10, 00); glvertex3f( 10, 10, 00); gltexcoord2f(00, 00); glvertex3f(-10, 10, 00); glend(); glpopmatrix(); glendlist();
63 glclearcolor(0, 0, 0, 0); void display (void) { int i; glclear( GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT ); gldisable(gl_lighting); glenable(gl_texture_2d); gltranslatef (00, -25, -50); for (i=2; i>=-2; i--) { glpushmatrix(); glrotatef(i*200, 00, 00, 10); gltranslatef(00, 30, 00); glcalllist(texidx); glpopmatrix(); glflush(); void reshape(int width, int height) { GLdouble ang = 600; GLdouble near = 30; GLdouble far = 150; glviewport (0, 0, width, height); glmatrixmode (GL_PROJECTION); glloadidentity (); gluperspective (ang, (GLdouble)width/(GLdouble)height, near, far); glmatrixmode (GL_MODELVIEW); glloadidentity (); int main(int argc, char **argv) { auxinitdisplaymode (AUX_SINGLE AUX_RGB AUX_DEPTH); auxinitposition (0, 0, 500, 500); auxinitwindow (argv[0]); initial(); auxreshapefunc (reshape); auxmainloop(display); n end of texturec /
64 64 OpenGL
65 3 CAVE 31 CompleXcope CompleXcope OpenGL CAVE CAVE x SGI ONYX, 4 x CPU R4400, Main mem 512MB, 3 x Reality Engine II Ascention Technology "Flock of Bird" 9 32 CompleXcope VR ONYX CAVE CAVE CAVE CAVE /usr/local/cave 65
66 66 CAVE /usr/local/cave/include /usr/local/cave/lib /usr/local/cave/bin 34 CAVE CAVE +x +y +z / y / / / / / / x / / / / / / / / z / / / / / / CompleXcope -5 <= x <= +5 0 <= y <= <= z <= CompleXcope
67 36 Conguration File 67 1 display process (1) 2 display process (2) 3 display process (3) 4 application computation process 5 tracking process display process CompleXcope display process application computation process CAVE tracking process ONYX (shared memorry) 36 Conguration File CAVE caverc conguration le # sample of caverc simulator y DisplayMode mono conguration le CAVE simulator on VR CompleXcope ONYX DisplayMode mono CompleXcope CAVE con- guration le 1 ( ) /usr/local/cave/etc/caveconfig /usr/local/cave/etc/asoconfig ~/caverc /caverc (CompleXcope ) ~/caverc /caverc (# ) 37 CompleXcope (1) (Optional) CompleXcope CompleXcope CAVE ( ) 1 aso CompleXcope ONYX host name
68 CAVE (2) (Required) CAVE conguration CAVE conguration le conguration le (3) (Optional) (4) (Required) CAVE (5) (Optional) OpenGL display process application computation process tracking process fork CAVE 76 OpenGL ( ) 4 fork ( ) display process CAVE 5 (6) (Required) display (7) (Optional) computation 7 OpenGL display process CAVE (8) (Required) CAVE 7 38 CAVE CompleXcope CompleXcope CAVE CAVE CAVE X Window CAVE conguration le simulator y 2 CAVE CompleXcope CAVE 2 on
69 39 69 CAVE left arrow right arrow Up arrow Down arrow Shift + up arrow Shift + donw arrow Alt + left arrow Alt + right arrow Alt + up arrow Alt + down arrow p move left move right move forward move backward move up move down rotate left rotate right rotate up rotate down reset head and wand to initial CAVE Cntl + mouse movement move wnad left/right/forward/back Shift + mouse movement move wand left/right/up/down Alt + mouse movement rotate wand/left/right/up/down < and > rotate wand about Z Home reset wand to be in front of user F1/F2/F3/ select wand 1/2/3/ as the current wand CAVE mouse left button mouse middle button mouse right button Space + mouse movement wand left button wand middle button wand right button joystick CAVE 1 CAVE 2 CAVE w / u / INSERT CAVE / 39 p42 OpenGL torusc ( ) CompleXcope VR
70 CAVE Xtorusc /* * Xtorusc \* A CompleXcope sample program - A torus by aux lib; 4 feet off the floor - Copied and changed from /usr/local/cave/src/ogl/ballc - No animation - No interaction - No navigation */ #include <cave_oglh> /* init_gl - GL initialization function This function will be called exactly once by each of the drawing processes, at the beginning of the next frame after the pointer to it is passed to CAVEInitApplication It defines and binds the light and material data for the rendering */ void init_gl(void) { GLfloat mat_diffuse[] = { 10, 10, 10, 10 ; GLfloat mat_ambient[] = { 01, 01, 01, 10 ; GLfloat mat_specular[] = { 09, 09, 09, 10 ; GLfloat light_diffuse[] = { 10, 10, 10, 10 ; GLfloat light_ambient[] = { 05, 05, 05, 10 ; GLfloat light_specular[] = { 10, 10, 10, 10 ; GLfloat light_position[] = { 10, 10, 10, 00 ; glclearcolor(0, 0, 0, 0); gllightfv(gl_light0, GL_AMBIENT, light_ambient); gllightfv(gl_light0, GL_SPECULAR, light_specular); gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); gllightfv(gl_light0, GL_POSITION, light_position); glmaterialfv(gl_front_and_back, GL_DIFFUSE, mat_diffuse); glmaterialfv(gl_front_and_back, GL_AMBIENT, mat_ambient); glmaterialfv(gl_front_and_back, GL_SPECULAR, mat_specular); glmaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 640); glenable(gl_light0); /* draw_torus - the display function This function is called by the CAVE library in the rendering processes' display loop It draws a torus 4 feet off the floor */ void draw_torus(void) { glclear(gl_depth_buffer_bit GL_COLOR_BUFFER_BIT);
71 39 71 glenable(gl_lighting); glpushmatrix(); gltranslatef(00, 40, -20); auxsolidtorus(02,10); glpopmatrix(); gldisable(gl_lighting); main(int argc,char **argv) { /* Initialize the CAVE */ CAVEConfigure(&argc,argv,NULL); CAVEInit(); /* Give the library a pointer to the GL initialization function */ CAVEInitApplication(init_gl,0); /* Give the library a pointer to the drawing function */ CAVEDisplay(draw_torus,0); /* Wait for the escape key to be hit */ while (!CAVEgetbutton(CAVE_ESCKEY)) sginap(10); /* Nap so that this busy loop doesn't waste CPU time */ /* Clean up & exit */ CAVEExit(); n end of Xtorusc / \CAVE" CAVE CAVEConfigure() Configuration CAVEInit() CAVE fork CAVEInitApplication() OpenGL init_gl() ( ) OpenGL CAVEDisplay() draw_torus() ( )OpenGL
72 72 CAVE CAVEgetbutton(CAVE_ESCKEY) ESC hit sginap() CAVEExit() 310 Xtoursc \auxsolidtorus" \auxsolidsphere" Xballc aux 7 glu (p33 ) /* * Xballc \* A CompleXcope sample program - A ball by the glu lib; 1 feet radius, 4 feet off the floor - Copied and changed from /usr/local/cave/src/ogl/ballc - No animation - No interaction - No navigation */ #include <cave_oglh> #include <GL/gluh> static GLUquadricObj *sphereobj; /* init_gl - GL initialization function This function will be called exactly once by each of the drawing processes, at the beginning of the next frame after the pointer to it is passed to CAVEInitApplication It defines and binds the light and material data for the rendering, and creates a quadric object to use when drawing the sphere */ void init_gl(void) { GLfloat mat_diffuse[] = { 10, 10, 10, 10 ; GLfloat mat_ambient[] = { 01, 01, 01, 10 ; GLfloat mat_specular[] = { 09, 09, 09, 10 ; GLfloat light_diffuse[] = { 10, 10, 10, 10 ; GLfloat light_ambient[] = { 05, 05, 05, 10 ; GLfloat light_specular[] = { 10, 10, 10, 10 ;
73 GLfloat light_position[] = { 10, 10, 10, 00 ; glclearcolor(0, 0, 0, 0); gllightfv(gl_light0, GL_AMBIENT, light_ambient); gllightfv(gl_light0, GL_SPECULAR, light_specular); gllightfv(gl_light0, GL_DIFFUSE, light_diffuse); gllightfv(gl_light0, GL_POSITION, light_position); glmaterialfv(gl_front, GL_DIFFUSE, mat_diffuse); glmaterialfv(gl_front, GL_AMBIENT, mat_ambient); glmaterialfv(gl_front, GL_SPECULAR, mat_specular); glmaterialf (GL_FRONT, GL_SHININESS, 640); glenable(gl_light0); sphereobj = glunewquadric(); /* draw_ball - the display function This function is called by the CAVE library in the rendering processes' display loop It draws a ball 1 foot in radius, 4 feet off the floor, and 2 foot in front of the front wall (assuming a 10' CAVE) */ void draw_ball(void) { glclear(gl_depth_buffer_bit GL_COLOR_BUFFER_BIT); glenable(gl_lighting); glpushmatrix(); gltranslatef(00, 40, -30); glusphere(sphereobj, 10, 16, 16); glpopmatrix(); gldisable(gl_lighting); main(int argc,char **argv) { /* Initialize the CAVE */ CAVEConfigure(&argc,argv,NULL); CAVEInit(); /* Give the library a pointer to the GL initialization function */ CAVEInitApplication(init_gl,0); /* Give the library a pointer to the drawing function */ CAVEDisplay(draw_ball,0); /* Wait for the escape key to be hit */ while (!CAVEgetbutton(CAVE_ESCKEY)) sginap(10); /* Nap so that this busy loop doesn't waste CPU time */ /* Clean up & exit */ CAVEExit(); n end of Xballc /
libaux.dvi
AUX OpenGL 1 OpenGL (AUX libaux.a) OpenGL Programming Guide () OpenGL 1 OpenGL OS (API) OS OS OS OpenGL Windows Windows X X OpenGL Programming Guide AUX toolkit AUX OS OpenGL SGI OpenGL OS OpenGL AUX Windows
More information/*p7-1-1*/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 /* e8.c Copyright (c) 2003 by T. HAYASHI and
More informationOpenGL & GLUTの基本関数の説明
コンピュータグラフィックス S 演習資料 OpenGL & GLUT の基本関数の説明 1. OpenGL & GLUT 2. GLUT 2.1. GLUT void glutinit( int argc, char ** argv ); glut void glutinitdysplaymode( unsigned int mode ); mode void glutinitwindowsize(
More information1 1. Program 1 OpenCV (OpenCV Sample001) 1 /* 2 - > - > - >VC++ 3 ( ) 4 C:\opencv\build\include 5 ( ) 6 C:\opencv\build\x86\vc10\lib 7 - > - > - > - >
1 1. Program 1 OpenCV (OpenCV Sample001) 1 /* 2 - > - > - >VC++ 3 ( ) 4 C:\opencv\build\include 5 ( ) 6 C:\opencv\build\x86\vc10\lib 7 - > - > - > - > 8 (240 O p e n C V ) 9 opencv_core240d.lib 10 opencv_imgproc240d.lib
More information2 2 GLUI 2 GLUI 2.1 GLUI GLUI OpenGL OpenGL glut OpenGL glut C++ Linux, Windows (Visual C++, gcc), Macintosh glut glut GUI glut GUI CG glmultmatrix()
1 20 (2) OpenGL+GUI(GLUI) 3DCG TA 2008 10 27 1 OpenGL OpenGL GUI GLUI 1.1 http://www.cyber.t.u-tokyo.ac.jp/~kuni/enshu2008/ 1.2 TA 1.3 2008/12/4( ) EyeToy 2 2 GLUI 2 GLUI 2.1 GLUI GLUI OpenGL OpenGL glut
More information3D グラフィックス処理の一般過程 1. 3D グラフィックス処理の一般過程
3. 3D ビューイング 1. 3Dグラフィックス処理の一般過程 2. 射影と射影変換 3. ビューボリュームとクリッピング 4. 陰面処理とデプスバッファ 5. ビューポート変換 6. 3Dグラフィックスを描く 7. モデルビュー変換 3D グラフィックス処理の一般過程 1. 3D グラフィックス処理の一般過程 3D グラフィックス処理の一般過程 1. モデリング変換 座標系の異なる複数のオブジェクトを仮想世界に配置し,
More information第7章 レンダリング
7 April 11, 2017 1 / 59 7.1 ( ) CG 3 ( ) 2 / 59 7.2 7.2.1 ( ) 3 (rendering) 1 / (hidden line/surface calculation) a (outer normal algorithm) b Z (Z-buffer algorithm) c (scan-line algorithm) 2 (shading)
More information#include <stdio.h> 2 #include <stdlib.h> 3 #include <GL/glut.h> 4 Program 1 (OpenGL GameSample001) 5 // 6 static bool KeyUpON = false; // 7 sta
1 1. 1 #include 2 #include 3 #include 4 Program 1 (OpenGL GameSample001) 5 // 6 static bool KeyUpON = false; // 7 static bool KeyDownON = false; // 8 static bool KeyLeftON
More informationuntitled
2004/12/21 2/2 (11/16) DT-MRI (11/30) /OpenGL 12/7 12/14 (12/21) 1/11 (1/18) OpenGL ~ ~ OpenGL Silicon Graphics, OpenGL ~ ~ OpenGL OpenGL Utility Library (GLU) OpenGL. OpenGL. OpenGL Utility Toolkit (GLUT)
More information第7章 レンダリング
7 May 18, 2012 1 / 60 71 ( ) CG 3 ( ) 2 / 60 72 71 ( ) 3 (rendering) 1 / (hidden line/surface calculation) a (outer normal algorithm) b Z (Z-buffer algorithm) c (scan-line algorithm) 2 (shading) a (flat
More information2 2 2 OpenGL (R,G,B,A) 2.1 OpenGL (x y) width height pixels void glreadpixels(glint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum t
1 22 (2) OpenGL+GUI(GLUI) 3DCG TA 2010 10 18 1 OpenGL OpenGL GUI GLUI 1.1 http://www.cyber.t.u-tokyo.ac.jp/~kuni/enshu2010/ 1.2 TA 1.3 2010/12/6( ) USB 2 2 2 OpenGL (R,G,B,A) 2.1 OpenGL (x y) width height
More information第3章 OpenGL の基礎
3 OpenGL April 11, 2017 1 / 28 3.1 ( ) OpenGL OpenGL 2 / 28 3.2 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc. 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh
More information第3章 OpenGL の基礎
3 OpenGL April 20, 2012 1 / 23 31 ( ) OpenGL OpenGL 2 / 23 32 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh CAD
More information1 3 2 OpenGL 4 3 OpenGL 5 4 OpenGL 6 OpenGl : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 6 : : : : : : : : : : : : : : : : : : : : :
1999 OpenGL S96M501 S96M596 S96M649 1 3 2 OpenGL 4 3 OpenGL 5 4 OpenGL 6 OpenGl : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 6 : : : : : : : : : : : : : : : : : : : : : 7 5 10 OpenGL :
More information謗域・ュ逕ィppt
情報工学 2017 年度後期第 5 回 [11 月 1 日 ] 静岡大学 工学研究科機械工学専攻ロボット 計測情報講座創造科学技術大学院情報科学専攻 三浦憲二郎 講義日程 第 6 回 11 月 8 日画像処理パート第 1 回 第 7 回 11 月 15 日 CGパート第 6 回 第 8 回 11 月 22 日 CGパート第 7 回 第 9 回 11 月 29 日 CGパート試験 講義アウトライン [11
More information/* drawing function */ function_graph();// drawing graph glflush(); int main(int argc, char **argv ) glutinit( &argc, argv ); glutinitdisplaymode( GLU
OpenGL ( ) #include #include #define PI 3.14159265 void function_graph() int j; float x, y; glbegin( GL_LINE_STRIP );// sine curve by line glcolor3f( 0.0f, 1.0f, 1.0f );// line color
More informationOpenGL Programming Course OpenGL Programming Course FAQ
OpenGL NK EXA Corporation OpenGL@dst.nk-exa.co.jp OpenGL@dst.nk-exa.co.jp OpenGL FAQ (http://www.nk-exa.co.jp/mmtech/opengledu/faq.shtml) i 1 OpenGL 1{1 1.1 OpenGL : : : : : : : : : : : : : : : : : : :
More informationFair Curve and Surface Design System Using Tangent Control
情報工学 2016 年度後期第 6 回 [11 月 16 日 ] 静岡大学工学研究科機械工学専攻ロボット 計測情報講座創造科学技術大学院情報科学専攻 三浦憲二郎 講義アウトライン [11 月 16 日 ] ビジュアル情報処理 3 モデリング 3.3 曲線 曲面 OpenGL 色の取り扱い シェーディング 照明モデルと照光処理 拡散光 鏡面光 環境光 ビジュアル情報処理 3-3 曲線 曲面 3-3-1
More informationGraphics Performance Tuning () Z 2
All Titles White, 54 Point, OpenGL Bold Italic, Performance Helvetica Narrow, 2 Point Leading Tuning Nihon Silicon Graphics K.K. Sales Division Graphics Grp Systems Engineer Takehiko Terada 1995/07/20
More information2 2 OpenGL ( ) OpenGL ( ) glclearcolor(glclampf red, GLclampf green, GLclampf
1 24 (1) OpenGL TA 2012 10 11 1 C OpenGL (3DCG) OS Linux OS 3DCG OpenGL GUI GLUT OpenGL GLUT GLUI 3DCG 3DCG 1.1 1 3DCG 3DCG GUI 2 3DCG 10/10( ) 11/11( ) 3DCG OpenGL OpenGL+GUI(GLUI) 3DCG 3DCG 1.2 TA 2
More informationNB
JAPLA 研究会資料 2010/2/27 J の OpenGL グラフィックス - その 7 - フラー ドームと照光表示 - 西川利男 0. はじめに OpenGL 正多面体グラフィックスとして 今回はフラー ドームに挑戦してみた バックミンスター フラー (Richard Buckminster Fuller, 1895-1983 は多才な建築家 科学者 思想家として知られ その名前を冠した
More information2 3 OpenGL 2 OpenGL OpenGL(Open Graphics Library) Silicon Graphics (SGI) 3D OpenGL SGI HP, SUN, IBM UNIX Linux, FreeBSD PC UNIX Windows, Mac OS API PD
1 2015 5-1 2015 6 22 1 3DCG 3DCG 3DCG OpenGL OS Linux(Ubuntu) 1.1 TA 1.2 http://www.cyber.t.u-tokyo.ac.jp/~tani/class/mech_enshu/ 2 3 OpenGL 2 OpenGL OpenGL(Open Graphics Library) Silicon Graphics (SGI)
More information2 2 OpenGL ( ) 2 OpenGL ( ) glclearcolor(glclampf red, GLclampf green, GLclampf blu
1 27 (1) OpenGL TA 2015 9 29 1 C OpenGL (3DCG) OS Linux OS 3DCG OpenGL 3DCG 3DCG 1.1 1 3DCG 3DCG 2 3DCG GUI AR 9/29( ) 10/1( ) 3DCG OpenGL 3DCG 3DCG 1.2 TA 1.3 2 2 OpenGL ( ) http://www.cyber.t.u-tokyo.ac.jp/~tani/class/mech_enshu/
More information2 2 OpenGL OpenGL OpenGL(Open Graphics Library) Silicon Graphics (SGI) 3D OpenGL SGI HP, SUN,
1 20 (1) OpenGL TA 2008 10 20 1 C OpenGL (3DCG) OS Linux (Open SUSE 10.3) 3DCG OpenGL GUI GLUT OpenGL GLUT GLUI USB EyeToy 1.1 1 3DCG 2 3DCG GUI 2 USB EyeToy) 10/20( ) 10/27( ) 3DCG OpenGL OpenGL+GUI(GLUI)
More information19_OpenGLES.key
CS193P - Lecture 19 iphone Application Development OpenGL ES 1 Announcements Final projects due in 7 days Tuesday, March 16th 11:59 pm Submit: Code Power-point/Keynote slides ReadMe file Final project
More information2 2 2 OpenGL (R,G,B,A) 2.1 OpenGL (x y) width height pixels void glreadpixels(glint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum t
1 24 (2) 3DCG TA 2012 10 12 1 OpenGL USB (3DCG) OpenCV 1.1 http://www.cyber.t.u-tokyo.ac.jp/~tani/class/mech_enshu/ 1.2 TA 1.3 USB (2012/11/19( ),20( )) USB 2 2 2 OpenGL (R,G,B,A) 2.1 OpenGL (x y) width
More informationJAPLAシンポジウム資料 2009/12/5
JAPLA シンポジウム資料 2009/12/5 J の OpenGL グラフィックス - その 5 - 正 12 面体と正 20 面体を動かす - 西川利男 正 12 面体と正 20 面体との頂点座標が別報 [1] のように計算されたので それを用いて J の OpenGL により 3 D グラフィックス図形を描き いろいろ動かしてみる 1. 正 12 面体と正 20 面体の J プログラム (J402
More information演算増幅器
コンピュータグラフィックス 2 前回は GLUT を使った簡単な 2 次元グラフィックスについて習った 今週は以下の項目について 補足していく イベント駆動型プログラムの動作について コンピュータグラフィックスの座標系 イベント駆動型プログラム従来のプログラムとの違いこれまでに学習してきたプログラムは上から下に順次実行され 条件分岐や繰り返し処理によって プログラムの流れ (flow: フロー )
More informationコンピュータグラフィックスS 演習資料
コンピュータグラフィックス S 演習資料 第 4 回シェーディング マッピング 九州工業大学情報工学部システム創成情報工学科講義担当 : 尾下真樹 1. 演習準備 今回の演習も 前回までの演習で作成したプログラムに続けて変更を行う まずは シェーディングの演習のため 描画処理で 回転する一つの四角すいを描画するように変更する 画面をクリア ( ピクセルデータと Z バッファの両方をクリア ) glclear(
More informationJAPLA研究会資料 /6/15
JAPLA 研究会資料 20013/6/15 J-OpenGL による 3D グラフィックス - その 10 * メビウスの帯へ向けて -J-OpenGL をどう理解するか - 西川 利男 J で OpenGL を利用することで高度の三次元グラフィックスの処理が可能となった 前回の例会で志村正人氏よりメビウスの帯やクラインの壷など アートとして眺めるだけでも楽しいグラフィックスがいろいろ紹介された
More information$ ls -l $ ls -l -a $ ls -la $ ls -F $ ls <dirname> <dirname> $ cd <dirname> <dirname> $ cd $ pwd $ cat <filename> <filename> $ less <filename> <filena
$ pwd /home1/t0/t0903 / / /home1/t0/t0903 / / /home1/t0/t0903 / /... ~ $ ls $ ls -a $ ls -l $ ls -l -a $ ls -la $ ls -F $ ls $ cd $ cd $ pwd $ cat
More information2 : 2008/12/ /01/ G :
2 : 2008/12/08 2008/01/16 075730G : 1 project draw main.cpp 1 draw main.cpp /* * main.cpp * draw * * Created by C-T on 08/12/08. * Copyright 2008 MyCompanyName. All rights reserved. * */ #include
More informationj x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E
8 9 7 6 4 2 3 5 1 j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E a n 1 H = ae l j, j=1 l j = x j+1 x j, x n x 1 = n 1 j=1 l j, l j = ±l l > 0) n 1 H = ϵ l j, j=1 ϵ e x x
More informationdouble rx[natom], ry[natom], rz[natom]; 原子の座標 速度 力 ポテンシャルエ double vx[natom], vy[natom], vz[natom]; ネルギーを受ける配列を準備 double fx[natom], fy[natom], fz[natom
GLUI による MD の GUI 化 前提条件 :GLUI のプログラミング環境が整っていること 3 原子の MD コード ( 下図 ) viewer ウィンドウ内のマウス左クリックで MD 開始 右クリックで MD 停止 control パネルは solid/wireframe を切り替えるチェックボタン 球の滑らかさと半径を決める窓 ( スピナー ) オブジェクトを回転 移動 拡大縮小させるコントローラ
More informationイントロダクション
プログラミング演習 IV 第 8 回 OpenCV とテクスチャマッピング物体の発光や透過 埼玉大学情報システム工学科 小林貴訓 OpenCV PC で画像処理を行うライブラリ インテル社の画像処理ライブラリが起源 2000 年頃に最初のバージョン CPU でも画像処理ができることを見せたかった? Open 化して, 現在は Willow Garage( ウィロー ガレージ ) が開発を行っている
More informationコンピュータグラフィックス特論Ⅱ
コンピュータグラフィックス特論 Ⅱ 第 2 回 OpenGL プログラミングの基礎 九州工業大学尾下真樹 今日の内容 OpenGL プログラミングの基礎 C 言語 +OpenGL+GLUT によるプログラミング 座標変換の基礎 アフィン変換行列を使った視野変換の設定 いずれも 学部の講義 ( レベルの内容 ) の復習 今日の内容 OpenGL&GLUTの概要 サンプルプログラムの概要 座標変換 変換行列の設定
More information謗域・ュ逕ィppt
情報工学 212 年度後期第 5 回 [1 月 31 日 ] 静岡大学 創造科学技術大学院情報科学専攻工学部機械工学科計測情報講座 三浦憲二郎 講義日程 第 8 回 11 月 21 日 ( 水 ) CG パート試験 講義アウトライン [1 月 31 日 ] ビジュアル情報処理 1.3.4 投影変換 1.3.5 いろいろな座標系と変換 OpenGL 投影変換 曲線の描画 トロコイド ( 外トロコイドと内トロコイド
More informationコンピュータグラフィックス特論Ⅱ
今日の内容 コンピュータグラフィックス特論 Ⅱ 第 2 回 OpenGL プログラミングの基礎 九州工業大学尾下真樹 OpenGL プログラミングの基礎 C 言語 +OpenGL+GLUT によるプログラミング 座標変換の基礎 アフィン変換行列を使った視野変換の設定 いずれも 学部の講義 ( レベルの内容 ) の復習 今日の内容 OpenGL&GLUTの概要 サンプルプログラムの概要 座標変換 変換行列の設定
More informationMicrosoft Word - mediaJikkenCG_no2_2007.doc
2007 年度メディア情報学実験 1 CG テキスト第 2~4 週 :OpenGL ライブラリを使った 3 次元 CG プログラミング立命館大学情報理工学部メディア情報学科 1. 実験の目的と手順本実験は,(1)OpenGLライブラリを用いたCGプログラミングの手法を学ぶ,(2) プログラミングを通して, CGの基礎技術を体験的に学ぶ,(3) インタラクティブな3 次元 CGアニメーションを作成する方法について学ぶ,
More informationMicrosoft PowerPoint - info_eng3_05ppt.pptx
インタラクティブシステム構築法 第 5 回 OpenGL と GLUT の使い方 (3) 埼玉大学情報システム工学科小林貴訓 シェーディング 光源の設定を有効にする glenable(gl_lighting); // 光源の設定を有効にする glenable(gl_light0); //0 番目の光源を有効にする (8 個まで設定可能 ) 光源の位置 GLfloat light0pos[] = {
More informationKageyama (Kobe Univ.) 2015.06.23 2 / 41
2015 2015.06.23 Kageyama (Kobe Univ.) 2015.06.23 1 / 41 Kageyama (Kobe Univ.) 2015.06.23 2 / 41 [ 1, +1] [ 1, +1] [ 1, +1] Kageyama (Kobe Univ.) 2015.06.23 3 / 41 Kageyama (Kobe Univ.) 2015.06.23 4 / 41
More information謗域・ュ逕ィppt
情報工学 217 年度後期第 4 回 [1 月 25 日 ] 静岡大学 工学研究科機械工学専攻ロボット 計測情報講座創造科学技術大学院情報科学専攻 三浦憲二郎 ローカル座標系による移動 講義アウトライン [1 月 25 日 ] ビジュアル情報処理 1.3.4 投影変換 1.3.5 いろいろな座標系と変換 OpenGL 投影変換 曲線の描画 トロコイド ( 外トロコイドと内トロコイド ) 頂点変換の手順
More information2 2 2 OpenGL Linux Linux Video for Linux(Video4Linux, v4l ) API Video4Linux USB IEEE1394 API Linux Video for Linux 2(Video4Linux2, v4l2 ) OpenCV API U
1 26 (2) 3DCG TA 2014 10 17 1 OpenGL USB (3DCG) OpenCV CG Augmented Reality ARToolKit 3DCG 1.1 http://www.cyber.t.u-tokyo.ac.jp/~tani/class/mech_enshu/ 1.2 TA 1.3 ( ) USB (2014/11/10( ),11( ),13( )) (2012/11/17(
More informationPowerPoint Presentation
8-1 8. テクスチャマッピング 8.1. テクスチャマッピングの原理 狭義には, 図のように, 与えられた画像を物体に貼り付ける方法. マッピングには投影法, 極座標変換, パラメータマッピングなどがある (1 年 コンピュータ グラフィックス ). 広義にはバンプマッピングなども含まれる. t y s z x 8-2 8.2. テクスチャマッピングの設定方法 全体の流れ 1) 原図ビットマップデータを内部形式に変換
More informationJAPLA研究会資料 2013/5/25
JAPLA 研究会資料 2013/5/25 J-OpenGL による 4 進フラクタル立体木のグラフィックス 西川利男 今年の大学センター試験の出題をきっかけとして 3 進法およびそれを活用した 3 進フラクタル木の J プログラムについて先に報告した [1][2] 図形表示の値を 3 進法で表すことで フラクタル木のグラフィックスが ごく自然に行われた それでは 4 進法ではどうだろうか? 同じ発想を展開すると
More informationWebGL OpenGL GLSL Kageyama (Kobe Univ.) Visualization / 57
WebGL 2014.04.15 X021 2014 3 1F Kageyama (Kobe Univ.) Visualization 2014.04.15 1 / 57 WebGL OpenGL GLSL Kageyama (Kobe Univ.) Visualization 2014.04.15 2 / 57 WebGL Kageyama (Kobe Univ.) Visualization 2014.04.15
More informationTekutama AR ~ 拡張現実感によるオーバーレイ表示と動作 ~ 情報物理研究室 渡部 修平 1
Tekutama AR ~ 拡張現実感によるオーバーレイ表示と動作 ~ 情報物理研究室 渡部 修平 1 目次 項 1. はじめに 3 2. 開発環境 4 2-1. ARToolkit 4 2-2. OpenGL GLUT 5 2-3. Metasequoia 6 2-4. GLMetaseq 6 3. 3DCG モデルの作成 7 4. AR プログラムの構成 9 4-1. main 関数 10 4-2.
More informationMicrosoft Word - mediaJikkenCG_no2_2012.doc
2012 年度メディア情報学実験 1 CG テキスト第 2~5 週 :OpenGL ライブラリを使った 3 次元 CG プログラミング立命館大学情報理工学部メディア情報学科 1. 実験の目的と手順本実験は,(1)OpenGLライブラリを用いたCGプログラミングの手法を学ぶ,(2) プログラミングを通して, CGの基礎技術を体験的に学ぶ,(3) インタラクティブな3 次元 CGアニメーションを作成する方法について学ぶ,
More informationJAPLA研究会資料 2012/8/2
JAPLA 研究会資料 2012/8/2 ローレンツなどカオスの 3D グラフィックス J-OpenGL により カオスの実行を段階的に観察する 西川利男 ローレンツ レスターなどカオスの図形は 志村氏により J の簡便かつ強力なグラフィックス機能を示す例としてたびたび紹介されている これらのカオス現象の物理は それ自身私にとってもおおいに興味をそそられるテーマである J の OpenGL グラフィックスを用いて
More informationJAPLA研究会資料 2010/4/24
JAPLA 研究会資料 2010/4/24 J の OpenGL グラフィックス - その 8 Texture によるパターンの貼り付け - サイコロを作って動かす - 西川利男 0. はじめにこれまで OpenGL グラフィックスもいろいろやってきた [1]~[7] OpenGL の Texture 機能を利用したパターンの貼り付け処理はさまざまな用途に使われる 今回はこれを利用してサイコロを作ってみた
More information2009 2010 2 23 (MHD ) GFV (Galium Field Visualizer) GFV OpenGL GFV GFV GFV 1 1 2 2 2.1.................... 2 2.2................................. 2 2.3...................... 3 3 6 3.1 GFV....................
More informationOpenGL GLSL References Kageyama (Kobe Univ.) Visualization / 58
WebGL *1 2013.04.23 *1 X021 2013 LR301 Kageyama (Kobe Univ.) Visualization 2013.04.23 1 / 58 OpenGL GLSL References Kageyama (Kobe Univ.) Visualization 2013.04.23 2 / 58 Kageyama (Kobe Univ.) Visualization
More informationMicrosoft Word - opengl講義資料2013.doc
[OpenGL:1] OpenGL とは 1.OpenGL とは何か? 米国 Silicon Graphics 社 (SGI) が中心となって開発した 3 次元グラフィックスライブラリである.SGI はグラフィックスに特化したワークステーション (GWS) の開発を積極的に行い, 自社の GWS 上で稼動するグラフィックスライブラリ IRIS GL を開発したが, その後, この仕様を公開したライブラリとして
More informationコンピューターグラフィックスS
コンピューターグラフィックス S 第 12 回シェーディング マッピング システム創成情報工学科尾下真樹 2018 年度 Q2 今回の内容 前回の復習 シェーディング 光のモデル スムーズシェーディング シェーディング ( 続き ) OpenGL での光源情報の設定 ラジオシティ 影の表現 BRDF マッピング 今回の内容 シェーディング 光の効果の表現 マッピング 生成画像 表面の素材の表現 オブジェクト
More information3. OpenGL を利用するための準備作業 1) Tao Framework をダウンロードしてインストールする. Download から taoframework setup.exe をダウン
[OpenGL:1] OpenGL とは 1.OpenGL とは何か? 米国 Silicon Graphics 社 (SGI) が中心となって開発した 3 次元グラフィックスライブラリである.SGI はグラフィックスに特化したワークステーション (GWS) の開発を積極的に行い, 自社の GWS 上で稼動するグラフィックスライブラリ IRIS GL を開発したが, その後, この仕様を公開したライブラリとして
More informationMicrosoft Word - opengl講義資料ha.doc
[OpenGL:1] OpenGL とは 1.OpenGL とは何か? 米国 Silicon Graphics 社 (SGI) が中心となって開発した 3 次元グラフィックスライブラリである.SGI はグラフィックスに特化したワークステーション (GWS) の開発を積極的に行い, 自社の GWS 上で稼動するグラフィックスライブラリ IRIS GL を開発したが, その後, この仕様を公開したライブラリとして
More information準備 計算結果を可視化するために OpenGL を 利用する. 2
2. 2 次元粒子法シミュレーション (+ 少しだけ OpenGL) 茨城大学工学部 教授乾正知 準備 計算結果を可視化するために OpenGL を 利用する. 2 OpenGL 3 次元コンピュータグラフィックス用の標準的なライブラリ. 特に CAD やアート, アニメーション分野 ( ゲーム以外の分野 ) で広く利用されている. OpenGL は仕様がオープンに決められており, 企業から独立した団体が仕様を管理している.
More informationDrawArrays DrawElements References Kageyama (Kobe Univ.) Visualization / 34
WebGL *1 DrawArrays DrawElements 2013.05.14 *1 X021 2013 LR301 Kageyama (Kobe Univ.) Visualization 2013.05.14 1 / 34 DrawArrays DrawElements References Kageyama (Kobe Univ.) Visualization 2013.05.14 2
More informationadv99_4.PDF
Advanced Graphics Programing Techniques Using OpenGL Section 6 Texture Mapping (page 40 77) 1 6 Texture Mapping(1) 2 6 Texture Mapping(2) ( ) ( ) OpenGL 3 6.1 Texture Basics 4 6.1.1 The Texture Image(1)
More informationKageyama (Kobe Univ.) / 36
DrawArrays DrawElements 05 1 2015.05.19 Kageyama (Kobe Univ.) 2015.05.19 1 / 36 Kageyama (Kobe Univ.) 2015.05.19 2 / 36 Kageyama (Kobe Univ.) 2015.05.19 3 / 36 Web アプリ HTML + CSS + JavaScript + シェーダソースコード
More informationコンピュータグラフィックスS 演習資料
2015/5/26 コンピュータグラフィックスS 演 習 資 料 第 2 回 ポリゴンモデルの 描 画 九 州 工 業 大 学 情 報 工 学 部 システム 創 成 情 報 工 学 科 講 義 担 当 : 尾 下 真 樹 1. 準 備 : 前 回 の 演 習 本 日 の 演 習 は 前 回 の 演 習 で 作 成 したプログラムを 引 き 続 き 修 正 していく もし 前 回 の 演 習 を 行
More information2
L C -24K 9 L C -22K 9 2 3 4 5 6 7 8 9 10 11 12 11 03 AM 04 05 0 PM 1 06 1 PM 07 00 00 08 2 PM 00 4 PM 011 011 021 041 061 081 051 071 1 2 4 6 8 5 7 00 00 00 00 00 00 00 00 30 00 09 00 15 10 3 PM 45 00
More informationHIS-CCBASEver2
Information Access Interface in the Immersive Virtual World Tetsuro Ogi, *1*2*3 Koji Yamamoto, *3*4 Tadashi Yamanouchi *3 and Michitaka Hirose *2 Abstract - In this study, in order to access database server
More information( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h>
2007 12 5 1 2 2.1 ( ) 1 1: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #define H WIN 400 // 8 #define W WIN 300 // 9
More information1) OOP 2) ( ) 3.2) printf Number3-2.cpp #include <stdio.h> class Number Number(); // ~Number(); // void setnumber(float n); float getnumber();
: : :0757230G :2008/07/18 2008/08/17 1) OOP 2) ( ) 3.2) printf Number3-2.cpp #include class Number Number(); // ~Number(); // void setnumber(float n); float getnumber(); private: float num; ;
More informationJAPLA研究会資料 2017/5/20
JAPLA 研究会資料 2017/5/20 J-OpenGL による 3D- グラフィックス - その 13-3 次元空間での錯視 - 西川利男 はじめに私がボランティアとして出ている日本科学未来館で 現在 (5/20 まで 錯視 というテーマをやっている その中で 杉原厚吉先生による3 次元空間での錯視のデモが好評で 来館者を楽しませてくれている それに触発されて 3 次元空間の幾何学の問題を J-OpenGL
More informationmain.dvi
A PostScript y 1997 1 Silicon Graphics i-station ( vhsgi) 1 i-station LaserMaster DisplayMaker-J DisplayMaker-J A dpi( ) PostScript 2 PostScript DisplayMaker-J i-station i-station ( AVS) PostScript i-station
More information/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1
I117 II I117 PROGRAMMING PRACTICE II 2 MEMORY MANAGEMENT 2 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara yasu@jaist.ac.jp / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming
More informationX Window System X X &
1 1 1.1 X Window System................................... 1 1.2 X......................................... 1 1.3 X &................................ 1 1.3.1 X.......................... 1 1.3.2 &....................................
More informationJAPLA研究会資料 2010/1/23
JAPLA 研究会資料 2010/1/23 J の OpenGL グラフィックス - その 6 - サッカーボールとその仲間たち - 西川利男 J の OpenGL プログラミングをここ数回にわたって紹介してきた 昨年暮れの JAPLA シンポジウムでは正 12 面体 正 20 面体の 3D グラフィックスを発表したが そのとき サッカーボールはどうだ? との質問 ご要望がでた サッカーボールの黒白パターンはあらためて見てみると意外と複雑である
More information10 B 3. ( ) (3)
Augus 5, 009 10 B 3. ( ) (3) ( ) 1 OpenGL CG 1 C OpenGL 3 CG 4 OpenGL 1. 1 OpenGL CG 1 C 1.1 I C [1] es.c C es.obj es.exe *.lib *.obj C 1. C I C #include < > in main( ) { reurn 0; } { reurn ; } Hellow
More information1 VisBAR edu H 2 O.....
VisBAR edu v1.03 ( ) 25 4 22 1 VisBAR edu 1 1.1....................................................... 1 1.2.................................................. 2 2 3 2.1 H 2 O.........................................
More informationTA TA TA abcdefgh abcdefgh C PC Wii bluetooth 2.2 Bluetooth USB Princeton PTM-UBT3S 1 1
1 22 (2) TA: 2010 12 13 1 OpenGL Wii Wii OpenGL USB (3DCG) 1.1 http://www.cyber.t.u-tokyo.ac.jp/~kuni/enshu2010/ URL USB 2 2 1.2 TA 16 15 TA TA mireport@cyber.t.u-tokyo.ac.jp 20101213 abcdefgh abcdefgh
More information5. p.1/37
5. taiji@aihara.co.jp p.1/37 dx dt dy dt dz dt = σx + σy = xz + rx y = xy bz σ = 10, b = 8/3, r = 28, x 0 = 10, y 0 = 20, z 0 = 30 t < 10000δt (δt = 0.01) p.2/37 , 1991. Numerical Recipes in C Netlib LAPACK,
More information免許法認定公開講座:コンピュータグラフィックス
演習内容 免許法認定公開講座 : コンピュータグラフィックス 第 6 回 3 次元グラフィックス演習 基本的な3 次元グラフィックスのプログラムを作成 OpenGL を使ったポリゴン描画 視点操作 アニメーション 九州工業大学情報工学部システム創成情報工学科尾下真樹 参考書 最低限の関数は資料で説明 OpenGLの定番の本 ( 高い ) OpenGLプログラミングガイド ( 赤本 ), 12,000
More informationL C -6D Z3 L C -0D Z3 3 4 5 6 7 8 9 10 11 1 13 14 15 16 17 OIL CLINIC BAR 18 19 POWER TIMER SENSOR 0 3 1 3 1 POWER TIMER SENSOR 3 4 1 POWER TIMER SENSOR 5 11 00 6 7 1 3 4 5 8 9 30 1 3 31 1 3 1 011 1
More information演算増幅器
スペースインベーダーもどき 1000 行プログラムの参考として スペースインベーダーもどきのプログラムを配布する いくつか習って いないものもあるので 補足の説明を加えていく 文字列の描画 文字の描画は glutbitmapcharacter() を用いる これは以下のようにして利用する int i; char *str = "Display String"; glcolor3f(0.0, 0.0,
More information1 level Level swtich ButtonPress ButtonRelease Expose Level
UNIX 4 2D/3D Grahpics,GUI :2-3 - 045708G 045726E 045730C 045735D 045759B 045762B 1 level1 1 11 2 12 4 13 6 14 6 2 Level2 6 21 6 211 swtich 11 212 ButtonPress 11 213 ButtonRelease 12 214 Expose 12 22 12
More informationr08.dvi
19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev
More informationtest_cylpyd
JAPLA 研究会資料 2013/9/14 実験と 3D グラフィックスによる幾何学 ピラミッド ( 三角錐 の体積はプリズム ( 三角柱 の 1/3 になる きみにはすぐ分かるだろうか 西川 利男 はじめに 錐体 ( 三角錐 四角錐 円錐 の体積は 柱体 ( 三角柱 四角柱 円柱 の体積の 1/3 である だれでも知っているこの有名な公式は中学校の教科書にのっているだろうが その理由をわかるように説明してはいない
More informationr07.dvi
19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1
More information$ pwd /home1/t0/t0903 / / /home1/t0/t0903 / / /home1/t0/t0903 / /... ~ $ ls $ ls -a
$ pwd /home1/t0/t0903 / / /home1/t0/t0903 / / /home1/t0/t0903 / /... ~ $ ls $ ls -a $ ls -l $ ls -l -a $ ls -la $ ls -F $ ls $ cd $ cd $ pwd $ cat
More informationohp07.dvi
19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5
More information2
L C -60W 7 2 3 4 5 6 7 8 9 0 2 3 OIL CLINIC BAR 4 5 6 7 8 9 2 3 20 2 2 XXXX 2 2 22 23 2 3 4 5 2 2 24 2 2 25 2 3 26 2 3 6 0 2 3 4 5 6 7 8 9 2 3 0 2 02 4 04 6 06 8 08 5 05 2 3 4 27 2 3 4 28 2 3 4 5 2 2
More informationコンピューターグラフィックスS
コンピューターグラフィックス S 第 2 回コンピュータグラフィックスの要素技術 システム創成情報工学科尾下真樹 2018 年度 Q2 今回の内容 前回の復習 コンピュータグラフィックスの歴史と応用 3 次元グラフィックスの要素技術 3 次元グラフィックス プログラミング 教科書 ( 参考書 ) コンピュータグラフィックス CG-ARTS 協会編集 出版 (3,200 円 ) 1~5 章の概要 ビジュアル情報処理
More informationComplex Lab – Operating Systems - Graphical Console
Complex Lab Operating Systems Graphical Console Martin Küttler Last assignment Any questions? Any bug reports, whishes, etc.? 1 / 13 We are here Pong Server Paddle Client 1 Paddle Client 2 Memory Management
More informationコンピューターグラフィックスS
前回の演習の復習 今日の内容 コンピューターグラフィックス S 第 7 回演習 (2): ポリゴンモデルの描画 システム創成情報工学科尾下真樹 前回の復習 ポリゴンの描画方法 ( 復習 ) 基本オブジェクトの描画 ポリゴンモデルの描画 演習課題 サンプルプログラム 前回の演習の復習 opengl_sample.c 地面と 枚の青い三角形が表示される マウスの右ボタンドラッグで 視点を上下に回転 前回の演習課題.
More informationC
C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................
More informationXMPによる並列化実装2
2 3 C Fortran Exercise 1 Exercise 2 Serial init.c init.f90 XMP xmp_init.c xmp_init.f90 Serial laplace.c laplace.f90 XMP xmp_laplace.c xmp_laplace.f90 #include int a[10]; program init integer
More informationohp08.dvi
19 8 ( ) 2019.4.20 1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: 2 (2) NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( 2) 3 (3) head cur tail head cur prev data
More information9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0)
E-mail: takio-kurita@aist.go.jp 1 ( ) CPU ( ) 2 1. a f(a) =(a 1.0) 2 (1) a ( ) 1(a) f(a) a (1) a f(a) a =2(a 1.0) (2) 2 0 a f(a) a =2(a 1.0) = 0 (3) 1 9 8 7 (x-1.0)*(x-1.0) 6 4 2.0*(x-1.0) 6 2 5 4 0 3-2
More informationProVisionaire Control V3.0セットアップガイド
ProVisionaire Control V3 1 Manual Development Group 2018 Yamaha Corporation JA 2 3 4 5 NOTE 6 7 8 9 q w e r t r t y u y q w u e 10 3. NOTE 1. 2. 11 4. NOTE 5. Tips 12 2. 1. 13 3. 4. Tips 14 5. 1. 2. 3.
More information1 OpenGL OpenGL OpenGL OpenGL
2008 OpenGL 2009 2 27 1 OpenGL 4 1.1 OpenGL.............................. 4 1.2 OpenGL............... 4 1.2.1............... 4 1.2.2............................. 5 2 OpenGL 6 2.1.......................
More information,,,,., C Java,,.,,.,., ,,.,, i
24 Development of the programming s learning tool for children be derived from maze 1130353 2013 3 1 ,,,,., C Java,,.,,.,., 1 6 1 2.,,.,, i Abstract Development of the programming s learning tool for children
More informationIntroduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for
Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for embedded systems that use microcontrollers (MCUs)
More informationMicrosoft Word - Meta70_Preferences.doc
Image Windows Preferences Edit, Preferences MetaMorph, MetaVue Image Windows Preferences Edit, Preferences Image Windows Preferences 1. Windows Image Placement: Acquire Overlay at Top Left Corner: 1 Acquire
More informationjoho09.ppt
s M B e E s: (+ or -) M: B: (=2) e: E: ax 2 + bx + c = 0 y = ax 2 + bx + c x a, b y +/- [a, b] a, b y (a+b) / 2 1-2 1-3 x 1 A a, b y 1. 2. a, b 3. for Loop (b-a)/ 4. y=a*x*x + b*x + c 5. y==0.0 y (y2)
More informationPowerPoint プレゼンテーション
複雑系科学演習 1 コンピュータグラフィックス 担当畔上秀幸情報科学研究科複雑系科学専攻 今日の話題 ベジェ曲線 曲面の描画 lesson9_1.c( ベジェ曲線 ) lesson9_2.c( 色付きベジェ曲線 ) lesson9_3.c( ベジェ曲面 ) NURBS 曲線 曲面の描画 lesson9_4.c(nurbs 曲線 ) lesson9_5.c(nurbs 曲線の分割 ) lesson9_6.c(nurbs
More informationMicrosoft Word - ggbook.docx
62 4GPU (Graphics Processing Unit) 4.1 4.1.1 63 63 ( 64) " () " " " 64 63 4.1.2 () GPU (Graphics Procssing Unit) (Transform) (Lighting ) T & L (Transform and Lighting) " CG 4 4 4 4 () 4 4 4 4 4 4 4 16
More informationGNU Emacs GNU Emacs
GNU Emacs 2015 10 2 1 GNU Emacs 1 1.1....................................... 1 1.2....................................... 1 1.2.1..................................... 1 1.2.2.....................................
More information