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