OpenGL $BF~Lg(B

$B!](BMesaGL $B$H(B GLUT $B$K$h$k#3

$B>pJs=hM}650i%;%s%?!<(B

$B=.66(B $B7r;J(B

sample image


$B$3$N%Z!<%8$O!"!V(BOpenGL $BF~Lg(B('99/5/6)$B!W$N9V=,2q;qNA$G$9!#(B $B%*%j%8%J%k%I%-%e%a%s%H$+$iK\J8$OJQ$C$F$$$^$;$s!#(B $B%;%s%?!<$NL>A0$O!"(B2000$BG/(B4$B7n$h$j>pJs%a%G%#%"650i%;%s%?!<$K!"(B 2006$BG/(B4$B7n$h$j>pJs4pHW%;%s%?!<$K$J$C$F$$$^$9!#(B
[$BCm(B] $Bl9g$,(B $B$"$j$^$9!#$=$N>l9g$O(B display() $B4X?t$N:G8e$G(B glFlush() $B$r%3!<%k$9$k(B $B$3$H$K$h$jI=<($5$l$^$9!J(B3.3 ogl05.c-2 $B$NJ}K!$b2D$G$7$g$&!K!#(B
[$BCm(B2] (ogl-k.c) PI $B$,(B define $B$5$l$F$$$J$$>l9g$K$O!"%W%m%0%i%`$N(B $B:G=i$NJ}$K!V(B#define PI (3.141592)$B!W$rF~$l$k$+!"(B $B%3%s%Q%$%k;~$K!V(B-DPI=3.141592$B!W$H%*%W%7%g%s;XDj$7$F$/$@$5$$!#(B
[$BCm(B3] Mac OS X $B$G%3%s%Q%$%k$9$k>l9g$K$O!"$^$:!V(B#include <GL/glut.h>$B!W$r(B $B!V(B#include <GLUT/glut.h>$B!W$KJQ99$9$k!J(BGL/gl.h$B!"(BGL/glu.h $B$O$=$N$^$^!K$+!"(B $B$^$?$O!"%G%#%l%/%H%j(B /usr/local/include/GL $B$r:n@.$7$=$3$K(B /System/Library/Frameworks/GLUT.framework/Versions/A/Headers/glut.h $B$N(B $B%7%s%\%j%C%/%j%s%/(B glut.h $B$r:n@.$7$F$/$@$5$$!#$=$N>e$G!"(B cc -framework OpenGL -framework GLUT -framework Foundation FILENAME.c $B$G%3%s%Q%$%k$7$F$/$@$5$$!#(B



$BL\

$B#0!#$O$8$a$K(B

$B9V=,2q!V(BOpenGL $BF~Lg!W$O!"7W;;5!(B ($B$3$3$G$O(B UNIX) $B$N7P83$,$"$j!"(BC $B8@8l$G(B $B%W%m%0%i%`$rAH$s$@$3$H$,$"$k?M!"$=$7$F%0%i%U%#%C%/%9$K6=L#$N$"$k?M$rBP(B $B>]$H$7$F$$$^$9!#$^$?!"K\;qNA$O9V=,2q$N$?$a$N$b$N$G$"$j!";qNA$N$_$G3X=,(B $B$9$k$K$OIT==J,$JE@$,$"$j$^$9!#(B


$B#1!#(BOpenGL $B$H$O(B

$B=>Mh$+$i%0%i%U%#%C%/%9%i%$%V%i%j$H$7$F!"3F$l(B $B$N(B OS ($B$$$o$f$k%&%#%s%I%&%7%9%F%`$r4^$s$G$$$k(B) $BFH<+$NJ}K!$,MQ$$$i$l$F(B $B$$$^$9!#$=$3$G!"%0%i%U%#%C%/%95!G=$@$1$rH4$-$@$7I8=`2=$7$?$b$N$,(B OpenGL$B$G$9!#(BOpenGL $B$OB?$/$N>l9g!"@lMQ$N%0%i%U%#%C%/%9%O!<%I%&%'%"(B ($B%i(B $B%9%?%(%s%8%s!"%8%*%a%H%j%(%s%8%s$J$I(B) $B$rMxMQ$9$k$h$&$K:n$i$l$F$$$k$?$a!"(B $B9bB.$J%0%i%U%#%C%/%9I=<($,2DG=$G$9!#8x3+$5$l$F$$$k(B OpenGL $B$N;EMM$r$b$H(B $B$K!"(BCPU $B$@$1$G=hM}$r9T$&$h$&$K:n@.$5$l$?%U%j!<%&%'%"$H$7$F(B MesaGL $B$,$"(B $B$j$^$9!#%&%#%s%I%&%7%9%F%`$N@)8f$rJ|4~$7$?Be$o$j$K!"$3$l$r0z$-

$B9V=,2q$G$O!"(BMesaGL $B$H(B GLUT $B$N%$%s%9%H!<%k$5$l$?(B Linux $B$K$h$j%0%i%U%#%C(B $B%/%9$NBN83$r$7$F$b$i$$$^$9!#$^$?!"0J2<$G(B OpenGL $B$H8@$&>l9g$K$Ol9g$,$"$j$^$9!#(B


$B#2!#$H$j$"$($:IA$$$F$_$k(B

2.1 $B%3%s%Q%$%k$N;EJ}(B

OpneGL$B!"(BGLUT $B$rMxMQ$9$k>l9g$K$O!"$5$^$6$^$J%i%$%V%i%j$r%j%s%/$9$kI,MW(B $B$,$"$j$^$9!#$3$l$i$N%j%s%/$N=g=x$K$bA08e4X78$,$"$k$?$a!"6=L#$N$"$kJ}$O(B $B3F<+$GJY6/$7$F$/$@$5$$!#%3%s%Q%$%k$O

% gcc filename.c -L/usr/X11R6/lib -lglut -lGLU -lGL -lXmu -lXi -lXext -lX11 -lm

$BKh2s!"$3$l$@$1$r%?%$%W$9$k$N$OBgJQ$G$9$M!#4JC1$K$9$kJ}K!$H$7$F(Balias $B$r(B $B:n$k!"(Bshell $B%9%/%j%W%H$r:n$k!"(BMakefile $B$r:n$k$J$I9M$($i$l$^$9$,!"$3$3(B $B$G$O!"(Boglcc $B$H$$$&L>A0$G0J2<$N0l9T$NFbMF$N$N(B shell $B%9%/%j%W%H$r:n$k$3(B $B$H$K$7$^$9!#$3$N%U%!%$%k$O

/*-oglcc---------------------------------------*/
gcc $* -L/usr/X11R6/lib -lglut -lGLU -lGL -lXmu -lXi -lXext -lX11 -lm
/*----------------------------------------*/

% oglcc filename.c
$B$H%3%s%Q%$%k$9$k$H!"(Ba.out $B$H$$$&L>A0$N % a.out
$B$Gu(B $BBV$G(B ESC $B%-!<$r2!$9$H=*N;$9$k$h$&$K$7$F$"$j$^$9!#(B

$B$^$?!":#2s$O;~4VC;=L$N$?$a3F%U%!%$%k$r % /u/adm/kenji/bin/cpogl
$B$H

2.2 $B%&%#%s%I%&$HD>@~(B

$B>\$7$$@bL@$O8e2s$7$K$7$F!"

/*-ogl01.c---------------------------------------*/
#include <GL/glut.h>

void display(void)
{
  glClear(GL_COLOR_BUFFER_BIT);
  glBegin(GL_LINE_LOOP);
  glColor3d(1.0, 0.0, 0.0);
  glVertex2d(-0.7, -0.7);
  glVertex2d(0.7, -0.7);
  glVertex2d(0.0, 0.7);
  glEnd();
}

void keyboard(unsigned char key, int x, int y)
{
  if (key == '\033') exit(0);  /* '\033' $B$O(B ESC $B$N(B ASCII $B%3!<%I(B */
}

int main(int argc, char *argv[])
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGBA);
  glutCreateWindow(argv[0]);
  glClearColor(1.0, 1.0, 1.0, 0.0);
  glutDisplayFunc(display);
  glutKeyboardFunc(keyboard);
  glutMainLoop();
  return 0;
}
/*----------------------------------------*/

$B$&$^$/

$B%$%Y%s%H6nF07?$N%W%m%0%i%`$r=i$a$F8+$k?M$O!"(Bdisplay() $B$H$$$&4X?t$,0lBN(B $B$I$3$G8F$P$l$k$N$+IT;W5D$K;W$&$+$bCN$l$^$;$s!#$3$l$O!"%&%#%s%I%&$,@8@.(B $B$5$l$?!"1#$l$F$$$?%&%#%s%I%&$,8=$l$?!"$J$I$N!V%$%Y%s%H!W$,H/@8$7$?$H$-(B $B$K!"EPO?$5$l$?

$B$G$O!"4X?tL>$N%W%j%U%#%C%/%9$,(B "glut" $B$H$J$C$F$$$k(B GLUT $B$N4X?t$K$D$$$F(B $B@bL@$7$^$9!#(B

void glutInit(int *argcp, char **argv)
GLUT $B$*$h$S(B OpenGL $B4D6-$r=i4|2=$7$^$9!#0z?t$K$O(B main $B$N0z?t$r$=$N$^$^EO$7$^$9!#(B
void glutInitDisplayMode(unsigned int mode)
$B%G%#%9%W%l%$$NI=<(%b!<%I$r@_Dj$7$^$9!#(Bmode $B$K(B GLUT_RGBA $B$r;XDj$7$?>l9g(B $B$O!"?'$N;XDj$r(B RGB $B$G9T$($k$h$&$K$7$^$9!#B>$K%$%s%G%C%/%9%+%i!<%b!<%I(B (GLUT_INDEX) $B$b;XDj$G$-$^$9!#(B
int glutCreateWindow(char *name)
$B%&%#%s%I%&$r3+$-$^$9!#0z?t(B name $B$O$=$N%&%#%s%I%&$NL>A0$NJ8;zNs$G!"%?%$(B $B%H%k%P!<$J$I$KI=<($5$l$^$9!#La$jCM$O3+$$$?%&%#%s%I%&$N<1JL;R$G$9!#(B
void glutDisplayFunc(void (*func)(void))
$B0z?t(B func $B$O3+$$$?%&%#%s%I%&Fb$KIA2h$9$k4X?t$X$N%]%$%s%?$G$9!#%&%#%s%I(B $B%&$,3+$+$l$?$j!"B>$N%&%#%s%I%&$K$h$C$F1#$5$l$?%&%#%s%I%&$,:F$S8=$l$?$j(B $B$7$F!"%&%#%s%I%&$r:FIA2h$9$kI,MW$,$"$k$H$-$K!"$3$N4X?t$,glutKeyboardFunc(void (*func)(unsigned char key, int x, int y))
$B0z?t(B func $B$K$O!"%-!<$,%?%$%W$5$l$?$H$-$K~!K%-!<$r8!=P$9$k$K$O(B glutGetModifiers()$B!"%U%!%s%/%7%g%s%-!<$N$h$&$JJ8;z%-!<0J30$N%?%$%W$r8!(B $B=P$9$k$H$-$O(B glutSpecialFunc() $B$r;H$$$^$9!#(B
void glutMainLoop(void)
$B$3$l$OL58B%k!<%W$G$9!#$3$N4X?t$r8F$S=P$9$3$H$G!"%W%m%0%i%`$O%$%Y%s%H$N(B $BBT$AuBV$K$J$j$^$9!#(B

$B$N%W%j%U%#%C%/%9$,(B "gl" $B$H$J$C$F$$$k(B OpenGL $B$N4X?t$K$D$$$F(B $B@bL@$7$^$9!#(BOpenGL $B$O%9%F!<%H%^%7%s$H8F$P$l!">uBV$rJ];}$7$J$,$i3F=hM}(B $B$r9T$C$F$$$-$^$9!#6qBNE*$K$O!"@V$$@~$rIA$/>l9g$K!V@V?'$G@~$rIA$1!W$HL?(B $BNa$9$k$N$G$O$J$/!"!V$3$l$+$iIA$/?'$O@V!W$HL?Na$7$F$*$-!"0J8e!V@~$rIA$1!W(B $B$HL?Na$7$^$9!#(B

void glClearColor(GLclampf R, GLclampf G, GLclampf B, GLclampf A)
glClear(GL_COLOR_BUFFER_BIT) $B$G%&%#%s%I%&$rEI$j$D$V$9:]$N?'$r;XDj$7$^(B $B$9!#(BRGBA $B$O$=$l$>$l@V!"NP!"@D?'[email protected],$N6/$5$r<($9(B GLclampf $B7?(B $B!J0lHL$K(B $B$O(B float $B7?$HEy2A!K$NCM$G!"(B 0$B!A(B1 $B$N4V$NCM$r;}$A$^$9!#(BA $B$O&ACM$H8F$P$l!"(B $BF)L@EY$H$7$F07$o$l$^$9!#(B
void glClear(GLbitfield mask)
$B%&%#%s%I%&$rEI$j$D$V$7$^$9!#(B mask $B$K$OEI$j$D$V$9%P%C%U%!$r;XDj$7$^$9!#(B OpenGL $B$,4IM}$9$k2hLL>e$N%P%C%U%!$K$O!"?'$r3JG<$9$k%+%i!<%P%C%U%!$NB>!"(B $B1#LL>C5n$K;H$&%G%W%9%P%C%U%!$J$I!"$$$/$D$+$N$b$N$,$"$j!"$3$l$i$,0l$D$N(B $B%&%#%s%I%&$KB8:_$7$F$$$^$9!#(Bmask $B$K(B GL_COLOR_BUFFER_BIT $B$r;XDj$7$?$H$-(B $B$O!"%+%i!<%P%C%U%!$@$1$,EI$j$D$V$5$l$^$9!#(B
void glBegin(GLnum mode)
void glEnd(void)
$B?^7A$rIA$/$K$O!"(BglBegin()$B!A(BglEnd() $B$N4V$K$=$N?^7A$N3FD:E@$N:BI8CM$r@_(B $BDj$9$k4X?t$rCV$-$^$9!#(BglBegin() $B$N0z?t(B mode $B$K$OIA2h$9$k?^7A$N%?%$%W$r(B $B;XDj$7$^$9!#(B
GL_POINTS	$BE@$rBG$A$^$9!#(B
GL_LINES	$B#2E@$rBP$K$7$F!"$=$N4V$rD>@~$G7k$S$^$9!#(B
GL_LINE_STRIP	$B@^$l@~$rIA$-$^$9!#(B
GL_LINE_LOOP	$B@^$l@~$rIA$-$^$9!#;OE@$H=*E@$N4V$b7k$P$l$^$9!#(B
GL_TRIANGLES / GL_QUADS
		$B#3!?#4E@$rAH$K$7$F!";03Q7A!?;M3Q7A$rIA$-$^$9!#(B
GL_TRIANGLE_STRIP / GL_QUAD_STRIP
		$B0lJU$r6&M-$7$J$,$iBS>u$K;03Q7A!?;M3Q7A$rIA$-$^$9!#(B
GL_TRIANGLE_FAN	$B0lJU$r6&M-$7$J$,$i@p>u$K;03Q7A$rIA$-$^$9!#(B
GL_POLYGON	$BFLB?3Q7A$rIA$-$^$9!#(B
void glColor3d(GLdouble r, GLdouble g, GLdouble b)
glColor3d() $B$O$3$l$+$iIA2h$9$k$b$N$N?'$r;XDj$7$^$9!#0z?t$N7?$O(B GLdouble $B7?!J0lHL$K(B double $B$HEy2A!K$G!":8$+$i@V(B (R)$B!"NP(B (G)$B!"@D(B (B) $B$N(B $B6/$5$r(B 0$B!A(B1 $B$NHO0O$G;XDj$7$^$9!#(B
void glVertex2d(GLdouble x, GLdouble y)
$B#2 c.f. $B4X?t$N%5%U%#%C%/%9$O!"0z?t$N7?!"?t$r$"$i$o$7$F$$$^$9!#(B 2: 2-4: $BCM$N?t!"

$B$5$F!";~4V$KM>M5$N$"$k?M$O!"(B
glClearColor(1.0, 1.0, 1.0, 0.0);
glColor3d(1.0, 0.0, 0.0);
$B$N?'$N;XDj$rJQ99$7$F$_$F$/$@$5$$!#$^$?!"(B
glVertex2d(-0.7, -0.7);
$B$ND:E@(B (vertex) $B$N;XDj$rJQ99$7$?$j!"A}$d$7$?$j$7$F$_$F$/$@$5$$!#(B $B;W$C$?DL$j$KI=<($5$l$^$7$?$+!)(B

2.3 $BEI$j$D$V$7$F$_$k(B

$B%W%m%0%i%`(B ogl01.c $B$N4X?t(B display() $B$r!"0J2<$N$h$&$KJQ99$7$F$_$F$/$@$5$$!#(B

/*-ogl02.c---------------------------------------*/
#include <GL/glut.h>

void display(void)
{
  glClear(GL_COLOR_BUFFER_BIT);
  glBegin(GL_POLYGON);
  glColor3d(1.0, 0.0, 0.0);
  glVertex2d(-0.7, -0.7);
  glColor3d(0.0, 1.0, 0.0);
  glVertex2d(0.7, -0.7);
  glColor3d(0.0, 0.0, 1.0);
  glVertex2d(0.0, 0.7);
  glEnd();
}
/*-$B0J2

$BGL_LINE_LOOP); $B$,(B glBegin(GL_POLYGON); $B$K(B $BJQ99$5$l$F$$$^$9!#D>@~$G$O$J$/!"B?3Q7A(B ($BEI$j$D$V$5$l$F$$$k(B) $B$K$J$k$3$H(B $B$,J,$+$j$^$9!#$B3FE@$K?'$,;XDj(B$B$5$l$F$$$^$9!#$3$N>l9g!"B?3Q7A$NFbIt(B $B$OD:E@$N?'$+$iJd4V$7$??'$GEI$j$D$V$5$l$^$9!#8@MU$G@bL@$7$F$bJ,$+$i$J$$(B $B>l9g$O!"

2.4 $B:BI8<4$r9M$($k(B

$B$^$:(B ogl02.c $B$r.$7$F$$$^$9$M!#$3$l$rI=<(FbMF$NBg$-$rJQ$($:$KI=(B $B<(NN0h$N$_$r9-$2$k$h$&$K$7$^$9!#$^$?!"%&%#%s%I%&$,:G=i$KI=<($5$l$k0LCV!"(B $BBg$-$5$b;XDj$7$F$_$^$7$g$&!#(B

/*-ogl03.c---------------------------------------*/
/*-$B$3$3$^$G!"(Bogl02.c $B$HF1$8(B-*/
void resize(int w, int h) /*-$B4X?tDI2C(B-*/
{
  glViewport(0, 0, w, h);
  glLoadIdentity();
  glOrtho(-w / 200.0, w / 200.0, -h / 200.0, h / 200.0, -1.0, 1.0);
}

int main(int argc, char *argv[])
{
  glutInitWindowPosition(100, 100);	/*-$BDI2C(B-*/
  glutInitWindowSize(320, 240);		/*-$BDI2C(B-*/
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGBA);
  glutCreateWindow(argv[0]);
  glClearColor(1.0, 1.0, 1.0, 0.0);
  glutDisplayFunc(display);
  glutKeyboardFunc(keyboard);
  glutReshapeFunc(resize);		/*-$BDI2C(B-*/
  glutMainLoop();
  return 0;
}
/*----------------------------------------*/
void glViewport(GLint x, GLint y, GLsizei w, GLsizei h)
$B%S%e!<%]!<%H(B ($B3+$$$?%&%#%s%I%&$NCf$GIA2h$,9T$o$l$kNN0h!"@55,2=%G%P%$%9(B $B:BI87O$N(B (-1, -1), (1, 1) $B$rBP3Q@~$H$9$k6k7ANN0h$,$3$3$KI=<($5$l$k(B) $B$r(B $B@_Dj$7$^$9!#:G=i$N#2$D$N0z?t(B x$B!"(By $B$K$O$=$NNN0h$N:82<6y$N0LCV!"(Bw $B$K$OI}!"(B h $B$K$O9b$5$r%G%P%$%9:BI87O!"$9$J$o$A%G%#%9%W%l0J>e$N2hAG?t$G;XDj$7$^$9!#(B
void glLoadIdentity(void)
$BJQ499TNs$r=i4|2=$7$^$9!#:BI8JQ49$O9TNs$N@Q$G$"$i$o$5$l$^$9$+$i!"JQ499T(B $BNs$K=i4|CM$H$7$FC10L9TNs$r@_Dj$7$^$9!#(B
void glOrtho(GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f)
$B%o!<%k%I:BI87O$r@55,2=%G%P%$%9:BI87O$KJ?9TEj1F(B (orthographic projection) $B$9$k9TNs$rJQ499TNs$K>h$8$^$9!#0z?t$K$O!"(Bl $B$KI=<(NN0h$N:8C<(B $B$N0LCV!"(Br $B$K1&C<$N0LCV!"(Bb $B$K2eC<$N0LCV!"(Bn $B$KA0J}LL$N0L(B $BCV!"(Bf $B$K8eJ}LL$N0LCV$r;XDj$7$^$9!#$3$l$O!"%S%e!<%]!<%H$KI=<($5$l$k6u4V(B $B$N:BI8<4$r@_Dj$7$^$9!#(B
void glutInitWindowSize(int w, int h)
$B?7$?$K3+$/%&%#%s%I%&$NI}$H9b$5$r;XDj$7$^$9!#(B
void glutInitWindowPosition(int x, int y)
$B?7$?$K3+$/%&%#%s%I%&$N0LCV$r;XDj$7$^$9!#(B
glutReshapeFunc(void (*func)(int w, int h))
$B0z?t(B func $B$K$O!"(B $B%&%#%s%I%&$,%j%5%$%:$5$l$?$H$-$K

$B#3!#$d$C$H#3

3.1 $B@~2h$rI=<($7$F$_$k(B

$B$5$F!"$d$C$H$*BT$A$+$M$N#3$K(B Z $B<4$,?-$S$F$$(B $B$F!"$=$N#3

$B Fig.1

/*-ogl04.c---------------------------------------*/
#include <GL/glut.h>

void display(void)
{
  int i;
  GLdouble vertex[8][3] = {
    { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 },
    { 1.0, 1.0, 0.0 }, { 0.0, 1.0, 0.0 },
    { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 },
    { 1.0, 1.0, 1.0 }, { 0.0, 1.0, 1.0 }
  };
  int edge[12][2] = {
    { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 0 },
    { 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 4 },
    { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 }
  };
  
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3d(0.0, 0.0, 0.0);
  glBegin(GL_LINES);
  for (i = 0; i < 12; i++) {
    glVertex3dv(vertex[edge[i][0]]);
    glVertex3dv(vertex[edge[i][1]]);
  }
  glEnd();
}

void keyboard(unsigned char key, int x, int y)
{
  if (key == '\033') exit(0);
}

void resize(int w, int h)
{
  glViewport(0, 0, w, h);
  glLoadIdentity();
  glOrtho(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0);
}

int main(int argc, char *argv[])
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGBA);
  glutCreateWindow(argv[0]);
  glClearColor(1.0, 1.0, 1.0, 0.0);
  glutDisplayFunc(display);
  glutKeyboardFunc(keyboard);
  glutReshapeFunc(resize);
  glutMainLoop();
  return 0;
}
/*----------------------------------------*/

$B$&$^$/I=<($5$l$^$7$?$+!)(B $B4|BT$7$F$$$?$b$N$H$O0c$C$F$$$?$+$b$7$l$^$;$s!#(B $B$3$l$O!"@5LL$+$i8+$?N)J}BN$rJ?9TEj1F$7$F$$$k$?$a$G$9!#$G$OF);kEj1F$K$7(B $B$F$_$^$7$g$&!#4X?t(B resize $B$r%W%m%0%i%`(B ogl04.c-2 $B$K<($9$h$&$K=$@5$7$F(B $B$/$@$5$$!#%G%U%)%k%H$G$O;kE@$,86E@$K$J$jN)J}BN$H=E$J$C$F$7$^$&$N$G!";k(B $BE@:BI87O$rJ?9T0\F0$7!"NG@~$,=E$J$i$J$$$h$&$K2sE>0\F0$7$F$$$^$9!#$&$^$/(B $BI=<($G$-$?$i!"F1$8$h$&$K(B ogl04.c-3 $B$K<($9$h$&$K=$@5$7$F$/$@$5$$!#:#EY(B $B$O;kE@!"$*$h$S;k@~J}8~$r;XDj$9$k$3$H$K$h$jN)J}BN$i$7$/8+$($k$h$&$K$7$F(B $B$$$^$9!#(B

Fig.2 Fig.3
/*-ogl04.c-2--------------------------------------*/
void resize(int w, int h)
{
  glViewport(0, 0, w, h);
  glLoadIdentity();
  gluPerspective(30.0, 1.0, 1.0, 10.0);
  glTranslated(0.0, 0.0, -5.0);
  glRotated(5.0, 1.0, 1.0, 0.0);
}
/*----------------------------------------*/
/*-ogl04.c-3--------------------------------------*/
void resize(int w, int h)
{
  glViewport(0, 0, w, h);
  glLoadIdentity();
  gluPerspective(30.0, 1.0, 1.0, 10.0);
  gluLookAt(3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
}
/*----------------------------------------*/

$B4X?tL>$N%W%j%U%#%C%/%9$,(B "glu" $B$H$J$C$F$$$k4X?t$,$G$F$-$^$7$?!#(B $B$3$l$i!"(BGL Utility $B%i%$%V%i%j$K$D$$$F$b@bL@$7$^$9!#(B

gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
$BJQ499TNs$KF);kJQ49$N9TNs$r>h$8$^$9!#(B $B:G=i$N0z?t(B fovy $B$O;kLn3Q$G$"$j!"(B $BEY$GI=$7$^$9!##2$DL\$N0z?t(B aspect $B$O2hLL$N=D2#Hf$G$9!##3$DL\$N0z?t(B zNear $B$H#4$DL\$N0z?t(B zFar $B$OI=<($r9T$&1|9T$-J}8~$NHO0O$G!"(BzNear $B$Ovoid gluLookAt(GLdouble ex, GLdouble ey, GLdouble ez, GLdouble cx, GLdouble cy, GLdouble cz, GLdouble ux, GLdouble uy, GLdouble uz)
$B$3$N:G=i$N#3$D$N0z?t(B ex, ey, ez $B$O;kE@$N0LCV!"e!W$NJ}8~$r<($9%Y%/%H%k$G$9!#(B
glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
$BJQ499TNs$K2sE>$N9TNs$r>h$8$^$9!#0z?t$O$$$:$l$b(B GLdouble$B7?$G!"#1$DL\$N(B $B0z?t(B angle $B$O2sE>3Q!";D$j$N#3$D$N0z?t(B x, y, z $B$O2sE><4$NJ}8~%Y%/%H%k$G(B $B$9!#(B
glTranslated(GLdouble x, GLdouble y, GLdouble z)
$BJQ499TNs$KJ?9T0\F0$N9TNs$r>h$8$^$9!#0z?t$O$$$:$l$b(B GLdouble $B7?!"#3$D$N(B $B0z?t(B x, y, z $B$O8=:_$N0LCV$+$i$NAjBPE*$J0\F0NL$r$7$F$$$7$^$9!#(B

$B;~4V$KM>M5$N$"$k?M$O!"IA$/?^7A$d;kE@$r$&$^$/JQ99$7$F$_$F$/$@$5$$!#(B $B4|BT$7$?I=<($,$G$-$^$7$?$+!)(B

3.2 $B%"%K%a!<%7%g%s(B

$B#3

$Bl9g$K$O!"(B

$B!V%b%G%j%s%0JQ49!W(B	$BN)J}BN$N6u4VFb$N0LCV!"8~$-(B
$B!V%S%e!<%$%s%0JQ49!W(B	$B$=$N6u4V$r8+$k;kE@!";k@~J}8~(B
$B!VEj1FJQ49!W(B		$B%9%/%j!<%s$X$NEj1FJ}K!(B

$B$r9M$($kI,MW$,$"$j$^$9!#N)J}BN$r2s$9>l9g$K$O!V%b%G%j%s%0JQ49!W$rJQ99$9(B $B$l$PNI$$$o$1$G$9!#$^$?!";_$^$C$F$$$kN)J}BN$N<~$j$r(B ($B8+$kB&$,(B) $BF0$-$?$$(B $B$N$J$i$P!V%S%e!<%$%s%0JQ49!W$rJQ99$7$F$$$1$PNI$$$N$G$9!#(BOpenGL $B$G$O!"(B $B!V%b%G%k!]%S%e! Fig.4

/*-ogl05.c---------------------------------------*/
#include <GL/glut.h>

void idle(void)
{
  glutPostRedisplay();
}

void display(void)
{
  int i;
  static int r = 0; /* $BN)J}BN$N2sE>3Q(B */
  GLdouble vertex[8][3] = {
    { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 },
    { 1.0, 1.0, 0.0 }, { 0.0, 1.0, 0.0 },
    { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 },
    { 1.0, 1.0, 1.0 }, { 0.0, 1.0, 1.0 }
  };
  int edge[12][2] = {
    { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 0 },
    { 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 4 },
    { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 }
  };
  
  glClear(GL_COLOR_BUFFER_BIT);

  /* $B%b%G%k%S%e!

void glutPostRedisplay(void)
$B:FIA2h%$%Y%s%H$rH/@8$5$;$^$9!#$3$N%$%Y%s%H$NH/@8$,H/@8$9$k$H!"(B glutDisplayFunc() $B$G;XDj$5$l$F$$$kIA2h4X?t$,void glutIdleFunc(void (*func)(void))
$B0z?t(B func $B$K$O!"%W%m%0%i%`$,!V2?$b$9$k$3$H$,$J$$!W$H$-$Kvoid glMatrixMode(GLenum mode)
$B@_Dj$9$kJQ499TNs$r;XDj$7$^$9!#0z?t(B mode $B$,(BGL_MODELVIEW $B$J$i%b%G%k%S%e!<(B $BJQ499TNs!"(BGL_PROJECTION $B$J$iEj1FJQ499TNs$r;XDj$7$^$9!#(B

3.3 $B%@%V%k%P%C%U%!(B

$BN)J}BN$O$&$^$/2s$j$^$7$?$+!)(B $B2s$C$?$1$l$I$A$i$D$$$Fe:No$G$O$J$$!)(B $B%W%m(B $B%0%i%`(B ogl05.c $B$G$O!V8+$($F$$$kLL!W$r0lC6>C5n$7!"glutSwapBuffers();$B!W$N#19T$rDI2C$7!"(Bmain() $B$NCf$N(B $B!V(BglutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);$B!W$N0z?t$r=$@5$7$F$/$@(B $B$5$$!#(B

/*-ogl05.c-2--------------------------------------*/
$B!'(B
void display(void)
$B!'(B
  glEnd();
  glutSwapBuffers(); /* $BDI2C(B */
  if (++r >= 360) r = 0;
$B!'(B
int main(int argc, char *argv[])
$B!'(B
  glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); /* $BJQ99(B */
$B!'(B
/*----------------------------------------*/
int glutSwapBuffers(void)
$B#2$D$N%P%C%U%!$r8r49$7$^$9!#(B

$B$5$F!"$^$?;~4V$KM>M5$N$"$k?M$O!"(B
glRotated((GLdouble) r, 0.0, 1.0, 0.0);
$B$N2sE><4$rJQ99$7$F$_$^$7$g$&!#$&$^$/2s$j$^$7$?$+!)(B

3.4 $B1#LL>C5n(B

$BN)J}BN$,$/$k$/$k$H%9%`!<%:$K2s$k$h$&$K$J$j$^$7$?!#$A$g$C$HM_$r=P$7$F!"(B $BLL$rD%$C$F$_$^$7$g$&!#A0$N%W%m%0%i%`$G$O#2$D$ND:E@$r7k$s$GNG@~$r;XDj$7(B $B$^$7$?$,!":#EY$O#4$D$ND:E@$r7k$s$GLL$rIA$/$3$H$K$7$^$9!#0lHL$K!"%]%j%4(B $B%s(B($BB?LLBN(B)$B$r;XDj$9$k>l9g(B($BI=$+$i8+$F(B)$B:82s$j!"$H$*$\$($F$*$$$F$/$@$5$$!#(B $B$3$N$H$-!"LL$N0c$$$rJ,$+$j$d$9$/$9$k$?$a$K!"3FLL$r0c$&?'$GI=<($7$F$_$^(B $B$9!#I=<($7$F$_$?3($r$8$C$H8+$F$_$^$7$g$&!#(B

/*-ogl06.c---------------------------------------*/
#include <GL/glut.h>

void idle(void)
{
  glutPostRedisplay();
}

void display(void)
{
  int i, j;
  static int r = 0;
  GLdouble vertex[8][3] = {
    { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 },
    { 1.0, 1.0, 0.0 }, { 0.0, 1.0, 0.0 },
    { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 },
    { 1.0, 1.0, 1.0 }, { 0.0, 1.0, 1.0 }
  };
  int face[6][4] = {
    { 0, 3, 2, 1 }, { 1, 2, 6, 5 }, { 4, 5, 6, 7 },
    { 0, 4, 7, 3 }, { 0, 1, 5, 4 }, { 2, 3, 7, 6 }
  };
  GLdouble color[6][3] = {
    { 1.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }, { 0.0, 0.0, 1.0 },
    { 1.0, 1.0, 0.0 }, { 0.0, 1.0, 1.0 }, { 1.0, 0.0, 1.0 }
  };
  
  glClear(GL_COLOR_BUFFER_BIT);

  glLoadIdentity();
  gluLookAt(3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
  glRotated((GLdouble)r, 0.0, 1.0, 0.0);
  
  glColor3d(0.0, 0.0, 0.0);
  glBegin(GL_QUADS);
  for (j = 0; j < 6; j++) {
    glColor3dv(color[j]);
    for (i = 0; i < 4; i++) {
      glVertex3dv(vertex[face[j][i]]);
    }
  }
  glEnd();

  glutSwapBuffers();

  if (++r >= 360) r = 0;
}

void resize(int w, int h)
{
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(30.0, 1.0, 1.0, 10.0);
  glMatrixMode(GL_MODELVIEW);
}

void keyboard(unsigned char key, int x, int y)
{
  if (key == '\033') exit(0);
}

int main(int argc, char *argv[])
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
  glutCreateWindow(argv[0]);
  glClearColor(1.0, 1.0, 1.0, 0.0);
  glutDisplayFunc(display);
  glutKeyboardFunc(keyboard);
  glutIdleFunc(idle);
  glutReshapeFunc(resize);
  glutMainLoop();
}
/*----------------------------------------*/

$B$J$s$@$+$*$+$7$$$G$9$M!#$"$^$j$8$C$H8+$D$a$F$$$k$H!"JQ$J5$J,$K$J$C$F$-(B $B$=$&$G$9(B ;-p $B!#$3$l$O!"LL$NA08e4X78$rL5;k$7$F!"$H$K$+$/=E$M=q$-(B($BEI$j(B) $B$7$F$$$k$?$a$K!"8e$m$K$"$j8+$($J$$$O$:$NLL$G$b8e$GIA$$$?$b$N$,8+$($F$7(B $B$^$C$F$$$k$?$a$G$9!#$=$3$G!"(B Z $B%P%C%U%!(B ($B%G%W%9%P%C%U%!(B) $B$H$$$&$b$N$r(B $B;H$$$^$9!#$3$l$O!"!V2hLL!W>e$N3FE@$KBP$7$F!"8=:_$^$G$K$I$N$/$i$$$N1|9T(B $B$-(B ($B%G%W%9(B) $B$NBP>]$,IA2h$5$l$F$$$k$+$r5-21$7$F$*$/%P%C%U%!!?]$h$j$b!V]$,IA2h$5$l$F$$$k(B $B>l9g$O!V8+$($J$$!W$HH=CG$7>eEI$j$r9T$$$^$;$s!#%W%m%0%i%`(B ogl06.c $B$r!"(B ogl06.c-2$B$K<($9$h$&$K!"#29T$N=$@5$H#29T$NDI2C$r9T$C$F$/$@$5$$!#(B

Fig.5
/*-ogl06.c-2--------------------------------------*/
$B!'(B
void display(void)
$B!'(B
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT /* $B=$@5(B */);
  glEnable(GL_DEPTH_TEST); /* $BDI2C(B */
$B!'(B
  glEnd();
  glDisable(GL_DEPTH_TEST); /* $BDI2C(B */
  glutSwapBuffers();
$B!'(B
int main(int argc, char *argv[])
$B!'(B
  glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH /* $B=$@5(B */);
$B!'(B
/*----------------------------------------*/

$B#4!#%7%'!<%G%#%s%0(B

4.1 $B%i%$%F%#%s%0$H%^%F%j%"%k(B

$Bu$K$D$$$F$b07$C$F$-$^$7$?!#!V?'!W$K$D$$$F$O$I$&$G$7$g$&(B $B$+!#A0$N%W%m%0%i%`$G$ON)J}BN$K%+%i%U%k$J?'$rIU$1$F$_$^$7$?$,!"C1$KEI$j(B $B$D$V$7$?$@$1!"$H$$$&46$8$G$7$?$M!#?'$K$D$$$F9M$($kA0$K!"$b$&0l$DBg;v$J(B $B$b$N!"8w$,$"$j$^$9!#J*$,8+$($k$?$a$K$O!"J*$K8w$,$"$?$j!"$=$N$&$A$N$$$/(B mail protected],$,H? Fig.6

/*-ogl07.c---------------------------------------*/
#include <GL/glut.h>

void idle(void)
{
  glutPostRedisplay();
}

void display(void)
{
  int i, j;
  static int r = 0;
  GLdouble vertex[8][3] = {
    { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 },
    { 1.0, 1.0, 0.0 }, { 0.0, 1.0, 0.0 },
    { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 },
    { 1.0, 1.0, 1.0 }, { 0.0, 1.0, 1.0 }
  };
  int face[6][4] = {
    { 0, 3, 2, 1 }, { 1, 2, 6, 5 }, { 4, 5, 6, 7 },
    { 0, 4, 7, 3 }, { 0, 1, 5, 4 }, { 2, 3, 7, 6 }
  };
  GLdouble normal[6][3] = {
    { 0.0, 0.0,-1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 },
    {-1.0, 0.0, 0.0 }, { 0.0,-1.0, 0.0 }, { 0.0, 1.0, 0.0 }
  };
  GLfloat lpos[4] = {5.0, 5.0, 0.0, 1.0};
  GLfloat lcol[4] = {0.5, 1.0, 0.5, 1.0};
  GLfloat mcol[4] = {1.0, 0.5, 0.5, 1.0};
  
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

  glEnable(GL_DEPTH_TEST);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  
  glLoadIdentity();
  gluLookAt(3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
  glRotated((GLdouble)r, 0.0, 1.0, 0.0);
  
  glBegin(GL_QUADS);
  for (j = 0; j < 6; j++) {
    glNormal3dv(normal[j]);
    for (i = 0; i < 4; i++) {
      glVertex3dv(vertex[face[j][i]]);
    }
  }
  glEnd();

  glDisable(GL_LIGHT0);
  glDisable(GL_LIGHTING);
  glDisable(GL_DEPTH_TEST);
  glutSwapBuffers();

  if (++r >= 360) r = 0;
}

void resize(int w, int h)
{
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(30.0, 1.0, 1.0, 10.0);
  glMatrixMode(GL_MODELVIEW);
}

void keyboard(unsigned char key, int x, int y)
{
  if (key == '\033') exit(0);
}

int main(int argc, char *argv[])
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
  glutCreateWindow(argv[0]);
  glClearColor(1.0, 1.0, 1.0, 0.0);
  glutDisplayFunc(display);
  glutKeyboardFunc(keyboard);
  glutIdleFunc(idle);
  glutReshapeFunc(resize);
  glutMainLoop();
}
/*----------------------------------------*/

OpenGL $B$K$O!"$$$/$D$+$N8w8;$,MQ0U$5$l$F$$$^$9!#8w8;$N?t$O%7%9%F%`$K$h$C(B $B$F0c$$$,$"$j$^$9!#$^$?!"8w$,J*BN$NLL(B($BHy>.J?LL(B)$B$K$"$?$C$?>l9g!"8w$,$I$N(B $BJ}8~$KH?

$B$^$:!"$/$k$/$k2s$kN)J}BN$rNI$/8+$F!"$I$A$i$+$i8w$,$"$?$C$F$$$k$+9M$($F(B $B$/$@$5$$!#@5LLe$K$"$k$3(B $B$H$,J,$+$j$^$9$+!)(B $BF1$8$h$&$K!VDI2C#2!W$G8w8;$N?'$rNP$KJQ$($k$3$H$,$G(B $B$-$^$9!#N)J}BN$N:`l9g$O!VGr!W$J$N$G!"N)J}BN$,(B $BNP$K8+$($^$9!#!VDI2C#3!W$G$ON)J}BN$N:`l9g$O!"2+?'(B($B$d$^$V$-?'(B ;-< ?)$B$K8+(B $B$($k$G$7$g$&!#(B

/*-ogl07.c-2--------------------------------------*/
$B!'(B
void display(void)
$B!'(B
  gluLookAt(3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
  glLightfv(GL_LIGHT0, GL_POSITION, lpos);		/* $BDI2C#1(B */
  glLightfv(GL_LIGHT0, GL_DIFFUSE, lcol);		/* $BDI2C#2(B */
  glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mcol);	/* $BDI2C#3(B */
  glRotated((GLdouble)r, 0.0, 1.0, 0.0);
$B!'(B
/*----------------------------------------*/
void glLightfv(GLenum light, GLenum pname, const GLfloat *params)
$B8w8;$N%Q%i%a!<%?$r@_Dj$7$^$9!#:G=i$N0z?t(B light $B$K@_Dj$9$k8w8;$NHV9f(B $B!J(BGL_LIGHT0$B!A(BGL_LIGHTn$B!"(Bn $B$O%7%9%F%`$K$h$C$F0[$J$j$^$9!K$G$9!##2$DL\$N(B $B0z?t(B pname $B$O@_Dj$9$k%Q%i%a!<%?$N$l8w8;$N0L(B $BCV$*$h$S3H;6H?o(B w = 1 $B$H$7$F(B $BE@8w8;$N0LCV$r@_Dj$7$^$9$,!"(Bw = 0 $B$G$"$l$P(B (x, y, z) $BJ}8~$NJ?9T8w@~$N(B $B@_Dj$K$J$j$^$9!#$^$?8w8;$N3H;6H?void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params)
$BJ*BN$N:`$lLL$NI=!"N"!"$"$k$$$ON>LL$K:`(B $BJ}!K$,$"$j(B $B$^$9!#0z?t(B params $B$O#1$D(B(GL_SHININESS)$B$^$?$O#4$D$NMWAG$r;}$D(B GLfloat $B7?$NG[Ns$G!"#4$D$NMWAG$r;}$D>l9g$O!"?'[email protected],(B RGB $B$*$h$S(B A $B$KBP$9$k78?t(B $B$r;XDj$7$^$9!#(B

4.2 $B%9%`!<%:%7%'!<%G%#%s%0(B

$BA0$N%W%m%0%i%`$G$O!"0l$D$NLL$KBP$7$F0l$D$NK!@~$r@_Dj$7$F$$$^$7$?!#J?LL(B $B$K$OK!@~$O0l$D$7$+$J$$$+$iEv$jA0$@$H$$$o$l$F$7$^$&$H:$$k$N$G$9$,!"l9g(B)$B#4$D$ND:E@$KE,MQ$5$l$F$$$?$@$1$J$N$G$9!#(B $B?t3XE*$JLL$NK!@~$H$Ol9g$KJL!9(B $B$NK!@~$r;XDj$7$F$*$/$3$H$,2DG=$G$9!#$9$k$H!"$=$NE@$K$*$1$k!V?'!W$O8w8;(B $B$H$=$NK!@~$K$h$j7hDj$5$l$^$9!#IA$+$l$k%]%j%4%s(B($BLL(B)$B$O!"3FD:E@$O$=$l$>$l(B $B;XDj$5$l$?K!@~>pJs$K$h$j8+$+$1$N?'$,7h$^$j!"%]%j%4%s$NFbIt$O3FD:E@$N?'(B $B$rJd4V$7$?7A$GKd$a?T$/$5$l$^$9!#6ILL$rB??t$NLL$G6a;w$7!"E,@Z$JK!@~$rM?(B $B$($FIA2h$9$k$3$H$K$h$j!"$"$?$+$b3j$i$+$J6ILL$N$h$&$KI=<($G$-$k$N$G$9!#(B

Fig.7

$B#5!#$5$$$4$K$b$&>/$7!D(B

5.1 $BJQ499TNs$N3,AX9=B$(B

$B$3$l$^$G>\$7$/@bL@$;$:$K!"JQ499TNs$H$$$&8@MU$rMQ$$$F$-$^$7$?!#

+  +   +                +   + +
|x'|   | cos(a) sin(a) 0|   |x|
|y'| = |-sin(a) cos(a) 0| * |y|
|z'|   |   0      0    1|   |z|
+  +   +                +   + +

$BE@(B(x', y', z') $B$OE@(B(x, y, z) $B$r!"(BZ$B<42s$j$K3QEY(B a $B2sE>$7$?$b$N$G$9!#$3(B $B$N9TNs$,JQ499TNs$G$9!#$7$+$7!"#1\$7$/$O3F<+JY6/$7$F$/$@$5$$(B)$B!#

+  +   +                  +   + +
|x'|   | cos(a) sin(a) 0 l|   |x|
|y'| = |-sin(a) cos(a) 0 m| * |y|
|z'|   |   0      0    1 n|   |z|
|1 |   |   0      0    0 1|   |1|
+  +   +                  +   + +

$B$3$N9TNs$,JQ499TNs$G$9!#$=$7$F!"%*%V%8%'%/%H$N0\F0$@$1$G$O$J$/!";kE@$N(B $BJQ99$d!"%9%/%j!<%s$X$NEj1FJQ49$bF1MM$KJQ499TNs$GI=8=$5$l$^$9!#;kE@$N@_(B $BDj$r$7$?8e$K!"%*%V%8%'%/%H(Ba $B$rJ?9T0\F0(B($BJQ499TNs(B T) $B$7!"%*%V%8%'%/%H(Bb $B$OJ?9T0\F0(B($BF1(B T)$B$H2sE>0\F0(B($BJQ499TNs(B R)$B!"$5$i$K%*%V%8%'%/%H(Bc $B$O2sE>0\F0(B ($BJQ499TNs(B R2) $B$9$k>l9g!"3F%*%V%8%'%/%H$KBP$7$F$=$l$>$lJQ499TNs$r5a$a$k(B $B$N$G$O$J$/!"

  1. $B;kE@>pJs$r4^$s$G$$$J$$JQ499TNs$NJ]B8(B
  2. $B;kE@$N@_Dj8e!"JQ499TNs$NJ]B8(B
  3. $BJ?9T0\F0(B(T)$B8e!"%*%V%8%'%/%H(Ba $B$NIA2h(B
  4. $B$5$i$K2sE>0\F0(B(R)$B8e!"%*%V%8%'%/%H(Bb $B$NIA2h(B
  5. $B;kE@>pJs$r4^$s$@JQ499TNs$rI|5"(B
  6. $B2~$a$F2sE>0\F0(B(R2)$B8e!"%*%V%8%'%/%H(Bc $B$NIA2h(B
  7. $B;kE@>pJs$r4^$s$G$$$J$$JQ499TNs$rI|5"(B

$B:G=i$KJ]B8$7$F$*$-!":G8e$KI|5"$5$;$k$N$O!"$NJ*BN$N>e$K>h$C$F$$$F0l=o$KF0$/$b$N$d!"(B $B!V8*$,F0$1$PEvA3u67$rMF0W$KI=8=$9$k$3$H$,2DG=$G$9!#4JC1(B $B$J(B$B%5%s%W%k%W%m%0%i%`(B ogl-k.c$B$r;29M$K$7$F$/$@$5$$!#(B $B$3$N%5%s%W%k$G$O!"A0=R$7$?%9%`!<%:%7%'!<%G%#%s%0$K$h$k1_Cl$NIA2h$b9T$C(B $B$F$$$^$9!#%W%m%0%i%`$r8+$k$H

5.2 $BK\Ev$N$5$$$4$K(B

$BK\9V=,2q$G$O(B OpenGL $B$NBh0lJbDxEY$NFbMF$K$D$$$F07$C$FMh$^$7$?(B($B$b$7$+$9(B $B$k$H!VH>Jb!WDxEY$+$bCN$l$^$;$s(B :-p)$B!#JQ499TNs$NOC$J$I$+$i$bJ,$+$k$+$H(B $B;W$$$^$9$,!"K\3JE*$KMxMQ$7$h$&$H$9$k$H!"?t3XE*!"4v2?3XE*$JCN<1$,I,MW$H(B $B$J$C$F$-$^$9!#!V6bB0!W$N$h$&$JJ*BN!"!V%W%i%9%A%C%/!W$N$h$&$JJ*BN$rI=8=(B $B$7$?$$>l9g$K$O!"J*M}3XE*!"8w3XE*$JCN<1$,I,MW$H$J$C$F$-$^$9!#$^$?!"?tB?(B $B$/$"$k(B OpenGL $B$N5!G=$N#1$D$K%F%/%9%A%c%^%C%T%s%0$,$"$j$^$9!"(BOpenGL $BBP(B $B1~$N%0%i%U%#%C%/%O!<%I%&%(%"$,$"$k>l9g$K$O$=$NA/$d$+$5$H%9%T!<%I$K6C$/(B $B$3$H$G$7$g$&(B($B$$$d!":r:#$N%2!<%`$K47$l$?3'$5$s$O!"!V$J$s$@!"$3$s$J$b$N(B $B$+!W$H;W$&$+$bCN$l$^$;$s$M(B ;-<)$B!#0J2<$K!";29M$H$J$k%5%$%H!"=q@R$r$"$2(B $B$^$9!"3F<+$G4hD%$C$F$_$F$/$@$5$$!#(B

5.3 $B;29M(B URL$B!"=q@R(B

OpenGL, MesaGL:
http://www.ssec.wisc.edu/~brianp/Mesa.html 
http://www.sgi.com/Technology/OpenGL/Windows/index.html
ftp://ftp.microsoft.com/softlib/MSLFILES/opengl95.exe
GLUT:
http://reality.sgi.com/mjk_asd/glut3/glut3.html

------------------------------------------------------------------------
$B=q@RL>!'(B OpenGL Reference Manual ($BF|K\8lHG(B)
	The Official Reference Document for OpenGL, Release 1
$BCx!'(B OpenGL Programming Guide ($BF|K\8lHG(B)
	The Official Guide to Learning OpenGL, Release 1
$BCx!'(B OpenGL $B%W%m%0%i%_%s%0!&%,%$%I%V%C%/(B
$BCxO@