metasurf

view README @ 1:dc0e882ec3f9

renamed example source file test.c -> metaballs.c
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 25 Oct 2011 07:57:07 +0300
parents
children 9ab057fba0c5
line source
1 metasurf - a library for implicit surface polygonization
3 1. Overview
4 -----------
6 Metasurf is a library for implict surface polygonization. You only need to
7 set a callback that returns the scalar field value at any given point in
8 3-space, and another callback to accept isosurface vertices. Then at any point
9 just call msurf_polygonize, and the library handles everything else for you.
11 2. Usage
12 --------
13 The following snippet is sufficient to draw the surface of an implict sphere.
15 struct metasurface *ms;
17 /* initialization */
18 ms = msurf_create();
19 msurf_eval_func(ms, eval);
20 msurf_vertex_func(ms, glVertex3f);
22 /* drawing */
23 glBegin(GL_TRIANGLES);
24 msurf_polygonize(ms);
25 glEnd();
27 /* evaluator */
28 float eval(float x, float y, float z)
29 {
30 return x * x + y * y + z * z;
31 }
33 See the examples subdirectory for more examples.
35 3. License
36 ----------
37 Copyright: John Tsiombikas <nuclear@member.fsf.org>
39 Metasurf is free software, you may use, modify, and redistribute it freely under
40 the terms of the GNU Lesser General Public License (LGPL) v3 (or at your option,
41 any later version published by the Free Software Foundation). See COPYING and
42 COPYING.LESSER for more details.
45 4. Contributions
46 ----------------
47 If you'd like to fix the marching tetrahedra implementation or have any other
48 ideas for improving this library drop me an email at: nuclear@member.fsf.org.
49 Also feel free to submit patches for bugfixes.