3d surface mesh triangulation - opengl

Does anyone know an algorithm to generate a 3d surface mesh given a set of vertices? My project requires that we construct an irregular 3d object in OpenGL and I am having trouble finding out how to do this using triangulation.

You better with a library like cgal. It implements the boywer-watson algorithm but with tetrahedrons. It's a very fast incremental triangulation. Then find the convex hull and remove edges exceeding alpha.

Related

maximal convex patching in Computer graphics

Given a 3D object in Computer graphics, whose surface is represented as a 3D triangular mesh (mesh of 3D triangle objects), I need to find the maximum continual Convex patches on the surface of the given 3D object.
I am using OpenGl to render the graphics within a C++ program. What kind of methods or algorithms should I use to find the convex patches.
I have to apply different colors to the different convex patches on the object to signify the selection.
Say I have a sphere then the whole sphere is one maximal convex patch. Any portion of the sphere surface will be a convex patch, by maximal I mean the maximum continuous convex patch that can be found. Well in the rendering, depending on the viewing angles, the maximal convex patches visible to the viewer will have to colored.
Start from any triangle. Traverse it's edge's and check that the angle between the two triangles is less than 180deg. If it is add it to the current selection and continue expanding.
The check is actually really simple if you use vector geometry. Say A - B is the common edge with C on the selected side and D on the other. Then just check if dot(cross((A-B), (D-B)), cross((A-B), (C-B)) < 0.
Unfortunately OpenGL doesn't help with object algorithms. It only handles converting triangles to pixels.
I need to do it using OpenGL
Then you're out of luck. OpenGL only draws points, lines and triangles. OpenGL is not a 3D modelling library, OpenGL is not a scene graph, OpenGL is not a graphics engine.
It does not do all purpose geometry processing (it may be possible to use a combination of geometry/tesselation shaders, transform feedback and compute shaders to do it, but it would be very cumbersome to implement).

Triangulation 3D algorithm

I have thousands of polygon on 3D space which contains more than 3 vertex. I want partition each polygon into a set of triangles. I have been looking all over the internet and I can not find any algorithm on 3D that does that. I have found many algorithms working on 2D like ear clipping and Delaunay triangulation. But I can not find any algorithm for 3D.
I saw many same questions on this site which answered with "use the Delaunay triangulation algorithm". But I have seen that this algorithm is for 2D:
http://www.geom.uiuc.edu/~samuelp/del_project.html
Implement an algorithm for finding the constrained Delaunay triangulation of a given point set in two dimensions.
What 3D Triangulation algorithm can I use?
I am using OpenGL with C++.
You can use the GLUTesselator:
http://www.glprogramming.com/red/chapter11.html
Also note that a 3D polygon will have many faces which can be translated onto an axis aligned 2D plane, triangulated, and then the results translated back into the plane defined by the face.
You can use a delaunay triangulation but with tetrahedons. Basically use Bowyer Watson with circumspheres:http://blog.mmacklin.com/tag/meshing/.

Math Behind Flash Vector Graphics?

I've been searching for vector graphics and flash for quite some time but I haven't really found what I was looking for. Can anyone tell me exactly what area of mathematics is required for building vector images in 3D space? Is this just vector math? I saw some C++ libraries for it but I wasn't sure if it was the sort of vectors meant to for smaller file size like flash images are. Thanks in advance.
If you're wanting to do something from scratch (there are plenty of open-source libraries out there if you don't), keep in mind that "vector graphics" (this is different than the idea of a 3D space vector) themselves are typically based on parametric curves like Bezier curves, which are essentially 3rd degree polynomials for each x, y, and/or z point parameterized from a value t that goes from 0 to 1. Now projecting the texture-map image you create with those curves (i.e., the so-called "vector graphics" image) onto triangle polygon via uv coordinates would involve some interpolation, which is fairly straight forward linear algebra, as you would utilize the barycentric coordinate of the 3D point on the surface of the triangle polygon in order to calculate the uv point you want to look-up from the texture.
So essentially the steps are:
Create the parametric-curve based image (i.e, the "vector graphic") and make a texture map out of it
That texture map will have uv coordinates
When you rasterize the 3D triangle polygon, you will get a barycentric coordinate on the surface of the triangle from the actual 3D points of the triangle polygon. Those points of the polygon should also have UV coordinates assigned to them.
Use the barycentric coordinates to calculate the uv coordinate on the texture map.
When you get that color from the texture map, then shade the triangle (i.e, calculate lighting, etc. if that's what you're doing, or just save that color of the pixel if there is no lighting).
Please note I haven't gotten into antialiasing, that's a completely different beast. Best thing if you don't know what you're doing there is to simply brute-force antialias through super-sampling (i.e., render a really big image and then average pixels to shrink it back to the desired size).
If you've taken multivariable calculus, the concepts behind parametric curves and surfaces should be familiar, and a basic understanding of linear algebra would be necessary in order to work with barycentric coordinates and linear interpolation from 3D vectors.

Polygon Offset/ Minkowski sum with a sphere algorithm

I am looking for a accurate polygon offset algorithm for 3D polygons, convex and non convex. This can also be achieved with Minkowski sum with a sphere. I know CGAL provide a minkowski package.
However, is there an easy algorithm that I can implement to achieve this task of polygon offse in 3D.
Thanks.
Cheers,
CB
There are easy-ish approaches for offsetting convex polyhedra -- you just move each polygon along its normal, convert edges into cylindrical arcs, and vertices into spherical sectors. For concave geometry, though, this will produce intersecting and degenerate faces. If all you want to do is render then that's okay... but if you intend to do anything interesting with the offset geometry, you really need the big guns provided by things like CGAL.

Alpha shapes from weighted Delaunay Triangulation

I am looking for an algorithm to solve alpha shapes from weighted delaunay triangulation (assuming we have weighted DT) in 2D and 3D. I've looked at a few online links that provide complicated explanations. It'll be great if i can get pseudo code of the algorithm with good explanation.
You can try to use CGAL that provides both 3D and 2D weighted alpha-shapes.
Examples in 3D are available here and here.
The 2D case is similar.
Alpha shapes is alpha value and every edges exceeding alpha. Hence you can remove those edges. I don't think it needs dt. a weighted dt.