atomes 1.1.15
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
d_poly.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2024 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'd_poly.c'
24*
25* Contains:
26*
27
28 - The functions to prepare the OpenGL rendering of coordination polyhedra
29
30*
31* List of functions:
32
33 int is_atom_cloned (int at);
34
35 gboolean is_inside (vec3_t p, float * mi, float * ma);
36 gboolean is_in_triangle (vec3_t p, vec3_t a, vec3_t b, vec3_t c);
37 gboolean check_it (int i, int j, int k, int l);
38
39 void setup_summit (float * vertices, vec3_t s, vec3_t n);
40 void setup_triangles (float * vertices, vec3_t sa, vec3_t sb, vec3_t sc);
41 void setup_polyhedron (float * vertices, GLfloat ** xyz, int s);
42 void setup_tetra (float * vertices, vec3_t a, vec3_t b, vec3_t c, vec3_t d);
43 void setup_tetrahedron (float * vertices, GLfloat ** xyz);
44 void get_centroid (GLfloat ** xyz, int id);
45 void check_triangles (int s, GLfloat ** xyz);
46 void prepare_poly_gl (float * vertices, atom at, int c);
47 void create_poly_lists ();
48
49 vec3_t get_triangle_normal (vec3_t v1, vec3_t v2, vec3_t v3);
50
51*/
52
53#include "global.h"
54#include "glview.h"
55#include "color_box.h"
56#include "dlp_field.h"
57
58gboolean * do_gl;
61
62extern int nbs, nbl, nba;
63
66
76void setup_summit (float * vertices, vec3_t s, vec3_t n)
77{
79 vertices[val] = s.x;
80 vertices[val+1] = s.y;
81 vertices[val+2] = s.z;
82 vertices[val+3] = n.x;
83 vertices[val+4] = n.y;
84 vertices[val+5] = n.z;
85 vertices[val+6] = pcol.red;
86 vertices[val+7] = pcol.green;
87 vertices[val+8] = pcol.blue;
88 vertices[val+9] = pcol.alpha * poly_alpha;
89 nba ++;
90}
91
102{
103 vec3_t edge_a = v3_sub(v3, v1);
104 vec3_t edge_b = v3_sub(v2, v1);
105 vec3_t normal = v3_norm (v3_cross(edge_a, edge_b));
106 vec3_t plane = v3_add (v1, v3_add(v2, v3));
107 plane = v3_divs (plane, 3.0);
108 float sign = 1.0;
109 if (v3_dot (v3_sub(plane,centroid), normal) < 0)
110 {
111 sign = -1.0;
112 }
113 return v3_muls (normal, sign);
114}
115
126void setup_triangles (float * vertices, vec3_t sa, vec3_t sb, vec3_t sc)
127{
128 vec3_t normal = get_triangle_normal (sa, sb, sc);
129 setup_summit (vertices, sa, normal);
130 setup_summit (vertices, sb, normal);
131 setup_summit (vertices, sc, normal);
132}
133
134/*vec3_t get_summit_normal (vec3_t va, vec3_t vb, vec3_t vc, vec3_t vd)
135{
136 vec3_t ta, tb, tc;
137 ta = get_triangle_normal (va, vb, vc);
138 tb = get_triangle_normal (va, vb, vd);
139 tc = get_triangle_normal (va, vc, vd);
140 return v3_norm(v3_add(ta, v3_add(tb, tc)));
141}*/
142
152void setup_polyhedron (float * vertices, GLfloat ** xyz, int s)
153{
154 int i, j, k, l, n, o, p, q, r;
155 vec3_t a, b, c;
156 float shift[3];
157 poly_alpha = 1.0;
158 for (n=0; n<plot -> extra_cell[0]+1;n++)
159 {
160 for (o=0; o<plot -> extra_cell[1]+1; o++)
161 {
162 for (p=0; p<plot -> extra_cell[2]+1; p++)
163 {
164 shift[0]=n*box_gl -> vect[0][0]+o*box_gl -> vect[1][0]+p*box_gl -> vect[2][0];
165 shift[1]=n*box_gl -> vect[0][1]+o*box_gl -> vect[1][1]+p*box_gl -> vect[2][1];
166 shift[2]=n*box_gl -> vect[0][2]+o*box_gl -> vect[1][2]+p*box_gl -> vect[2][2];
167 for (q=0; q<s; q++)
168 {
169 for (r=0; r<3; r++) xyz[q][r] += shift[r];
170 }
171
172 l = 0;
173 for (i=0; i<s-2; i++)
174 {
175 for (j=i+1; j<s-1; j++)
176 {
177 for (k=j+1; k<s; k++)
178 {
179 if (do_gl[l])
180 {
181 a = vec3 (xyz[i][0], xyz[i][1], xyz[i][2]);
182 b = vec3 (xyz[j][0], xyz[j][1], xyz[j][2]);
183 c = vec3 (xyz[k][0], xyz[k][1], xyz[k][2]);
184 setup_triangles (vertices, a, b ,c);
185 }
186 l ++;
187 }
188 }
189 }
190 poly_alpha = 0.5;
191 for (q=0; q<s; q++)
192 {
193 for (r=0; r<3; r++) xyz[q][r] -= shift[r];
194 }
195 }
196 }
197 }
198}
199
211void setup_tetra (float * vertices, vec3_t a, vec3_t b, vec3_t c, vec3_t d)
212{
213 setup_triangles (vertices, a, b, c);
214 setup_triangles (vertices, b, c, d);
215 setup_triangles (vertices, a, c, d);
216 setup_triangles (vertices, a, b, d);
217}
218
227void setup_tetrahedron (float * vertices, GLfloat ** xyz)
228{
229 int n, o, p, q, r;
230 float shift[3];
231 poly_alpha = 1.0;
232 for (n=0; n<plot -> extra_cell[0]+1;n++)
233 {
234 for (o=0; o<plot -> extra_cell[1]+1; o++)
235 {
236 for (p=0; p<plot -> extra_cell[2]+1; p++)
237 {
238 shift[0]=n*box_gl -> vect[0][0]+o*box_gl -> vect[1][0]+p*box_gl -> vect[2][0];
239 shift[1]=n*box_gl -> vect[0][1]+o*box_gl -> vect[1][1]+p*box_gl -> vect[2][1];
240 shift[2]=n*box_gl -> vect[0][2]+o*box_gl -> vect[1][2]+p*box_gl -> vect[2][2];
241 for (q=0; q<4; q++)
242 {
243 for (r=0; r<3; r++) xyz[q][r] += shift[r];
244 }
245 setup_tetra (vertices, vec3(xyz[0][0], xyz[0][1], xyz[0][2]),
246 vec3(xyz[1][0], xyz[1][1], xyz[1][2]),
247 vec3(xyz[2][0], xyz[2][1], xyz[2][2]),
248 vec3(xyz[3][0], xyz[3][1], xyz[3][2]));
249 poly_alpha = 0.5;
250 for (q=0; q<4; q++)
251 {
252 for (r=0; r<3; r++) xyz[q][r] -= shift[r];
253 }
254 }
255 }
256 }
257}
258
267void get_centroid (GLfloat ** xyz, int id)
268{
269 int i;
270 centroid.x = centroid.y = centroid.z = 0.0;
271 for (i=0; i<id; i++)
272 {
273 centroid.x += xyz[i][0];
274 centroid.y += xyz[i][1];
275 centroid.z += xyz[i][2];
276 }
277 centroid = v3_divs (centroid, id);
278}
279
289gboolean is_inside (vec3_t p, float * mi, float * ma)
290{
291 if (p.x > mi[0] && p.x < ma[0])
292 {
293 if (p.y > mi[1] && p.y < ma[1])
294 {
295 if (p.z > mi[2] && p.z < ma[2])
296 {
297 return TRUE;
298 }
299 }
300 }
301 return FALSE;
302}
303
315{
316 float area = 0.5 * v3_length(v3_cross(v3_sub(a, b), v3_sub(a, c)));
317 float alpha = v3_length(v3_cross(v3_sub(p, b), v3_sub(p, c))) / (2.0*area);
318 float beta = v3_length(v3_cross(v3_sub(p, c), v3_sub(p, a))) / (2.0*area);
319 float gamma = 1 - alpha - beta;
320 if ((alpha >= 0.0 && alpha <= 1.0) && (beta >= 0.0 && beta <= 1.0) && (gamma >= 0.0 && gamma <= 1.0))
321 {
322 return TRUE;
323 }
324 else
325 {
326 return FALSE;
327 }
328}
329
340gboolean check_it (int i, int j, int k, int l)
341{
342 if (l != i && l != j && l != k)
343 {
344 return TRUE;
345 }
346 else
347 {
348 return FALSE;
349 }
350}
351
360void check_triangles (int s, GLfloat ** xyz)
361{
362 int h, i, j, k, l, m, n;
363 float d, r;
364 float vd, v0;
365 vec3_t vi, vj, vk, vl, vm;
366 vec3_t u, v, w;
367 vec3_t p, pt;
368 float min_c[3], min_p[3];
369 float max_c[3], max_p[3];
370
371 i = s*(s-1)*(s-2)/6;
372 do_gl = allocbool (i);
373
374 for (i=0; i<3; i++)
375 {
376 min_c[i] = max_c[i] = xyz[0][i];
377 }
378 for (i=1; i<s; i++)
379 {
380 for (j=0; j<3; j++)
381 {
382 min_c[j] = min (min_c[j], xyz[i][j]);
383 max_c[j] = max (max_c[j], xyz[i][j]);
384 }
385 }
386 // We will build the polygon using triangles
387 // to ensure that we need to draw a particular triangle
388 // we need to check:
389 // 1) that the planes to be selected do not contains (cover) any atom or summit,
390 // ie. that the projection of the atom coordinates onto the plane do not belong
391 // to the triangle defined by the 3 points.
392 // 2) that the planes already selected and described by the 3 points
393 // do not intersect with any other couple of edges inside the entire polygon
394
395 // 1)
396 /*h = -1;
397 for (i=0; i<s-2; i++)
398 {
399 for (j=i+1; j<s-1; j++)
400 {
401 for (k=j+1; k<s; k++)
402 {
403 h ++;
404 do_gl[h] = TRUE;
405 if (j-i > 1 && k-j > 1)
406 {
407
408
409 // check the plane defined by the 3 points i, j and k
410 vi = vec3(xyz[i][0], xyz[i][1], xyz[i][2]);
411 vj = vec3(xyz[j][0], xyz[j][1], xyz[j][2]);
412 vk = vec3(xyz[k][0], xyz[k][1], xyz[k][2]);
413 u = v3_sub (vi, vj);
414 v = v3_sub (vi, vk);
415 p = v3_norm(v3_cross (u, v));
416 for (l=0; l<s; l++)
417 {
418 if (check_it (i, j, k, l))
419 {
420 vl = vec3(xyz[l][0], xyz[l][1], xyz[l][2]);
421 w = v3_sub (vl, vi);
422 pt = v3_sub (vl, v3_muls (p, v3_dot (w, p)));
423 if (is_in_triangle (pt, vi, vj, vk))
424 {
425 do_gl[h] = FALSE;
426 break;
427 }
428 }
429 }
430 }
431 }
432 }
433 }*/
434 // 2)
435 h = -1;
436 for (i=0; i<s-2; i++)
437 {
438 for (j=i+1; j<s-1; j++)
439 {
440 for (k=j+1; k<s; k++)
441 {
442 h ++;
443 do_gl[h] = TRUE;
444 if (do_gl[h])
445 {
446 // check the plane defined by the 3 points i, j and k
447 vi = vec3(xyz[i][0], xyz[i][1], xyz[i][2]);
448 vj = vec3(xyz[j][0], xyz[j][1], xyz[j][2]);
449 vk = vec3(xyz[k][0], xyz[k][1], xyz[k][2]);
450
451 u = v3_sub (vi, vj);
452 v = v3_sub (vi, vk);
453 p = v3_cross (u, v);
454 d = - v3_dot (p, vi);
455
456 // Now lets look for the intersections with all the other couple of edges that are not i, j and k
457 for (l=0; l<s-1; l++)
458 {
459 if (check_it (i, j, k, l))
460 {
461 vl = vec3(xyz[l][0], xyz[l][1], xyz[l][2]);
462 for (m=l+1; m<s; m++)
463 {
464 if (check_it (i, j, k, m))
465 {
466 vm = vec3(xyz[m][0], xyz[m][1], xyz[m][2]);
467 w = v3_sub (vl, vm);
468 vd = - (v3_dot (p, vm) + d);
469 v0 = v3_dot (p, w);
470 r = vd / v0;
471 if (r != 0.0)
472 {
473 // Now we know where the plane (i, j, k) and the ray (l, m) intersect
474 // We do not want to draw the plane (i, j, k) only if
475 // the intersection is located somewhere inside the polygon
476 pt = v3_add (v3_muls(w, r), vm);
477 if (is_inside (pt, min_c, max_c))
478 {
479 for (n=0; n<3; n++)
480 {
481 min_p[n] = min(xyz[l][n], xyz[m][n]);
482 max_p[n] = max(xyz[l][n], xyz[m][n]);
483 }
484 if (is_inside(pt, min_p, max_p))
485 {
486 //g_debug ("DISCARD:: i= %d, summit[%d]= %d, j= %d, summit[%d]= %d, k= %d, summit[%d]= %d",
487 // i, i, summit[i], j, j, summit[j], k, k, summit[k]);
488 //g_debug ("BECAUSE OF:: l= %d, summit[%d]= %d, m= %d, summit[%d]= %d",
489 // l, l, summit[l], m, m, summit[m]);
490 do_gl[h] = FALSE;
491 break;
492 }
493 }
494 }
495 }
496 }
497 if (! do_gl[h]) break;
498 }
499 }
500 }
501 }
502 }
503 }
504}
505
515void prepare_poly_gl (float * vertices, atom at, int c)
516{
517 int j, k, l;
518 gboolean clones;
519 GLfloat ** xyz;
520 distance d;
521 xyz = allocdfloat (at.numv+1, 3);
522 clones = FALSE;
523 for (l=0; l < at.numv; l++)
524 {
525 j = at.vois[l];
526 d = distance_3d (cell_gl, (cell_gl -> npt) ? step : 0, & at, & proj_gl -> atoms[step][j]);
527 xyz[l][0] = at.x - d.x;
528 xyz[l][1] = at.y - d.y;
529 xyz[l][2] = at.z - d.z;
530 if (d.pbc) clones = TRUE;
531 }
532 j = at.numv;
533 if (j > 1)
534 {
535 if (j == 3)
536 {
537 xyz[j][0] = at.x;
538 xyz[j][1] = at.y;
539 xyz[j][2] = at.z;
540 }
541 if (plot -> draw_clones || ! clones || plot -> cloned_poly)
542 {
543 k = at.sp;
544 // Set color
545 if (pcolorm == 0)
546 {
547 pcol = plot -> at_color[k];
548 l = at.coord[c];
549 pcol.alpha = plot -> spcolor[c][k][l].alpha;
550 }
551 else if (pcolorm < 5)
552 {
553 l = at.coord[pcolorm - 1];
554 if (pcolorm > 2)
555 {
556 k = 0;
557 }
558 pcol = plot -> spcolor[pcolorm - 1][k][l];
559 }
560 else if (pcolorm == 5)
561 {
563 if (fmol)
564 {
565 l = proj_gl -> atoms[0][at.id].fid;
566 k = fmol -> mol -> natoms;
567 }
568 else
569 {
570 l = 0;
571 k = 1;
572 }
573 pcol = init_color (l, k);
574 pcol.alpha = 0.5;
575 }
576 else
577 {
578 pcol = wingl -> custom_map -> colors[step][at.id];
579 l = at.coord[1];
580 pcol.alpha = plot -> spcolor[1][k][l].alpha;
581 }
582 /*color[0] = pcol.red;
583 color[1] = pcol.green;
584 color[2] = pcol.blue;
585 color[3] = pcol.alpha;*/
586 switch (j)
587 {
588 case 3:
589 // Tetrahedral unit
590 // Tétraèdre, assemblage de triangles
591 get_centroid (xyz, 4);
592 setup_tetrahedron (vertices, xyz);
593 break;
594 default:
595 get_centroid (xyz, j);
596 check_triangles (j, xyz);
597 setup_polyhedron (vertices, xyz, j);
598 break;
599 }
600 }
601 }
602 g_free (xyz);
603 xyz = NULL;
604}
605
613int is_atom_cloned (int at)
614{
615 int i, j, k;
616 i=0;
617 for (j=0; j<proj_gl -> atoms[step][at].numv; j++)
618 {
619 k = proj_gl -> atoms[step][at].vois[j];
620 if (distance_3d (cell_gl, (cell_gl -> npt) ? step : 0, & proj_gl -> atoms[step][at], & proj_gl -> atoms[step][k]).pbc) i ++;
621 }
622 return i;
623}
624
631{
632 // The order to draw the polyhedra could be based on the alpha channel
633 // from the most transparent to the less transparent
634 // However a better way is to used the neighbor list, if 3 atoms are linked thru bonds
635 // and that all 3 of them are involved in polyhedra then the one at
636 // the center is to be drawn first ... yet to be implemented
637 int h, i, j, k, l, m, n, o, p, q;
638#ifdef DEBUG
639 g_debug ("Poly LIST");
640#endif
642 if (wingl -> init)
643 {
644 h = 0;
645 for (i=0; i<2; i++)
646 {
647 for (j=0; j<coord_gl -> totcoord[i]; j++)
648 {
649 if (plot -> show_poly[i])
650 {
651 if (plot -> show_poly[i][j])
652 {
653 h++;
654 }
655 }
656 }
657 }
658 if (h)
659 {
660 int * npoly[2];
661 int ptot = 0;
662 for (i=0; i<2; i++)
663 {
664 npoly[i] = allocint (coord_gl -> totcoord[i]);
665 for (j=0; j<coord_gl -> totcoord[i]; j++)
666 {
667 for (k=0; k < proj_at; k++)
668 {
669 l = 0;
670 for (m=0; m<proj_gl -> atoms[step][k].sp; m++)
671 {
672 l += coord_gl -> ntg[i][m];
673 }
674 n = l + proj_gl -> atoms[step][k].coord[i];
675 if (n == j && plot -> show_poly[i] && plot -> show_poly[i][n])
676 {
677 m = proj_gl -> atoms[step][k].coord[1];
678 n = proj_gl -> atoms[step][k].sp;
679 o = 0;
680 for (p=0; p<proj_sp; p++)
681 {
682 o += coord_gl -> partial_geo[n][m][p];
683 }
684 p = (plot -> draw_clones) ? 1 + is_atom_cloned (k) : 1;
685 // q is the number of summit of the polyhedra
686 // +1 if only a coord 3 to include the central atom
687 q = (o == 3) ? o+1: o;
688 // Then we need the max number of triangle for this polyedron
689 npoly[i][j] += p*(q*(q-1)*(q-2)/6);
690 }
691 }
692 ptot += npoly[i][j]*3;
693 }
694 }
695 if (ptot > 0)
696 {
697 wingl -> ogl_glsl[POLYS][step] = g_malloc0 (sizeof*wingl -> ogl_glsl[POLYS][step]);
698 wingl -> n_shaders[POLYS][step] = 1;
699 object_3d * poly = g_malloc0 (sizeof*poly);
700 poly -> vert_buffer_size = POLY_BUFF_SIZE;
701 poly -> num_vertices = ptot * (plot -> extra_cell[0]+1)*(plot -> extra_cell[1]+1)*(plot -> extra_cell[2]+1);
702 poly -> vertices = allocfloat (poly -> vert_buffer_size*poly -> num_vertices);
703 nba = 0;
704 for (i=0; i<2; i++)
705 {
706 for (j=0; j<coord_gl -> totcoord[i]; j++)
707 {
708 if (npoly[i][j] > 0)
709 {
710 for (m=0; m < proj_at; m++)
711 {
712 n = 0;
713 for (o=0; o<proj_gl -> atoms[step][m].sp; o++)
714 {
715 n += coord_gl -> ntg[i][o];
716 }
717 o = n + proj_gl -> atoms[step][m].coord[i];
718 if (o == j && plot -> show_poly[i] && plot -> show_poly[i][o] && proj_gl -> atoms[step][m].numv > 1)
719 {
720 prepare_poly_gl (poly -> vertices, proj_gl -> atoms[step][m], i);
721 }
722 }
723 }
724 }
725 g_free (npoly[i]);
726 }
727 wingl -> ogl_glsl[POLYS][step][0] = init_shader_program (POLYS, GLSL_POLYEDRA, full_vertex, NULL, full_color, GL_TRIANGLES, 3, 1, TRUE, poly);
728 g_free (poly);
729 }
730 }
731 }
732 wingl -> create_shaders[POLYS] = FALSE;
733}
insertion_menu mol[]
Definition w_library.c:193
Structure definitions for color management Function declarations for color management.
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
int * shift
Definition d_measures.c:72
int nba
Definition d_poly.c:62
void setup_summit(float *vertices, vec3_t s, vec3_t n)
prepare the polygon summit to render
Definition d_poly.c:76
void check_triangles(int s, GLfloat **xyz)
check triangle intersection
Definition d_poly.c:360
gboolean check_it(int i, int j, int k, int l)
test this atom id ?
Definition d_poly.c:340
void get_centroid(GLfloat **xyz, int id)
find the barycenter of a polyhedron
Definition d_poly.c:267
gboolean * do_gl
Definition d_poly.c:58
ColRGBA pcol
Definition d_poly.c:60
float poly_alpha
Definition d_poly.c:65
vec3_t centroid
Definition d_poly.c:59
gboolean is_inside(vec3_t p, float *mi, float *ma)
is this point inside the polyhedron ?
Definition d_poly.c:289
void setup_tetra(float *vertices, vec3_t a, vec3_t b, vec3_t c, vec3_t d)
fill the OpenGL data buffer for a tetrahedra to render
Definition d_poly.c:211
void prepare_poly_gl(float *vertices, atom at, int c)
prepare the OpenGL rendering of a polyhedron
Definition d_poly.c:515
int nbs
Definition d_atoms.c:176
float the_sign
Definition d_poly.c:64
void create_poly_lists()
prepare coordination polyhedra(s) OpenGL rendering
Definition d_poly.c:630
vec3_t get_triangle_normal(vec3_t v1, vec3_t v2, vec3_t v3)
compute triangle normal vector
Definition d_poly.c:101
int is_atom_cloned(int at)
does this atom have clone(s) ?
Definition d_poly.c:613
int nbl
Definition d_poly.c:62
gboolean is_in_triangle(vec3_t p, vec3_t a, vec3_t b, vec3_t c)
is this point inside a triangle ?
Definition d_poly.c:314
void setup_tetrahedron(float *vertices, GLfloat **xyz)
fill the OpenGL data buffer for a tetrahedra to render
Definition d_poly.c:227
void setup_triangles(float *vertices, vec3_t sa, vec3_t sb, vec3_t sc)
setup triangle veertices
Definition d_poly.c:126
void setup_polyhedron(float *vertices, GLfloat **xyz, int s)
fill the OpenGL data buffer for a polyhedron to render
Definition d_poly.c:152
int atoms[NUM_STYLES][2]
field_molecule * get_active_field_molecule_from_model_id(project *this_proj, int aid)
retrieve field molecule from overall atom id in the model
Definition dlp_active.c:59
float val
Definition dlp_init.c:117
Variable declarations for the creation of the DL_POLY input file(s)
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
Definition ogl_utils.c:81
float ** allocdfloat(int xal, int yal)
allocate a float ** pointer
Definition global.c:414
gboolean * allocbool(int val)
allocate a gboolean * pointer
Definition global.c:254
int * allocint(int val)
allocate an int * pointer
Definition global.c:314
float * allocfloat(int val)
allocate a float * pointer
Definition global.c:398
Global variable declarations Global convenience function declarations Global data structure defin...
#define min(a, b)
Definition global.h:81
#define max(a, b)
Definition global.h:80
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
image * plot
Definition ogl_draw.c:66
project * proj_gl
Definition ogl_draw.c:60
glwin * wingl
Definition ogl_draw.c:59
int proj_sp
Definition ogl_draw.c:61
box_info * box_gl
Definition ogl_draw.c:64
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
int step
Definition ogl_draw.c:70
int pcolorm
Definition ogl_draw.c:69
coord_info * coord_gl
Definition ogl_draw.c:63
glsl_program * init_shader_program(int object, int object_id, const GLchar *vertex, const GLchar *geometry, const GLchar *fragment, GLenum type_of_vertices, int narray, int nunif, gboolean lightning, object_3d *obj)
create an OpenGL shader program
int proj_at
Definition ogl_draw.c:62
cell_info * cell_gl
Definition ogl_draw.c:65
@ POLYS
Definition glwin.h:92
G_MODULE_EXPORT void cloned_poly(GtkWidget *widg, gpointer data)
cloned polyehdra callback - GTK3
Definition m_poly.c:181
const GLchar * full_color
const GLchar * full_vertex
#define POLY_BUFF_SIZE
Definition ogl_shading.h:48
@ GLSL_POLYEDRA
Definition ogl_shading.h:43
float blue
Definition global.h:124
float alpha
Definition global.h:125
float red
Definition global.h:122
float green
Definition global.h:123
Definition global.h:886
int sp
Definition global.h:888
int numv
Definition global.h:893
int coord[5]
Definition global.h:900
int id
Definition global.h:887
int * vois
Definition global.h:894
double z
Definition global.h:892
double y
Definition global.h:891
double x
Definition global.h:890
coord_info * coord
Definition global.h:956
float y
Definition math_3d.h:130
float x
Definition math_3d.h:130
float z
Definition math_3d.h:130
int b
Definition tab-1.c:95
int c
Definition tab-1.c:95
int d
Definition tab-1.c:95
int a
Definition tab-1.c:95