5    for(
int v=0; v<cell_nb_vertices; ++v) {
 
    6        if(
dot(vertex_clip_space_in(v),GLUP.clip_clip_plane) > 0.0) {
 
    7            result = result | (1 << v);
 
   13void emit_isect_vertex(in 
int i, in vec4 mesh_tex_coord) {
 
   14#ifndef GLUP_NO_GL_CLIPPING 
   15    gl_ClipDistance[0] = 1.0;
 
   17    gl_Position = isect_point_clip_space[i];
 
   18    if(glupIsEnabled(GLUP_VERTEX_COLORS)) {
 
   19        VertexOut.color = isect_color[i];
 
   21    if(glupIsEnabled(GLUP_TEXTURING)) {
 
   22        VertexOut.tex_coord = isect_tex_coord[i];
 
   24    if(glupIsEnabled(GLUP_DRAW_MESH)) {
 
   25        VertexOut.mesh_tex_coord = mesh_tex_coord;
 
   27    if(glupIsEnabled(GLUP_LIGHTING)) {
 
   28        VertexOut.vertex_clip_space = gl_Position;
 
   34    in 
int i, in vec4 mtexi,
 
   35    in 
int j, in vec4 mtexj,
 
   36    in 
int k, in vec4 mtexk
 
   38    emit_isect_vertex(i,mtexi);
 
   39    emit_isect_vertex(j,mtexj);
 
   40    emit_isect_vertex(k,mtexk);
 
   43void draw_marching_cell() {
 
   44    int config = compute_config();
 
   47    if(config_size(config) == 0) {
 
   51    compute_intersections();
 
   52    int size = config_size(config);
 
   58    if(GLUP.draw_mesh_enabled) {
 
   62                config_edge(config,0), 
vec4(1.0, 0.0, 0.0, 0.0),
 
   63                config_edge(config,1), 
vec4(0.0, 1.0, 0.0, 0.0),
 
   64                config_edge(config,2), 
vec4(0.0, 0.0, 1.0, 0.0)
 
   70                config_edge(config,0), 
vec4(0.0, 1.0, 0.0, 1.0),
 
   71                config_edge(config,1), 
vec4(1.0, 0.0, 0.0, 1.0),
 
   72                config_edge(config,2), 
vec4(1.0, 0.0, 1.0, 0.0)
 
   76            for(
int i=2; i+2<size; ++i) {
 
   78                    config_edge(config,0), 
vec4(0.5, 0.5, 0.5, 0.5),
 
   79                    config_edge(config,i), 
vec4(0.0, 1.0, 0.0, 1.0),
 
   80                    config_edge(config,i+1), 
vec4(1.0, 0.0, 0.0, 1.0)
 
   86                config_edge(config,0),      
vec4(0.0, 1.0, 0.0, 1.0),
 
   87                config_edge(config,size-2), 
vec4(1.0, 0.0, 1.0, 0.0),
 
   88                config_edge(config,size-1), 
vec4(1.0, 0.0, 0.0, 1.0)
 
   92        for(
int i=1; i+1<size; ++i) {
 
   94                config_edge(config,0),   
vec4(0.0, 0.0, 0.0, 0.0),
 
   95                config_edge(config,i),   
vec4(0.0, 0.0, 0.0, 0.0),
 
   96                config_edge(config,i+1), 
vec4(0.0, 0.0, 0.0, 0.0)
 
  102bool compute_clip_coords() {
 
  104        glupIsEnabled(GLUP_CLIPPING) &&
 
  105        GLUP.clipping_mode==GLUP_CLIP_STANDARD
 
  109bool draw_clipped_cell() {
 
  110    if(cell_is_clipped()) {
 
  113    gl_PrimitiveID = gl_PrimitiveIDIn;
 
  116        glupIsEnabled(GLUP_CLIPPING) &&
 
  117        GLUP.clipping_mode == GLUP_CLIP_SLICE_CELLS
 
  119        draw_marching_cell();
 
T dot(const vecng< 3, T > &v1, const vecng< 3, T > &v2)
Computes the dot product of 2 vectors.   vecng
vecng< 4, Numeric::float64 > vec4
Represents points and vectors in 4d.