marching

marching

Synopsis

                    XYZ;
                    TRIANGLE;
                    GRIDCELL;
int                 march_one_cube                      (GRIDCELL grid,
                                                         double isolevel,
                                                         TRIANGLE *triangles);
void                do_function_normal                  (double x,
                                                         double y,
                                                         double z,
                                                         double (compute_fndouble x, double y, double z,void *closure) (),
                                                         void *c);
XYZ                 calc_normal                         (XYZ p,
                                                         XYZ p1,
                                                         XYZ p2);
void                do_normal                           (float x1,
                                                         float y1,
                                                         float z1,
                                                         float x2,
                                                         float y2,
                                                         float z2,
                                                         float x3,
                                                         float y3,
                                                         float z3);
void                marching_cubes                      (int grid_size,
                                                         double isolevel,
                                                         int wireframe_p,
                                                         int smooth_p,
                                                         void* (init_fndouble grid_size, void *closure1) (),
                                                         double (compute_fndouble x, double y, double z,void *closure2) (),
                                                         void (free_fnvoid *closure2) (),
                                                         void *closure1,
                                                         unsigned long *polygon_count);

Description

Details

XYZ

typedef struct {
	double x;
	double y;
	double z;
} XYZ;


TRIANGLE

typedef struct {
   XYZ p[3];
} TRIANGLE;


GRIDCELL

typedef struct {
   XYZ p[8];
   double val[8];
} GRIDCELL;


march_one_cube ()

int                 march_one_cube                      (GRIDCELL grid,
                                                         double isolevel,
                                                         TRIANGLE *triangles);

grid :

isolevel :

triangles :

Returns :


do_function_normal ()

void                do_function_normal                  (double x,
                                                         double y,
                                                         double z,
                                                         double (compute_fndouble x, double y, double z,void *closure) (),
                                                         void *c);

x :

y :

z :

compute_fn :

c :


calc_normal ()

XYZ                 calc_normal                         (XYZ p,
                                                         XYZ p1,
                                                         XYZ p2);

p :

p1 :

p2 :

Returns :


do_normal ()

void                do_normal                           (float x1,
                                                         float y1,
                                                         float z1,
                                                         float x2,
                                                         float y2,
                                                         float z2,
                                                         float x3,
                                                         float y3,
                                                         float z3);

x1 :

y1 :

z1 :

x2 :

y2 :

z2 :

x3 :

y3 :

z3 :


marching_cubes ()

void                marching_cubes                      (int grid_size,
                                                         double isolevel,
                                                         int wireframe_p,
                                                         int smooth_p,
                                                         void* (init_fndouble grid_size, void *closure1) (),
                                                         double (compute_fndouble x, double y, double z,void *closure2) (),
                                                         void (free_fnvoid *closure2) (),
                                                         void *closure1,
                                                         unsigned long *polygon_count);

grid_size :

isolevel :

wireframe_p :

smooth_p :

init_fn :

compute_fn :

free_fn :

closure1 :

polygon_count :