Allink  v0.1
DrawScene.cpp
1 #include <Draw.h>
2 
3 #ifdef __glut_h__
4 #include <vector>
5 int Detail = 20;
6 GLfloat luceAmbiente[4] = { .1, .1, .1,1.};
7 GLfloat luceDiffusa[4] = { 1., 1., 1.,1.};
8 GLfloat luceSpeculare[] = { 1.0, 1.0, 1.0,1.};
9 GLfloat direzione[4] = { 1.0, 1.0, 0.0,1.};
10 GLfloat posizioneLight0[4] = { 1., 1., 1.0,0.};
11 GLfloat posizioneLight1[4] = { 1., 0., 1.0,0.};
12 //int width=600,height=600;
13 GLint MaterialShininess = 50;
14 
15 void Draw::DMinimal(void){
16  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
17  glClearColor(Rback,Gback,Bback,Aback);//colore sfondo
18  glPushMatrix();//Whell
19  glTranslatef(0,0,zw);
20  glPushMatrix();//Rotation
21  glRotatef(xa,1.,0.,0.);
22  glRotatef(ya,0.,1.,0.);
23  glRotatef(za,0.,0.,1.);
24  glPushMatrix();//Translation
25  //glTranslatef(xp,yp,zp);
26  //glTranslatef(-.5*Edge[0]*InvScaleUn,-.5*Edge[1]*InvScaleUn,-.5*Edge[2]*InvScaleUn);
27  glCallList(Particles);
28  ParticleRealTime();
29  glPopMatrix();//Translation
30  glPopMatrix();//Rotation
31  glPopMatrix();//Wheel
32  //glFlush(); //Finish rendering
33  glutSwapBuffers();
34 }
35 void Draw::DFigure(void){
36  glMatrixMode( GL_MODELVIEW );
37  // pixel = (GLuint *)realloc(pixel,4*width*height*sizeof(*pixel));
38  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
39  glClearColor(Rback,Gback,Bback,Aback);//colore sfondo
40  glPushMatrix();//Whell
41  glTranslatef(0,0,zw);
42  glPushMatrix();//Rotation
43  glRotatef(xa,1.,0.,0.);
44  glRotatef(ya,0.,1.,0.);
45  glRotatef(za,0.,0.,1.);
46  glPushMatrix();//Translation
47  glTranslatef(xp,yp,zp);
48  glTranslatef(-.5*Edge[0]*InvScaleUn,-.5*Edge[1]*InvScaleUn,-.5*Edge[2]*InvScaleUn);
49  if(IfBlend) glEnable(GL_DEPTH_TEST);
50  else glDisable(GL_DEPTH_TEST);
51  glBlendFunc(BlendSource,BlendDest);
52  if(lu != 0){
53  glPushMatrix();//Light
54  glRotatef(xf,1.,0.,0.);
55  glRotatef(yf,0.,1.,0.);
56  glRotatef(zf,0.,0.,1.);
57  glTranslatef(1.5*Edge[0]*InvScaleUn,1.5*Edge[1]*InvScaleUn,1.5*Edge[2]*InvScaleUn);
58  GLfloat PosLight[4] = {xl0,yl0,zl0,1.};
59  glLightfv(GL_LIGHT0,GL_POSITION,PosLight);
60  //glLightfv(GL_LIGHT1,GL_POSITION,posizioneLight1);
61  //glutSolidSphere(0.05,20,20);
62  glPopMatrix();//Light
63  }
64  int PreChain = 0;
65  glCallList(Particles);
66  if(IfScript)
67  glCallList(ScriptList);
68  ParticleRealTime();
69  if(IfImage){
70  glPushMatrix();
71  // glTranslatef(.5,.7,1.6);
72  glDrawPixels(ImWidth,ImHeight,GL_RGBA,GL_UNSIGNED_BYTE,pixel);
73  glPopMatrix();
74  }
75  if(la!=0){
76  glPushAttrib(GL_LIGHTING_BIT);
77  glDisable(GL_LIGHTING);
78  glColor4f(1.-Rback,1.-Gback,1.-Bback,1.0);
79  glPushMatrix();//Cube
80  glTranslated(.5*Edge[0]*InvScaleUn,.5*Edge[1]*InvScaleUn,.5*Edge[2]*InvScaleUn);
81  glScalef((GLfloat)Edge[0]*InvScaleUn,
82  (GLfloat)Edge[1]*InvScaleUn,
83  (GLfloat)(Edge[2])*InvScaleUn);
84  glutWireCube((GLfloat)1.);
85  glPopMatrix();//Cube
86  glPopAttrib();
87  }
88  if(gr != 0){
89  glColor4f(1.-Rback,1.-Gback,1.-Bback,1.0);
90  glPushMatrix();//Griglia
91  //glTranslated(0.,0.,Edge[2]*InvScaleUn);
92  glPopMatrix();//Griglia
93  glCallList(Griglia);
94  }
95  glPopMatrix();//Translation
96  glPopMatrix();//Rotation
97  glPopMatrix();//Wheel
98  //Text
99  // glDisable(GL_TEXTURE_2D);
100  // glDisable(GL_LIGHTING);
101  // glDisable(GL_DEPTH_TEST);
102  // glLoadIdentity();
103  // glMatrixMode(GL_PROJECTION);
104  // glPushMatrix();
105  // glLoadIdentity();
106  // glOrtho(0,WinWidth,0,WinHeight,-1.0,1.0);
107  if(IfInfo){
108  glPushMatrix();//Info
109  glColor4f(1.-Rback,1.-Gback,1.-Bback,1.0);
110  glRasterPos3d(xi, yi, zi);
111  int len = (int)strlen(info);
112  for (int i = 0; i < len; i++) {
113  glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, info[i]);
114  //glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, info[i]);
115  }
116  glPopMatrix();//Info
117  }
118  glCallList(DrLegend);
119  glFlush(); //Finish rendering
120  glutSwapBuffers();
121 }
122 void Draw::Draw1(){
123  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
124  glPushMatrix();//Translation
125  glTranslatef(xp,yp,zp);
126  glPushMatrix();//Rotation
127  glRotatef(xa,1.,0.,0.);
128  glRotatef(ya,0.,1.,0.);
129  glRotatef(za,0.,0.,1.);
130  glTranslatef(-.5*Edge[0]*InvScaleUn,-.5*Edge[1]*InvScaleUn,-.5*Edge[2]*InvScaleUn);
131  if(lu != 0){
132  glPushMatrix();//Ligth
133  glRotatef(xf,1.,0.,0.);
134  glRotatef(yf,0.,1.,0.);
135  glRotatef(zf,0.,0.,1.);
136  glTranslatef(1.,1.,Edge[2]*InvScaleUn);
137  glLightfv(GL_LIGHT0,GL_AMBIENT,luceAmbiente);
138  glLightfv(GL_LIGHT0,GL_DIFFUSE,luceDiffusa);
139  glLightfv(GL_LIGHT0,GL_SPECULAR,luceSpeculare);
140  glLightfv(GL_LIGHT0,GL_POSITION,posizioneLight0);
141  glutSolidSphere(0.05,20,20);
142  glPopMatrix();//Light
143  }
144  glPushMatrix();//Cube
145  glTranslatef(.5*Edge[0]*InvScaleUn,.5*Edge[1]*InvScaleUn,.5*Edge[2]*InvScaleUn);
146  glScalef((GLfloat)Edge[0]*InvScaleUn,
147  (GLfloat)Edge[1]*InvScaleUn,
148  (GLfloat)(Edge[2])*InvScaleUn);
149  glColor4f(1.,1.,1.,1.);
150  glutWireCube((GLfloat)1);
151  glPopMatrix();//Cube
152 // glPushMatrix();
153 // glTranslatef(.5,.7,8.);
154 // glDrawPixels(width,height,GL_RGBA,GL_UNSIGNED_BYTE,pixel);
155 // glPopMatrix();
156  if(1==0)
157  {
158  GLfloat Normal[3]={.1,.1,.1};
159  glNormalPointer(GL_FLOAT,sizeof(GLfloat),&Normal[0]); //Pointer to the first color*/
160  int NPoint = 20;
161  GLfloat Deltax = 1./(GLfloat) NPoint;
162  double *Surface = new double [3*NPoint*NPoint];
163  glColor4f(1.0,.0,1.,1.);
164  for(int i=0;i<NPoint;i++){
165  for(int j=0;j<NPoint;j++){
166  Surface[(i*NPoint+j)*3+0] = Deltax*i+drand48()*.01;
167  Surface[(i*NPoint+j)*3+1] = Deltax*j+drand48()*.01;
168  Surface[(i*NPoint+j)*3+2] = drand48()*.05;
169  }
170  }
171  glVertexPointer(3,GL_DOUBLE,3*sizeof(double),Surface);
172  DrTriangles(NPoint);
173  }
174  {
175  //ShowTexture();
176  }
177  glPushMatrix();
178  glTranslatef(.5,.3,.4);
179  glColor4f(.0,.0,1.,1.);
180  glutSolidSphere(.2,Detail,Detail);
181  glPopMatrix();
182  glPushMatrix();
183  glTranslatef(.5,.7,.6);
184  glColor4f(.0,1.0,.0,1.);
185  glutSolidSphere(.2,Detail,Detail);
186  glPopMatrix();
187  glPopMatrix();//Rotation
188  glPopMatrix();//Translation
189  glutSwapBuffers();
190 }
191 void Draw::DrTriangles(int NPoint){
192  vector <GLuint> VecIndices;
193  for(int i=0;i<NPoint-1;i++){
194  for(int j=0;j<NPoint-1;j++){
195  VecIndices.push_back(i*NPoint + j);
196  VecIndices.push_back((i+1)*NPoint + j);
197  VecIndices.push_back((i+1)*NPoint + (j+1));
198  VecIndices.push_back(i*NPoint + j);
199  VecIndices.push_back((i+1)*NPoint + (j+1));
200  VecIndices.push_back((i)*NPoint + (j+1));
201  }
202  }
203  int NIndex = VecIndices.size();
204  GLuint *Indices = new GLuint [NIndex];
205  for(int i=0;i<NIndex;i++)Indices[i] = VecIndices[i];
206  // GLuint *Indices; Indices = &VecIndices[0];
207  VecIndices.clear();
208  glDrawElements(GL_TRIANGLES,NIndex,GL_UNSIGNED_INT,Indices);
209  free(Indices);
210 }
212  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
213  glDrawPixels(ImWidth,ImHeight,GL_RGBA,GL_UNSIGNED_BYTE,pixel);
214  glutSwapBuffers();
215 }
216 
218  glEnable(GL_TEXTURE_2D);
219  printf("Texture %d\n",glIsEnabled(GL_TEXTURE_2D));
220  if(OpenImage("Texture.tif")==0) {/*printf("Ciccia!\n")*/;return 0;}
221  glGenTextures(1,&Texture);
222  glBindTexture(1,Texture);
223  glTexImage2D(GL_TEXTURE_2D, 0, 4, ImWidth, ImHeight , 0, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
224  //glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
225  //glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
226  //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
227  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
228  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
229  //gluBuild2DMipmaps(GL_TEXTURE_2D, 4, infoheader.biWidth, infoheader.biHeight, GL_RGBA, GL_UNSIGNED_BYTE, l_texture);
230  return 1;
231 }
233  glBindTexture(GL_TEXTURE_2D,Texture);
234  glBegin(GL_QUADS);
235  glTexCoord2f(0.,0.);
236  glTexCoord2f(0.,0.);glVertex3f(0.,0.,1.0);
237  glTexCoord2f(1.,0.);glVertex3f(1.,0.,1.0);
238  glTexCoord2f(1.,1.);glVertex3f(1.,1.,1.0);
239  glTexCoord2f(0.,1.);glVertex3f(0.,1.,1.0);
240  glEnd();
241  glRasterPos3f(0.,0.,0.);
242  glDrawPixels(ImWidth,ImHeight,GL_RGBA,GL_UNSIGNED_BYTE,pixel);
243 }
245  glLineWidth(2);
246  glDisable(GL_LIGHTING);
247  Vettore u(.3,.1,.6);
248  Vettore v(.1,.5,.4);
249  Vettore w(u.x[0]-v.x[0],u.x[1]-v.x[1],u.x[2]-v.x[2]);
250  Vettore o(.5,.5,.5);
251  //Vettore o(.0,.0,.0);
252  Vettore n(3);
253  Vettore Norm1(3);
254  Vettore Norm2(3);
255  Vettore PS(3);
256  double Angle = 90.;
257  Quadri qx(u.x,Angle*DEG_RAD);
258  Quadri qy(v.x,Angle*DEG_RAD);
259  Quadri qz(w.x,Angle*DEG_RAD);
260  //glGetDoublev(GL_MODELVIEW_MATRIX,MatrOld);
261  qx.Prod(qy);
262  qx.Prod(qz);
263  Matrice Mx(qx,4);
264  Matrice My(qy,4);
265  Matrice Mz(qz,4);
266  //Mx.Mult(My);
267  //Mx.Mult(Mz);
268  la = 0;
269  IfScript = 0;
270  n.Copy(&v);
271  n.ProjOnAxis(&u);
272  //Mx.Print();
273  //glMatrixMode(GL_MODELVIEW);
274  glMatrixMode(GL_PROJECTION);
275  glDeleteLists(Particles,1);
276  Particles = glGenLists(1);
277  glNewList(Particles,GL_COMPILE);
278  glColor4f( .1,.1,.1,1.);
279  glPushMatrix();//x
280  glBegin(GL_LINES);
281  glVertex3d(0.,0.,0.);
282  glVertex3d(1.,0.,0.);
283  glEnd();
284  glPopMatrix();//Nano
285  glPushMatrix();//y
286  glBegin(GL_LINES);
287  glVertex3d(0.,0.,0.);
288  glVertex3d(0.,1.,0.);
289  glEnd();
290  glPopMatrix();//Nano
291  glPushMatrix();//z
292  glBegin(GL_LINES);
293  glVertex3d(0.,0.,0.);
294  glVertex3d(0.,0.,1.);
295  glEnd();
296  glPopMatrix();//Nano
297  //origin
298  glPushMatrix();//Nano
299  glBegin(GL_LINES);
300  glVertex3d(0.,0.,0.);
301  glVertex3d(o[0],o[1],o[2]);
302  glEnd();
303  glPopMatrix();//Nano
304  glColor4f( 1.,.1,.1,1.);
305  //glMultMatrixd(Mx.data);
306  PutString(o[0]-.05,o[1]-.05,o[2]-.05,"o");
307  //axis
308  glPushMatrix();//Nano
309  glBegin(GL_LINES);
310  glVertex3d(o[0],o[1],o[2]);
311  glVertex3d(o[0]+u[0],o[1]+u[1],o[2]+u[2]);
312  glEnd();
313  glPopMatrix();//Nano
314  PutString(o[0]+u[0],o[1]+u[1],o[2]+u[2],"axis");
315  glPushMatrix();//Nano
316  //v
317  glColor4f( .1,.1,1.,1.);
318  glPushMatrix();//Nano
319  glBegin(GL_LINES);
320  glVertex3d(o[0],o[1],o[2]);
321  glVertex3d(o[0]+v[0],o[1]+v[1],o[2]+v[2]);
322  glEnd();
323  glPopMatrix();//Nano
324  PutString(o[0]+v[0],o[1]+v[1],o[2]+v[2],"v");
325  glPushMatrix();//Nano
326  //n
327  glColor4f( 1.,1.,.1,1.);
328  glPopMatrix();//Nano
329  glBegin(GL_LINES);
330  glVertex3d(o[0]+.1,o[1],o[2]);
331  glVertex3d(o[0]+n[0]+.1,o[1]+n[1],o[2]+n[2]);
332  glEnd();
333  glPopMatrix();//Nano
334  PutString(o[0]+n[0]+.1,o[1]+n[1],o[2]+n[2],"n");
335  //glCallList(Cylinder);
336  n.PerpTo(&v,&u);
337  //glPopMatrix();//Nano
338  glPushMatrix();//Nano
339  //v-n
340  glColor4f( .1,1.,.1,1.);
341  //glPopMatrix();//Nano
342  glBegin(GL_LINES);
343  glVertex3d(o[0]+v[0],o[1]+v[1],o[2]+v[2]);
344  glVertex3d(o[0]+v[0]+n[0],o[1]+v[1]+n[1],o[2]+v[2]+n[2]);
345  glEnd();
346  glPopMatrix();//Nano
347  PutString(o[0]+v[0]+n[0],o[1]+v[1]+n[1],o[2]+v[2]+n[2],"v-n");
348  //v'
349  glColor4f(.5,.5,1.,1.);
350  //glPopMatrix();//Nano
351  glPushMatrix();//Nano
352  glBegin(GL_LINES);
353  glVertex3d(o[0],o[1],o[2]);
354  glVertex3d(o[0]+v[0]+2.*n[0],o[1]+v[1]+2.*n[1],o[2]+v[2]+2.*n[2]);
355  glEnd();
356  glPopMatrix();//Nano
357  PutString(o[0]+v[0]+2.*n[0],o[1]+v[1]+2.*n[1],o[2]+v[2]+2.*n[2],"v'");
358  //normal
359  Norm1.Normal(&v,&u);
360  glColor4f(1.,.1,1.,1.);
361  //glPopMatrix();//Nano
362  glPushMatrix();//Nano
363  glBegin(GL_LINES);
364  glVertex3d(o[0],o[1],o[2]);
365  glVertex3d(o[0]+Norm1[0],o[1]+Norm1[1],o[2]+Norm1[2]);
366  glEnd();
367  glPopMatrix();//Nano
368  PutString(o[0]+Norm1[0],o[1]+Norm1[1],o[2]+Norm1[2],"normal");
369  //normal
370  Norm2.Normal(&u,&Norm1);
371  glColor4f(1.,.1,1.,1.);
372  glPushMatrix();//Nano
373  glBegin(GL_LINES);
374  glVertex3d(o[0],o[1],o[2]);
375  glVertex3d(o[0]+Norm2[0],o[1]+Norm2[1],o[2]+Norm2[2]);
376  glEnd();
377  glPopMatrix();//Nano
378  PutString(o[0]+Norm2[0],o[1]+Norm2[1],o[2]+Norm2[2],"normal");
379  //plane
380  Vettore v1(.3,.6,.8);
381  //Vettore v2(.2,.7,.3);//out
382  Vettore v2(.4,.2,.7);//in
383  Vettore v3(.5,.7,.9);
384  Piano p1(&v1,&v2,&v3);
385  glColor4f(.5,.1,1.,1.);
386  Vettore PSurf = p1.ProjOnSurf(&o);
387  glPushMatrix();//Nano
388  glBegin(GL_LINES);
389  glVertex3d(PSurf[0],PSurf[1],PSurf[2]);
390  glVertex3d(o[0],o[1],o[2]);
391  glEnd();
392  glColor4f(.8,.1,1.,1.);
393  glBegin(GL_POLYGON);
394  glVertex3d(p1.P1[0],p1.P1[1],p1.P1[2]);
395  glVertex3d(p1.P2[0],p1.P2[1],p1.P2[2]);
396  glVertex3d(p1.P3[0],p1.P3[1],p1.P3[2]);
397  glEnd();
398  glPopMatrix();//Nano
399  glPushMatrix();//Nano
400  if(p1.IsOnSurf(&PSurf)){
401  PutString(PSurf[0],PSurf[1],PSurf[2],"in");
402  }
403  else{
404  PutString(PSurf[0],PSurf[1],PSurf[2],"out");
405  }
406  glPopMatrix();//Nano
407  Vettore Vel(.1,.2,.2);
408  //Vettore Vel1 = p1.Reflect(&Vel);
409  glPushMatrix();//Nano
410  glBegin(GL_LINES);
411  glVertex3d(PSurf[0],PSurf[1],PSurf[2]);
412  glVertex3d(PSurf[0]+Vel[0],PSurf[1]+Vel[1],PSurf[2]+Vel[2]);
413  glEnd();
414  glPopMatrix();//Nano
415  glPushMatrix();//Nano
416  PutString(PSurf[0]+Vel[0],PSurf[1]+Vel[1],PSurf[2]+Vel[2],"vel");
417  glPopMatrix();//Nano
418  p1.Impact(&PSurf,&Vel);
419  glPushMatrix();//Nano
420  glBegin(GL_LINES);
421  glVertex3d(PSurf[0],PSurf[1],PSurf[2]);
422  glVertex3d(PSurf[0]+Vel[0],PSurf[1]+Vel[1],PSurf[2]+Vel[2]);
423  glEnd();
424  glPopMatrix();//Nano
425  glPushMatrix();//Nano
426  PutString(PSurf[0]+Vel[0],PSurf[1]+Vel[1],PSurf[2]+Vel[2],"vel'");
427  glPopMatrix();//Nano
428  //
429  glEndList();
430 }
432  glLineWidth(3);
433  glDeleteLists(Particles,1);
434  Particles = glGenLists(1);
435  glNewList(Particles,GL_COMPILE);
436  glColor4f( 1.,.1,.1,1.);
437  glEndList();
438 }
439 void Draw::PutString(double *Pos,char *String){
440  glRasterPos3f((Pos[0]*InvScaleUn),
441  (Pos[1]*InvScaleUn),
442  (Pos[2]*InvScaleUn));
443  for(int l=0; l < strlen(String); l++) {
444  glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, String[l]);
445  //glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,String[l]);
446  }
447  glCallList(Point);
448 }
449 void Draw::PutString(double Posx,double Posy,double Posz,char *String){
450  glRasterPos3f((Posx*InvScaleUn),
451  (Posy*InvScaleUn),
452  (Posz*InvScaleUn));
453  for(int l=0; l < strlen(String); l++) {
454  //glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, String[l]);
455  glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24,String[l]);
456  }
457  glCallList(Point);
458 }
459 #endif// __glut_h__
GLfloat xp
Translation, wheel.
Definition: Draw.h:155
double InvScaleUn
Rescale the three orthogonal directions.
Definition: Draw.h:181
int IfInfo
Removes the info line.
Definition: Draw.h:232
void Copy(Vettore *o)
Copy the vector.
Vettore P1
Points defining the plane.
double Normal(double *v, double *u, double *w, double *n)
Calculate the normal.
void DrTriangles(int NPoint)
Boh.
Definition: DrawScene.cpp:191
Geometrical operations on vectors.
Definition: MatematicaVect.h:9
void DMinimal(void)
A empty scene (only the list)
Definition: DrawScene.cpp:15
void DFigure(void)
Definition of the scene on which the objects will be drawn.
Definition: DrawScene.cpp:35
int ApplyTexture()
Apply the texture to a square.
Definition: DrawScene.cpp:217
GLuint DrLegend
Refers to the list of the legend.
Definition: Draw.h:187
GLfloat Rback
Background color.
Definition: Draw.h:155
double * x
Where the data are stored.
int gr
Puts/removes the grid.
Definition: Draw.h:218
int ImWidth
Width and height of the image.
Definition: Draw.h:153
int IfImage
Boh.
Definition: Draw.h:236
int la
Puts/removes the box edges.
Definition: Draw.h:216
int OpenImage(const char *FileName)
Open a image to be store in pixel.
Definition: DrawFile.cpp:180
double ProjOnAxis(Vettore *a)
Projects along the axis.
GLuint Griglia
Refers to the list of the grid.
Definition: Draw.h:189
Define a plane.
void DrCube()
Line in a cube.
Definition: DrawScene.cpp:431
GLuint ScriptList
Refers to the list of the objects called by the script file.
Definition: Draw.h:202
GLuint Particles
Refers to the list of the total position of the particles which will be generated in another program...
Definition: Draw.h:200
int ShowTexture()
Call the texture in the scene.
Definition: DrawScene.cpp:232
void Draw1(void)
A scene for debugging.
Definition: DrawScene.cpp:122
void Transform()
Transform the system coordinates.
Definition: DrawScene.cpp:244
GLfloat xl0
Position of the light0.
Definition: Draw.h:155
Matrice computes the algebric operations on matrices.
GLfloat xa
Angles.
Definition: Draw.h:155
Quaternion class.
GLfloat xf
Orientation of the light.
Definition: Draw.h:155
int IfScript
Ignores the script file.
Definition: Draw.h:234
int IfBlend
Activate the blending.
Definition: Draw.h:238
int Impact(Vettore *P, Vettore *V)
Reflect velocity.
GLfloat xi
Position of the info string.
Definition: Draw.h:155
double Edge[3]
Box size.
Definition: Draw.h:262
GLuint Texture
Refers to the list of the texture.
Definition: Draw.h:210
void ShowImage()
Displays the data stored in pixel.
Definition: DrawScene.cpp:211
int IsOnSurf(Vettore *P)
If the point is inside the triangle.
char * info
Info line.
Definition: Draw.h:276
void Normal(const Vettore *u, const Vettore *v)
Computes the normal with respect to the Vettore u and v.
void PutString(double *Pos, char *String)
Put a string.
Definition: DrawScene.cpp:439
void Prod(Quadri q)
Product between two quaternions.
int lu
Enables/disables illumination.
Definition: Draw.h:220
GLubyte * pixel
Principal image (always allocated)
Definition: Draw.h:270
Vettore ProjOnSurf(Vettore *Pos)
Project on surface (point)
void PerpTo(Vettore *o)
The vector perpendicolar.