mesh3D
所属分类:3D图形编程
开发工具:Visual C++
文件大小:8696KB
下载次数:29
上传日期:2010-01-07 22:21:45
上 传 者:
khomsi_abdelaziz
说明: mesh for triangulation in c++
文件列表:
trimesh2\COPYING (15787, 2009-06-24)
trimesh2\Makedefs.Darwin (1282, 2009-04-22)
trimesh2\Makedefs.Linux (1398, 2009-04-24)
trimesh2\Makedefs.Linux64 (165, 2009-04-22)
trimesh2\Makedefs.SunOS (1108, 2007-01-31)
trimesh2\Makedefs.Win32 (1590, 2009-06-24)
trimesh2\Makefile (436, 2006-07-15)
trimesh2\Makerules (1865, 2006-07-15)
trimesh2\bin.Darwin\mesh_align (270128, 2009-06-24)
trimesh2\bin.Darwin\mesh_cat (193820, 2009-06-24)
trimesh2\bin.Darwin\mesh_cc (209828, 2009-06-24)
trimesh2\bin.Darwin\mesh_check (194300, 2009-06-24)
trimesh2\bin.Darwin\mesh_crunch (194220, 2009-06-24)
trimesh2\bin.Darwin\mesh_filter (351028, 2009-06-24)
trimesh2\bin.Darwin\mesh_hf (260544, 2009-06-24)
trimesh2\bin.Darwin\mesh_info (180844, 2009-06-24)
trimesh2\bin.Darwin\mesh_make (265096, 2009-06-24)
trimesh2\bin.Darwin\mesh_shade (269840, 2009-06-24)
trimesh2\bin.Darwin\mesh_view (320184, 2009-06-24)
trimesh2\bin.Darwin\xf (39388, 2009-06-24)
trimesh2\bin.Linux\mesh_align (311072, 2009-06-24)
trimesh2\bin.Linux\mesh_cat (200460, 2009-06-24)
trimesh2\bin.Linux\mesh_cc (214040, 2009-06-24)
trimesh2\bin.Linux\mesh_check (221548, 2009-06-24)
trimesh2\bin.Linux\mesh_crunch (200684, 2009-06-24)
trimesh2\bin.Linux\mesh_filter (348104, 2009-06-24)
trimesh2\bin.Linux\mesh_hf (247064, 2009-06-24)
trimesh2\bin.Linux\mesh_info (185984, 2009-06-24)
trimesh2\bin.Linux\mesh_make (282276, 2009-06-24)
trimesh2\bin.Linux\mesh_shade (271356, 2009-06-24)
trimesh2\bin.Linux\mesh_view (505164, 2009-06-24)
trimesh2\bin.Linux\xf (47256, 2009-06-24)
trimesh2\bin.Linux64\mesh_align (311536, 2009-06-24)
trimesh2\bin.Linux64\mesh_cat (201384, 2009-06-24)
trimesh2\bin.Linux64\mesh_cc (213056, 2009-06-24)
trimesh2\bin.Linux64\mesh_check (200728, 2009-06-24)
trimesh2\bin.Linux64\mesh_crunch (201608, 2009-06-24)
trimesh2\bin.Linux64\mesh_filter (345592, 2009-06-24)
trimesh2\bin.Linux64\mesh_hf (245760, 2009-06-24)
... ...
This is trimesh2, a C++ library and set of utilities for input, output,
and basic manipulation of 3D triangle meshes. The goals of the code are
ease of use and efficiency, possibly at the expense of some generality.
The library includes the following:
- Support for reading PLY, OFF, 3DS, VVD, and Wavefront OBJ files,
together with a few other formats of mostly local interest (SM, RAY).
- Support for writing PLY, OFF, and OBJ files.
- A templated C++ class for constant-length vectors, with support for the
usual arithmetic operations (add, subtract, componentwise multiply and
divide, dot product, cross product, etc.)
- A class for rigid-body transformations.
- An OpenGL trackball/arcball implementation, with automatic selection of
rotation center.
- Algorithms for subdivision, smoothing, curvature estimation, triangle
stripping, and various other simple mesh manipulations.
Bundled together with the library are:
- Bernd Gartner's "miniball" code for efficient exact bounding sphere
computation: http://www.inf.ethz.ch/personal/gaertner/minibal.html
- An ever-so-slightly tweaked version of the freeglut library, an
open source GLUT replacement: http://freeglut.sourceforge.net/
- GLUI, a user interface library that sits on top of OpenGL, hence is
portable to many different systems: http://www.nigels.com/glt/glui/
In addition, the following utility programs are included:
- mesh_view: a simple 3D mesh viewer
- mesh_make: create arbitrarily-tessellated meshes of various simple shapes
- mesh_filter: applies a variety of simple transformations to a mesh,
such as converting formats, flipping faces, subdivision, smoothing,
rigid-body transformations, etc.
- mesh_cc: list and/or extract connected components from a mesh
- mesh_cat: combine several meshes into a single file
- mesh_align: align 2 meshes using ICP
The author of trimesh2 is Szymon Rusinkiewicz, and the library is
distributed under the GNU General Public License (GPL). The various
libraries distributed with trimesh2 are open source, and are believed
to be covered by GPL-compatible licenses. Please see the COPYING file.
Running the utilities:
----------------------
All of the programs must be run from the command line. Each displays
a list of options when run without arguments.
In the mesh_view program, the view is changed by dragging with particular
mouse buttons as follows:
Left: Rotate (release while moving to spin the object)
Middle: Translate left, right, up, down
Left+right: Translate left, right, up, down
Right: Translate forward and back
Mouse wheel: Translate forward and back
Ctrl+Left: Move the light
In addition, the following keys invoke various options:
Space bar: Reset to initial view
e: Toggle display of mesh edges
l: Toggle lighting
q: Exit
s: Toggle specular component in reflection
2: Toggle 2-sided lighting
x: Write current viewpoint as a ".xf" file
Using the library:
------------------
There is no complete documentation for the library - poke around in
include/*.h to see what is available, and look in utilsrc/*.cc to
see how it's used. Here's a trivial program to help you get started:
#include "TriMesh.h"
#include
using namespace std;
int main(int argc, char *argv[])
{
const char *filename = "foo.ply";
TriMesh *m = TriMesh::read(filename);
if (!m)
exit(1);
cout << "There are " << m->vertices.size() << " vertices" << endl;
cout << "Vertex 0 is at " << m->vertices[0] << endl;
// Convert triangle strips to faces, if necessary
m->need_faces();
cout << "Face 0 has vertices " << m->faces[0][0] << ", "
<< m->faces[0][1] << ", and " << m->faces[0][2] << endl;
m->need_normals();
cout << "Vertex 0 has normal " << m->normals[0] << endl;
}
Compiling:
----------
The code is written in C++, and is known to compile using a recent (3.x-4.x)
version of g++. Compiling under Windows is possible using Cygwin or
Mingw32. Other compilers have not been tested - let me know of any
successes or failures.
After unpacking the code, edit the appropriate "Makedefs.*" file to
specify the compiler and any necessary options. If there is no Makedefs
for your OS, run "uname" to determine what it should be named and create
one (probably starting with one of the existing files as a template).
At this point, just running "make" in the top-level directory should make
the library (placed in lib.`uname`) and utilities (placed in bin.`uname`).
If you have any problems, please double check the following:
- You are using a recent version of the compiler
- You are using a recent version of GNU make
- The correct -I option is included to find all the headers you need,
including OpenGL headers
If you still have problems, let me (smr@princeton.edu) know and I'll do
my best to help resolve them.
近期下载者:
相关文件:
收藏者: