metasurf

view README @ 11:430d8dde62aa

random changes
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 23 Aug 2015 07:17:56 +0300
parents 1fd80c90d566
children
line source
1 metasurf - a library for implicit surface polygonization
3 http://nuclear.mutantstargoat.com/sw/metasurf
5 1. Overview
6 -----------
8 Metasurf is a library for implict surface polygonization. You only need to
9 set a callback that returns the scalar field value at any given point in
10 3-space, and another callback to accept isosurface vertices. Then at any point
11 just call msurf_polygonize, and the library handles everything else for you.
13 2. Usage
14 --------
15 The following snippet is sufficient to draw the surface of an implicit unit
16 sphere, centered around the origin.
18 struct metasurface *ms;
20 /* initialization */
21 ms = msurf_create();
22 msurf_eval_func(ms, eval);
23 msurf_vertex_func(ms, glVertex3f);
25 /* drawing */
26 glBegin(GL_TRIANGLES);
27 msurf_polygonize(ms);
28 glEnd();
30 /* evaluator */
31 float eval(float x, float y, float z)
32 {
33 return (x * x + y * y + z * z) - 1.0;
34 }
36 See the examples subdirectory for more examples.
38 3. License
39 ----------
40 Copyright: John Tsiombikas <nuclear@member.fsf.org>
42 Metasurf is free software, you may use, modify, and redistribute it freely under
43 the terms of the GNU Lesser General Public License (LGPL) v3 (or at your option,
44 any later version published by the Free Software Foundation). See COPYING and
45 COPYING.LESSER for more details.
48 4. Contributions
49 ----------------
50 If you'd like to fix the marching tetrahedra implementation or have any other
51 ideas for improving this library drop me an email at: nuclear@member.fsf.org.
52 Also feel free to submit patches for bugfixes.