morph3d.pp 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. {
  2. $Id$
  3. *-
  4. * morph3d.c - Shows 3D morphing objects
  5. *
  6. * Converted to GLUT by brianp on 1/1/98
  7. * Converted to FreePascal by Peter Vreman on 9/3/2000
  8. *
  9. * This program was inspired on a WindowsNT(R)'s screen saver. It was written
  10. * from scratch and it was not based on any other source code.
  11. *
  12. * Porting it to xlock (the final objective of this code since the moment I
  13. * decided to create it) was possible by comparing the original Mesa's gear
  14. * demo with it's ported version, so thanks for Danny Sung for his indirect
  15. * help (look at gear.c in xlock source tree). NOTE: At the moment this code
  16. * was sent to Brian Paul for package inclusion, the XLock Version was not
  17. * available. In fact, I'll wait it to appear on the next Mesa release (If you
  18. * are reading this, it means THIS release) to send it for xlock package
  19. * inclusion). It will probably there be a GLUT version too.
  20. *
  21. * Thanks goes also to Brian Paul for making it possible and inexpensive
  22. * to use OpenGL at home. *
  23. * Since I'm not a native english speaker, my apologies for any gramatical
  24. * mistake.
  25. *
  26. * My e-mail addresses are
  27. *
  28. * [email protected]
  29. * and
  30. * [email protected]
  31. *
  32. * Marcelo F. Vianna (Feb-13-1997)
  33. */
  34. }
  35. program morph3d;
  36. {$mode objfpc}
  37. {
  38. This document is VERY incomplete, but tries to describe the mathematics used
  39. in the program. At this moment it just describes how the polyhedra are
  40. generated. On futhurer versions, this document will be probabbly improved.
  41. Since I'm not a native english speaker, my apologies for any gramatical
  42. mistake.
  43. Marcelo Fernandes Vianna
  44. - Undergraduate in Computer Engeneering at Catholic Pontifical University
  45. - of Rio de Janeiro (PUC-Rio) Brasil.
  46. - e-mail: [email protected] or [email protected]
  47. - Feb-13-1997
  48. POLYHEDRA GENERATION
  49. For the purpose of this program it's not sufficient to know the polyhedra
  50. vertexes coordinates. Since the morphing algorithm applies a nonlinear
  51. transformation over the surfaces (faces) of the polyhedron, each face has
  52. to be divided into smaller ones. The morphing algorithm needs to transform
  53. each vertex of these smaller faces individually. It's a very time consoming
  54. task.
  55. In order to reduce calculation overload, and since all the macro faces of
  56. the polyhedron are transformed by the same way, the generation is made by
  57. creating only one face of the polyhedron, morphing it and then rotating it
  58. around the polyhedron center.
  59. What we need to know is the face radius of the polyhedron (the radius of
  60. the inscribed sphere) and the angle between the center of two adjacent
  61. faces using the center of the sphere as the angle's vertex.
  62. The face radius of the regular polyhedra are known values which I decided
  63. to not waste my time calculating. Following is a table of face radius for
  64. the regular polyhedra with edge length = 1:
  65. TETRAHEDRON : 1/(2*sqrt(2))/sqrt(3)
  66. CUBE : 1/2
  67. OCTAHEDRON : 1/sqrt(6)
  68. DODECAHEDRON : T^2 * sqrt((T+2)/5) / 2 -> where T=(sqrt(5)+1)/2
  69. ICOSAHEDRON : (3*sqrt(3)+sqrt(15))/12
  70. I've not found any reference about the mentioned angles, so I needed to
  71. calculate them, not a trivial task until I figured out how :)
  72. Curiously these angles are the same for the tetrahedron and octahedron.
  73. A way to obtain this value is inscribing the tetrahedron inside the cube
  74. by matching their vertexes. So you'll notice that the remaining unmatched
  75. vertexes are in the same straight line starting in the cube/tetrahedron
  76. center and crossing the center of each tetrahedron's face. At this point
  77. it's easy to obtain the bigger angle of the isosceles triangle formed by
  78. the center of the cube and two opposite vertexes on the same cube face.
  79. The edges of this triangle have the following lenghts: sqrt(2) for the base
  80. and sqrt(3)/2 for the other two other edges. So the angle we want is:
  81. +-----------------------------------------------------------+
  82. | 2*ARCSIN(sqrt(2)/sqrt(3)) = 109.47122063449069174 degrees |
  83. +-----------------------------------------------------------+
  84. For the cube this angle is obvious, but just for formality it can be
  85. easily obtained because we also know it's isosceles edge lenghts:
  86. sqrt(2)/2 for the base and 1/2 for the other two edges. So the angle we
  87. want is:
  88. +-----------------------------------------------------------+
  89. | 2*ARCSIN((sqrt(2)/2)/1) = 90.000000000000000000 degrees |
  90. +-----------------------------------------------------------+
  91. For the octahedron we use the same idea used for the tetrahedron, but now
  92. we inscribe the cube inside the octahedron so that all cubes's vertexes
  93. matches excatly the center of each octahedron's face. It's now clear that
  94. this angle is the same of the thetrahedron one:
  95. +-----------------------------------------------------------+
  96. | 2*ARCSIN(sqrt(2)/sqrt(3)) = 109.47122063449069174 degrees |
  97. +-----------------------------------------------------------+
  98. For the dodecahedron it's a little bit harder because it's only relationship
  99. with the cube is useless to us. So we need to solve the problem by another
  100. way. The concept of Face radius also exists on 2D polygons with the name
  101. Edge radius:
  102. Edge Radius For Pentagon (ERp)
  103. ERp = (1/2)/TAN(36 degrees) * VRp = 0.6881909602355867905
  104. (VRp is the pentagon's vertex radio).
  105. Face Radius For Dodecahedron
  106. FRd = T^2 * sqrt((T+2)/5) / 2 = 1.1135163644116068404
  107. Why we need ERp? Well, ERp and FRd segments forms a 90 degrees angle,
  108. completing this triangle, the lesser angle is a half of the angle we are
  109. looking for, so this angle is:
  110. +-----------------------------------------------------------+
  111. | 2*ARCTAN(ERp/FRd) = 63.434948822922009981 degrees |
  112. +-----------------------------------------------------------+
  113. For the icosahedron we can use the same method used for dodecahedron (well
  114. the method used for dodecahedron may be used for all regular polyhedra)
  115. Edge Radius For Triangle (this one is well known: 1/3 of the triangle height)
  116. ERt = sin(60)/3 = sqrt(3)/6 = 0.2886751345948128655
  117. Face Radius For Icosahedron
  118. FRi= (3*sqrt(3)+sqrt(15))/12 = 0.7557613140761707538
  119. So the angle is:
  120. +-----------------------------------------------------------+
  121. | 2*ARCTAN(ERt/FRi) = 41.810314895778596167 degrees |
  122. +-----------------------------------------------------------+
  123. }
  124. uses
  125. GL,GLUT;
  126. type
  127. float = single;
  128. const
  129. Scale = 0.3;
  130. // #define sqr(A) ((A)*(A))
  131. // Increasing this values produces better image quality, the price is speed.
  132. // Very low values produces erroneous/incorrect plotting
  133. tetradivisions = 23;
  134. cubedivisions = 20;
  135. octadivisions = 21;
  136. dodecadivisions = 10;
  137. icodivisions = 15;
  138. tetraangle = 109.47122063449069174;
  139. cubeangle = 90.000000000000000000;
  140. octaangle = 109.47122063449069174;
  141. dodecaangle = 63.434948822922009981;
  142. icoangle = 41.810314895778596167;
  143. //#define Pi 3.1415926535897932385
  144. SQRT2 = 1.4142135623730951455;
  145. SQRT3 = 1.7320508075688771932;
  146. SQRT5 = 2.2360679774997898051;
  147. SQRT6 = 2.4494897427831778813;
  148. SQRT15 = 3.8729833462074170214;
  149. cossec36_2 = 0.8506508083520399322;
  150. cos72 = 0.3090169943749474241;
  151. sin72 = 0.9510565162951535721;
  152. cos36 = 0.8090169943749474241;
  153. sin36 = 0.5877852522924731292;
  154. {*************************************************************************}
  155. const
  156. mono : boolean=false;
  157. smooth : boolean=true;
  158. var
  159. WindH,WindW : GLint;
  160. step,seno : GLFloat;
  161. _object : glint;
  162. edgedivisions : glint;
  163. draw_object : procedure;
  164. Magnitude : glfloat;
  165. MaterialColor : array[0..19] of pglfloat;
  166. const
  167. front_shininess : array[0..0] of glfloat = (60.0);
  168. front_specular : array[0..3] of glfloat = ( 0.7, 0.7, 0.7, 1.0 );
  169. ambient : array[0..3] of glfloat = ( 0.0, 0.0, 0.0, 1.0 );
  170. diffuse : array[0..3] of glfloat = ( 1.0, 1.0, 1.0, 1.0 );
  171. position0 : array[0..3] of glfloat = ( 1.0, 1.0, 1.0, 0.0 );
  172. position1 : array[0..3] of glfloat = (-1.0,-1.0, 1.0, 0.0 );
  173. lmodel_ambient : array[0..3] of glfloat = ( 0.5, 0.5, 0.5, 1.0 );
  174. lmodel_twoside : array[0..0] of glfloat = (GL_TRUE);
  175. MaterialRed : array[0..3] of glfloat = ( 0.7, 0.0, 0.0, 1.0 );
  176. MaterialGreen : array[0..3] of glfloat = ( 0.1, 0.5, 0.2, 1.0 );
  177. MaterialBlue : array[0..3] of glfloat = ( 0.0, 0.0, 0.7, 1.0 );
  178. MaterialCyan : array[0..3] of glfloat = ( 0.2, 0.5, 0.7, 1.0 );
  179. MaterialYellow : array[0..3] of glfloat = ( 0.7, 0.7, 0.0, 1.0 );
  180. MaterialMagenta : array[0..3] of glfloat = ( 0.6, 0.2, 0.5, 1.0 );
  181. MaterialWhite : array[0..3] of glfloat = ( 0.7, 0.7, 0.7, 1.0 );
  182. MaterialGray : array[0..3] of glfloat = ( 0.2, 0.2, 0.2, 1.0 );
  183. procedure TRIANGLE(Edge,Amp:GLFloat; Divisions: longint; Z:GLFloat);
  184. var
  185. Xf,Yf,Xa,Yb,Xf2,Yf2 : Extended;
  186. Factor,Factor1,Factor2 : GLfloat;
  187. VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ : GLfloat;
  188. Ax,Ay,Bx : GLfloat;
  189. Ri,Ti : longint;
  190. Vr : GLfloat;
  191. AmpVr2 : GLfloat;
  192. Zf : GLfloat;
  193. begin
  194. Vr:=(Edge)*SQRT3/3;
  195. AmpVr2:=(Amp)/sqr(Vr);
  196. Zf:=(Edge)*(Z);
  197. Ax:=(Edge)*(+0.5/(Divisions));
  198. Ay:=(Edge)*(-SQRT3/(2*Divisions));
  199. Bx:=(Edge)*(-0.5/(Divisions));
  200. for Ri:=1 to Divisions do
  201. begin
  202. glBegin(GL_TRIANGLE_STRIP);
  203. for Ti:=0 to Ri-1 do
  204. begin
  205. Xf:=(Ri-Ti)*Ax + Ti*Bx;
  206. Yf:=Vr+(Ri-Ti)*Ay + Ti*Ay;
  207. Xa:=Xf+0.001; Yb:=Yf+0.001;
  208. Xf2:=sqr(Xf);
  209. Yf2:=sqr(Yf);
  210. Factor:=1-(((Xf2)+(Yf2))*AmpVr2);
  211. Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2);
  212. Factor2:=1-((Xf2+sqr(Yb))*AmpVr2);
  213. VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf;
  214. NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ;
  215. NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ;
  216. glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX);
  217. glVertex3f(VertX, VertY, VertZ);
  218. Xf:=(Ri-Ti-1)*Ax + Ti*Bx;
  219. Yf:=Vr+(Ri-Ti-1)*Ay + Ti*Ay;
  220. Xa:=Xf+0.001; Yb:=Yf+0.001;
  221. Xf2:=sqr(Xf);
  222. Yf2:=sqr(Yf);
  223. Factor:=1-(((Xf2)+(Yf2))*AmpVr2);
  224. Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2);
  225. Factor2:=1-((Xf2+sqr(Yb))*AmpVr2);
  226. VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf;
  227. NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ;
  228. NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ;
  229. glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX);
  230. glVertex3f(VertX, VertY, VertZ);
  231. end;
  232. Xf:=Ri*Bx;
  233. Yf:=Vr+Ri*Ay;
  234. Xa:=Xf+0.001; Yb:=Yf+0.001;
  235. Xf2:=sqr(Xf);
  236. Yf2:=sqr(Yf);
  237. Factor:=1-((Xf2+Yf2)*AmpVr2);
  238. Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2);
  239. Factor2:=1-((Xf2+sqr(Yb))*AmpVr2);
  240. VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf;
  241. NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ;
  242. NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ;
  243. glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX);
  244. glVertex3f(VertX, VertY, VertZ);
  245. glEnd();
  246. end;
  247. end;
  248. procedure SQUARE(Edge,Amp:GLFloat; Divisions: longint; Z:GLFloat);
  249. var
  250. Xi,Yi : longint;
  251. Xf,Yf,Y,Y2,Xf2,Yf2,Xa,Yb : GLfloat;
  252. Factor,Factor1,Factor2 : GLfloat;
  253. VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ : GLfloat;
  254. AmpVr2 : GLfloat;
  255. Zf : GLfloat;
  256. begin
  257. AmpVr2:=(Amp)/sqr((Edge)*SQRT2/2);
  258. Zf:=(Edge)*(Z);
  259. for Yi:=0 to Divisions-1 do
  260. begin
  261. Yf:=-((Edge)/2.0) + (Yi)/(Divisions)*(Edge);
  262. Yf2:=sqr(Yf);
  263. Y:=Yf+1.0/(Divisions)*(Edge);
  264. Y2:=sqr(Y);
  265. glBegin(GL_QUAD_STRIP);
  266. for Xi:=0 to Divisions do
  267. begin
  268. Xf:=-((Edge)/2.0) + (Xi)/(Divisions)*(Edge);
  269. Xf2:=sqr(Xf);
  270. Xa:=Xf+0.001; Yb:=Y+0.001;
  271. Factor:=1-((Xf2+Y2)*AmpVr2);
  272. Factor1:=1-((sqr(Xa)+Y2)*AmpVr2);
  273. Factor2:=1-((Xf2+sqr(Yb))*AmpVr2);
  274. VertX:=Factor*Xf; VertY:=Factor*Y; VertZ:=Factor*Zf;
  275. NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Y-VertY; NeiAZ:=Factor1*Zf-VertZ;
  276. NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ;
  277. glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX);
  278. glVertex3f(VertX, VertY, VertZ);
  279. Xa:=Xf+0.001; Yb:=Yf+0.001;
  280. Factor:=1-((Xf2+Yf2)*AmpVr2);
  281. Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2);
  282. Factor2:=1-((Xf2+sqr(Yb))*AmpVr2);
  283. VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf;
  284. NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ;
  285. NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ;
  286. glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX);
  287. glVertex3f(VertX, VertY, VertZ);
  288. end;
  289. glEnd();
  290. end;
  291. end;
  292. procedure PENTAGON(Edge,Amp:GLFloat; Divisions: longint; Z:GLFloat);
  293. var
  294. Ri,Ti,Fi : longint;
  295. Xf,Yf,Xf2,Yf2,Xa,Yb : GLfloat;
  296. X,Y : array[0..5] of GLFloat;
  297. Factor,Factor1,Factor2 : GLfloat;
  298. VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ : GLfloat;
  299. AmpVr2 : GLfloat;
  300. Zf : GLfloat;
  301. begin
  302. AmpVr2:=(Amp)/sqr((Edge)*cossec36_2);
  303. Zf:=(Edge)*(Z);
  304. for Fi:=0 to 5 do
  305. begin
  306. x[Fi]:=-cos( Fi*2*Pi/5 + Pi/10 )/(Divisions)*cossec36_2*(Edge);
  307. y[Fi]:=sin( Fi*2*Pi/5 + Pi/10 )/(Divisions)*cossec36_2*(Edge);
  308. end;
  309. for Ri:=1 to Divisions do
  310. begin
  311. for Fi:=0 to 4 do
  312. begin
  313. glBegin(GL_TRIANGLE_STRIP);
  314. for Ti:=0 to Ri-1 do
  315. begin
  316. Xf:=(Ri-Ti)*x[Fi] + Ti*x[Fi+1];
  317. Yf:=(Ri-Ti)*y[Fi] + Ti*y[Fi+1];
  318. Xa:=Xf+0.001; Yb:=Yf+0.001;
  319. Xf2:=sqr(Xf);
  320. Yf2:=sqr(Yf);
  321. Factor:=1-(((Xf2)+(Yf2))*AmpVr2);
  322. Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2);
  323. Factor2:=1-((Xf2+sqr(Yb))*AmpVr2);
  324. VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf;
  325. NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ;
  326. NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ;
  327. glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX);
  328. glVertex3f(VertX, VertY, VertZ);
  329. Xf:=(Ri-Ti-1)*x[Fi] + Ti*x[Fi+1];
  330. Yf:=(Ri-Ti-1)*y[Fi] + Ti*y[Fi+1];
  331. Xa:=Xf+0.001; Yb:=Yf+0.001;
  332. Xf2:=sqr(Xf);
  333. Yf2:=sqr(Yf);
  334. Factor:=1-(((Xf2)+(Yf2))*AmpVr2);
  335. Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2);
  336. Factor2:=1-((Xf2+sqr(Yb))*AmpVr2);
  337. VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf;
  338. NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ;
  339. NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ;
  340. glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX);
  341. glVertex3f(VertX, VertY, VertZ);
  342. end;
  343. Xf:=Ri*x[Fi+1];
  344. Yf:=Ri*y[Fi+1];
  345. Xa:=Xf+0.001; Yb:=Yf+0.001;
  346. Xf2:=sqr(Xf);
  347. Yf2:=sqr(Yf);
  348. Factor:=1-(((Xf2)+(Yf2))*AmpVr2);
  349. Factor1:=1-((sqr(Xa)+Yf2)*AmpVr2);
  350. Factor2:=1-((Xf2+sqr(Yb))*AmpVr2);
  351. VertX:=Factor*Xf; VertY:=Factor*Yf; VertZ:=Factor*Zf;
  352. NeiAX:=Factor1*Xa-VertX; NeiAY:=Factor1*Yf-VertY; NeiAZ:=Factor1*Zf-VertZ;
  353. NeiBX:=Factor2*Xf-VertX; NeiBY:=Factor2*Yb-VertY; NeiBZ:=Factor2*Zf-VertZ;
  354. glNormal3f(NeiAY*NeiBZ-NeiAZ*NeiBY,NeiAZ*NeiBX-NeiAX*NeiBZ,NeiAX*NeiBY-NeiAY*NeiBX);
  355. glVertex3f(VertX, VertY, VertZ);
  356. glEnd();
  357. end;
  358. end;
  359. end;
  360. procedure draw_tetra;
  361. var
  362. list : GLuint;
  363. begin
  364. list := glGenLists( 1 );
  365. glNewList( list, GL_COMPILE );
  366. TRIANGLE(2,seno,edgedivisions,0.5/SQRT6);
  367. glEndList();
  368. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
  369. glCallList(list);
  370. glPushMatrix();
  371. glRotatef(180,0,0,1);
  372. glRotatef(-tetraangle,1,0,0);
  373. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
  374. glCallList(list);
  375. glPopMatrix();
  376. glPushMatrix();
  377. glRotatef(180,0,1,0);
  378. glRotatef(-180+tetraangle,0.5,SQRT3/2,0);
  379. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
  380. glCallList(list);
  381. glPopMatrix();
  382. glRotatef(180,0,1,0);
  383. glRotatef(-180+tetraangle,0.5,-SQRT3/2,0);
  384. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
  385. glCallList(list);
  386. glDeleteLists(list,1);
  387. end;
  388. procedure draw_cube;
  389. var
  390. list : GLuint;
  391. begin
  392. list := glGenLists( 1 );
  393. glNewList( list, GL_COMPILE );
  394. SQUARE(2, seno, edgedivisions, 0.5);
  395. glEndList();
  396. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
  397. glCallList(list);
  398. glRotatef(cubeangle,1,0,0);
  399. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
  400. glCallList(list);
  401. glRotatef(cubeangle,1,0,0);
  402. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
  403. glCallList(list);
  404. glRotatef(cubeangle,1,0,0);
  405. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
  406. glCallList(list);
  407. glRotatef(cubeangle,0,1,0);
  408. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]);
  409. glCallList(list);
  410. glRotatef(2*cubeangle,0,1,0);
  411. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]);
  412. glCallList(list);
  413. glDeleteLists(list,1);
  414. end;
  415. procedure draw_octa;
  416. var
  417. list : GLuint;
  418. begin
  419. list := glGenLists( 1 );
  420. glNewList( list, GL_COMPILE );
  421. TRIANGLE(2,seno,edgedivisions,1/SQRT6);
  422. glEndList();
  423. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
  424. glCallList(list);
  425. glPushMatrix();
  426. glRotatef(180,0,0,1);
  427. glRotatef(-180+octaangle,1,0,0);
  428. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
  429. glCallList(list);
  430. glPopMatrix();
  431. glPushMatrix();
  432. glRotatef(180,0,1,0);
  433. glRotatef(-octaangle,0.5,SQRT3/2,0);
  434. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
  435. glCallList(list);
  436. glPopMatrix();
  437. glPushMatrix();
  438. glRotatef(180,0,1,0);
  439. glRotatef(-octaangle,0.5,-SQRT3/2,0);
  440. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
  441. glCallList(list);
  442. glPopMatrix();
  443. glRotatef(180,1,0,0);
  444. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]);
  445. glCallList(list);
  446. glPushMatrix();
  447. glRotatef(180,0,0,1);
  448. glRotatef(-180+octaangle,1,0,0);
  449. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]);
  450. glCallList(list);
  451. glPopMatrix();
  452. glPushMatrix();
  453. glRotatef(180,0,1,0);
  454. glRotatef(-octaangle,0.5,SQRT3/2,0);
  455. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]);
  456. glCallList(list);
  457. glPopMatrix();
  458. glRotatef(180,0,1,0);
  459. glRotatef(-octaangle,0.5,-SQRT3/2,0);
  460. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]);
  461. glCallList(list);
  462. glDeleteLists(list,1);
  463. end;
  464. procedure draw_dodeca;
  465. const
  466. TAU = ((SQRT5+1)/2);
  467. var
  468. list : GLuint;
  469. begin
  470. list := glGenLists( 1 );
  471. glNewList( list, GL_COMPILE );
  472. PENTAGON(1,seno,edgedivisions,sqr(TAU) * sqrt((TAU+2)/5) / 2);
  473. glEndList();
  474. glPushMatrix();
  475. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
  476. glCallList(list);
  477. glRotatef(180,0,0,1);
  478. glPushMatrix();
  479. glRotatef(-dodecaangle,1,0,0);
  480. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
  481. glCallList(list);
  482. glPopMatrix();
  483. glPushMatrix();
  484. glRotatef(-dodecaangle,cos72,sin72,0);
  485. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
  486. glCallList(list);
  487. glPopMatrix();
  488. glPushMatrix();
  489. glRotatef(-dodecaangle,cos72,-sin72,0);
  490. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
  491. glCallList(list);
  492. glPopMatrix();
  493. glPushMatrix();
  494. glRotatef(dodecaangle,cos36,-sin36,0);
  495. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]);
  496. glCallList(list);
  497. glPopMatrix();
  498. glRotatef(dodecaangle,cos36,sin36,0);
  499. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]);
  500. glCallList(list);
  501. glPopMatrix();
  502. glRotatef(180,1,0,0);
  503. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]);
  504. glCallList(list);
  505. glRotatef(180,0,0,1);
  506. glPushMatrix();
  507. glRotatef(-dodecaangle,1,0,0);
  508. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]);
  509. glCallList(list);
  510. glPopMatrix();
  511. glPushMatrix();
  512. glRotatef(-dodecaangle,cos72,sin72,0);
  513. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[8]);
  514. glCallList(list);
  515. glPopMatrix();
  516. glPushMatrix();
  517. glRotatef(-dodecaangle,cos72,-sin72,0);
  518. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[9]);
  519. glCallList(list);
  520. glPopMatrix();
  521. glPushMatrix();
  522. glRotatef(dodecaangle,cos36,-sin36,0);
  523. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[10]);
  524. glCallList(list);
  525. glPopMatrix();
  526. glRotatef(dodecaangle,cos36,sin36,0);
  527. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[11]);
  528. glCallList(list);
  529. glDeleteLists(list,1);
  530. end;
  531. procedure draw_ico;
  532. var
  533. list : GLuint;
  534. begin
  535. list := glGenLists( 1 );
  536. glNewList( list, GL_COMPILE );
  537. TRIANGLE(1.5,seno,edgedivisions,(3*SQRT3+SQRT15)/12);
  538. glEndList();
  539. glPushMatrix();
  540. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[0]);
  541. glCallList(list);
  542. glPushMatrix();
  543. glRotatef(180,0,0,1);
  544. glRotatef(-icoangle,1,0,0);
  545. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[1]);
  546. glCallList(list);
  547. glPushMatrix();
  548. glRotatef(180,0,1,0);
  549. glRotatef(-180+icoangle,0.5,SQRT3/2,0);
  550. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[2]);
  551. glCallList(list);
  552. glPopMatrix();
  553. glRotatef(180,0,1,0);
  554. glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
  555. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[3]);
  556. glCallList(list);
  557. glPopMatrix();
  558. glPushMatrix();
  559. glRotatef(180,0,1,0);
  560. glRotatef(-180+icoangle,0.5,SQRT3/2,0);
  561. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[4]);
  562. glCallList(list);
  563. glPushMatrix();
  564. glRotatef(180,0,1,0);
  565. glRotatef(-180+icoangle,0.5,SQRT3/2,0);
  566. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[5]);
  567. glCallList(list);
  568. glPopMatrix();
  569. glRotatef(180,0,0,1);
  570. glRotatef(-icoangle,1,0,0);
  571. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[6]);
  572. glCallList(list);
  573. glPopMatrix();
  574. glRotatef(180,0,1,0);
  575. glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
  576. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[7]);
  577. glCallList(list);
  578. glPushMatrix();
  579. glRotatef(180,0,1,0);
  580. glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
  581. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[8]);
  582. glCallList(list);
  583. glPopMatrix();
  584. glRotatef(180,0,0,1);
  585. glRotatef(-icoangle,1,0,0);
  586. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[9]);
  587. glCallList(list);
  588. glPopMatrix();
  589. glRotatef(180,1,0,0);
  590. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[10]);
  591. glCallList(list);
  592. glPushMatrix();
  593. glRotatef(180,0,0,1);
  594. glRotatef(-icoangle,1,0,0);
  595. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[11]);
  596. glCallList(list);
  597. glPushMatrix();
  598. glRotatef(180,0,1,0);
  599. glRotatef(-180+icoangle,0.5,SQRT3/2,0);
  600. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[12]);
  601. glCallList(list);
  602. glPopMatrix();
  603. glRotatef(180,0,1,0);
  604. glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
  605. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[13]);
  606. glCallList(list);
  607. glPopMatrix();
  608. glPushMatrix();
  609. glRotatef(180,0,1,0);
  610. glRotatef(-180+icoangle,0.5,SQRT3/2,0);
  611. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[14]);
  612. glCallList(list);
  613. glPushMatrix();
  614. glRotatef(180,0,1,0);
  615. glRotatef(-180+icoangle,0.5,SQRT3/2,0);
  616. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[15]);
  617. glCallList(list);
  618. glPopMatrix();
  619. glRotatef(180,0,0,1);
  620. glRotatef(-icoangle,1,0,0);
  621. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[16]);
  622. glCallList(list);
  623. glPopMatrix();
  624. glRotatef(180,0,1,0);
  625. glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
  626. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[17]);
  627. glCallList(list);
  628. glPushMatrix();
  629. glRotatef(180,0,1,0);
  630. glRotatef(-180+icoangle,0.5,-SQRT3/2,0);
  631. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[18]);
  632. glCallList(list);
  633. glPopMatrix();
  634. glRotatef(180,0,0,1);
  635. glRotatef(-icoangle,1,0,0);
  636. glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialColor[19]);
  637. glCallList(list);
  638. glDeleteLists(list,1);
  639. end;
  640. procedure do_draw; cdecl;
  641. begin
  642. glClear( GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT );
  643. glPushMatrix();
  644. glTranslatef( 0.0, 0.0, -10.0 );
  645. glScalef( Scale*WindH/WindW, Scale, Scale );
  646. glTranslatef(2.5*WindW/WindH*sin(step*1.11),2.5*cos(step*1.25*1.11),0);
  647. glRotatef(step*100,1,0,0);
  648. glRotatef(step*95,0,1,0);
  649. glRotatef(step*90,0,0,1);
  650. seno:=(sin(step)+1.0/3.0)*(4.0/5.0)*Magnitude;
  651. draw_object();
  652. glPopMatrix();
  653. glFlush();
  654. glutSwapBuffers();
  655. step:=step+0.05;
  656. end;
  657. procedure do_idle; cdecl;
  658. begin
  659. glutPostRedisplay();
  660. end;
  661. procedure do_reshape(width,height:longint); cdecl;
  662. begin
  663. WindW:=width;
  664. WindH:=height;
  665. glViewport(0, 0, width, height);
  666. glMatrixMode(GL_PROJECTION);
  667. glLoadIdentity();
  668. glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 );
  669. glMatrixMode(GL_MODELVIEW);
  670. end;
  671. procedure pinit;
  672. var
  673. loop : longint;
  674. begin
  675. case _object of
  676. 1 :
  677. begin
  678. draw_object:=@draw_tetra;
  679. MaterialColor[0]:=@MaterialRed;
  680. MaterialColor[1]:=@MaterialGreen;
  681. MaterialColor[2]:=@MaterialBlue;
  682. MaterialColor[3]:=@MaterialWhite;
  683. edgedivisions:=tetradivisions;
  684. Magnitude:=2.5;
  685. end;
  686. 2:
  687. begin
  688. draw_object:=@draw_cube;
  689. MaterialColor[0]:=@MaterialRed;
  690. MaterialColor[1]:=@MaterialGreen;
  691. MaterialColor[2]:=@MaterialCyan;
  692. MaterialColor[3]:=@MaterialMagenta;
  693. MaterialColor[4]:=@MaterialYellow;
  694. MaterialColor[5]:=@MaterialBlue;
  695. edgedivisions:=cubedivisions;
  696. Magnitude:=2.0;
  697. end;
  698. 3:
  699. begin
  700. draw_object:=@draw_octa;
  701. MaterialColor[0]:=MaterialRed;
  702. MaterialColor[1]:=MaterialGreen;
  703. MaterialColor[2]:=MaterialBlue;
  704. MaterialColor[3]:=MaterialWhite;
  705. MaterialColor[4]:=MaterialCyan;
  706. MaterialColor[5]:=MaterialMagenta;
  707. MaterialColor[6]:=MaterialGray;
  708. MaterialColor[7]:=MaterialYellow;
  709. edgedivisions:=octadivisions;
  710. Magnitude:=2.5;
  711. end;
  712. 4:
  713. begin
  714. draw_object:=@draw_dodeca;
  715. MaterialColor[ 0]:=MaterialRed;
  716. MaterialColor[ 1]:=MaterialGreen;
  717. MaterialColor[ 2]:=MaterialCyan;
  718. MaterialColor[ 3]:=MaterialBlue;
  719. MaterialColor[ 4]:=MaterialMagenta;
  720. MaterialColor[ 5]:=MaterialYellow;
  721. MaterialColor[ 6]:=MaterialGreen;
  722. MaterialColor[ 7]:=MaterialCyan;
  723. MaterialColor[ 8]:=MaterialRed;
  724. MaterialColor[ 9]:=MaterialMagenta;
  725. MaterialColor[10]:=MaterialBlue;
  726. MaterialColor[11]:=MaterialYellow;
  727. edgedivisions:=dodecadivisions;
  728. Magnitude:=2.0;
  729. end;
  730. 5:
  731. begin
  732. draw_object:=@draw_ico;
  733. MaterialColor[ 0]:=MaterialRed;
  734. MaterialColor[ 1]:=MaterialGreen;
  735. MaterialColor[ 2]:=MaterialBlue;
  736. MaterialColor[ 3]:=MaterialCyan;
  737. MaterialColor[ 4]:=MaterialYellow;
  738. MaterialColor[ 5]:=MaterialMagenta;
  739. MaterialColor[ 6]:=MaterialRed;
  740. MaterialColor[ 7]:=MaterialGreen;
  741. MaterialColor[ 8]:=MaterialBlue;
  742. MaterialColor[ 9]:=MaterialWhite;
  743. MaterialColor[10]:=MaterialCyan;
  744. MaterialColor[11]:=MaterialYellow;
  745. MaterialColor[12]:=MaterialMagenta;
  746. MaterialColor[13]:=MaterialRed;
  747. MaterialColor[14]:=MaterialGreen;
  748. MaterialColor[15]:=MaterialBlue;
  749. MaterialColor[16]:=MaterialCyan;
  750. MaterialColor[17]:=MaterialYellow;
  751. MaterialColor[18]:=MaterialMagenta;
  752. MaterialColor[19]:=MaterialGray;
  753. edgedivisions:=icodivisions;
  754. Magnitude:=2.5;
  755. end;
  756. end;
  757. if (mono) then
  758. begin
  759. for loop:=0 to 19 do
  760. MaterialColor[loop]:=MaterialGray;
  761. end;
  762. if (smooth) then
  763. glShadeModel( GL_SMOOTH )
  764. else
  765. glShadeModel( GL_FLAT );
  766. end;
  767. procedure do_key(k:byte;x,y:integer); cdecl;
  768. begin
  769. case Char(k) of
  770. '1' : _object:=1;
  771. '2' : _object:=2;
  772. '3' : _object:=3;
  773. '4' : _object:=4;
  774. '5' : _object:=5;
  775. ' ' : mono:=not mono;
  776. #13 : smooth:=not smooth;
  777. #27 : halt(0);
  778. end;
  779. pinit;
  780. end;
  781. begin
  782. writeln('Morph 3D - Shows morphing platonic polyhedra');
  783. writeln('Author: Marcelo Fernandes Vianna ([email protected])');
  784. writeln(' [1] - Tetrahedron');
  785. writeln(' [2] - Hexahedron (Cube)');
  786. writeln(' [3] - Octahedron');
  787. writeln(' [4] - Dodecahedron');
  788. writeln(' [5] - Icosahedron');
  789. writeln('[SPACE] - Toggle colored faces');
  790. writeln('[RETURN] - Toggle smooth/flat shading');
  791. writeln(' [ESC] - Quit');
  792. _object:=3;
  793. glutInit(@argc, argv);
  794. glutInitWindowPosition(0,0);
  795. glutInitWindowSize(640,480);
  796. glutInitDisplayMode( GLUT_DEPTH + GLUT_DOUBLE + GLUT_RGB );
  797. if (glutCreateWindow('Morph 3D - Shows morphing platonic polyhedra') <= 0) then
  798. halt(1);
  799. glClearDepth(1.0);
  800. glClearColor( 0.0, 0.0, 0.0, 1.0 );
  801. glColor3f( 1.0, 1.0, 1.0 );
  802. glClear( GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT );
  803. glFlush();
  804. glutSwapBuffers();
  805. glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
  806. glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
  807. glLightfv(GL_LIGHT0, GL_POSITION, position0);
  808. glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
  809. glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
  810. glLightfv(GL_LIGHT1, GL_POSITION, position1);
  811. glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
  812. glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
  813. glEnable(GL_LIGHTING);
  814. glEnable(GL_LIGHT0);
  815. glEnable(GL_LIGHT1);
  816. glEnable(GL_DEPTH_TEST);
  817. glEnable(GL_NORMALIZE);
  818. glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
  819. glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
  820. glHint(GL_FOG_HINT, GL_FASTEST);
  821. glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
  822. glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST);
  823. pinit();
  824. glutReshapeFunc( @do_reshape );
  825. glutKeyboardFunc( @do_key );
  826. glutIdleFunc( @do_idle );
  827. glutDisplayFunc( @do_draw );
  828. glutMainLoop();
  829. end.
  830. {
  831. $Log$
  832. Revision 1.3 2004-11-24 20:49:03 jonas
  833. + added glutInit() calls where they were missing
  834. * made sure that the glutDisplayFunc() is registered in time (new check
  835. as of glut 3.0)
  836. -> all demos now work under Mac OS X!
  837. Revision 1.2 2002/12/18 13:33:20 pierre
  838. * objfpc mode added to be able to compile the demos correctly from IDE
  839. Revision 1.1 2002/10/13 14:01:45 sg
  840. * added the new, adapted OpenGL examples...
  841. Revision 1.4 2002/09/07 15:43:05 peter
  842. * old logs removed and tabs fixed
  843. Revision 1.3 2002/08/06 09:09:17 michael
  844. + Fixed missing @
  845. Revision 1.2 2002/05/31 11:54:33 marco
  846. * Renamefest for 1.0, many 1.1.x spots patched also.
  847. Revision 1.1 2002/01/29 17:55:19 peter
  848. * splitted to base and extra
  849. }