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