6
2012
Noob Triangulator (js)

Testing mesh (triangle) generation.. (screenshot: random mesh plane)
The REAL Triangulator is here: http://wiki.unity3d.com/index.php/Triangulator (it can handle complex shapes etc.)
My javascript triangulator works by adding 1 vertex in the middle, and every triangle will point to it.
I was thinking could use this for drawing outlines with mouse, then create mesh from the outline, noob-triangulate it.
Webplayer:
nothing much to see..
Download source:
FakeTriangulator2.unityPackage
—
Image#2: Two pass mesh with hole testing, using 3d triangulator, then modify mesh again – see comments section for the 3d tri. source (21.09.2014)

Related Posts
15 Comments + Add Comment
Leave a comment
Recent posts
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
- GeoTiff Importer & Terrain Generator for Unity
- Create Baked DropShadow for UI images
- .JP2 Ortho Image Converter to PNG/JPG/TIFF
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
- Detect SRP (URP or HDRP) with Assembly Definition Version Defines
- [LudumDare57] Theme: Depths
- MotionVector Effect: Object “disappears” when paused
Recent Comments
- on [Asset Store] PolygonCollider2D Optimizer
- on Trajectory Test Scene 2.0
- on Vector3 maths for dummies!
- on UnityHub 3.6.0: Remove Version Control & Cloud Dashboard columns
- on Using RenderDoc with Unity (graphics debugger)
- on UI Scroll View automatic Content height
- on [Asset Store] Point Cloud Viewer & Tools
- on [Asset Store] Point Cloud Viewer & Tools
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by












Hi,
I find your idea very interesting and I was thinking of a similar idea, not with only one center point, but many interior points with a random number generator. Have you thought of the problems of a very concav hull?
I still haven’t got any result yet but I really look forward seeing your code (and sharing mine eventually, when it worths it).
Bye.
Yeah, this wont work with complex shapes..
What will you do with the random points? You need more mesh resolution or ..?
^ Source added.
(I think one version was also included with this http://unitycoder.com/blog/2012/02/15/raycast-realtime-visibility-2-0/ )
Well after I day of work I changed my mind. Random points seemed beautiful in mind, but in orther to avoid hard recalculation of the triangles set I decided make a loop over all triangles and adding a vertex in all if their centers. This way I make sure that the new vertex will be in the figure (because a triangle is a simple shape with its center in itself) and the new triangle set is as “easy” as changing every triangle for 3 new triangles, with 2 old points and 1 new point (the new vertex). If you want it, when it’s over I will share the code. I am already having some success 🙂
Yes would be nice to see it!
I was thinking, you could “scale” all the vertices,
to create inner vertices at good positions (half way from middle vertex and outer vertex)
Done. It’s cool how you can increase the number of triangles and eventually making the mesh look like a fractal…
But I don’t know where to post it and I don’t see your email anywhere.
Thanks! email here: http://unitycoder.com/blog/requests/
got it thanks! actually thats like tesselation maker 🙂
Delaunay Triangulator.cs
http://forum.unity3d.com/threads/208125-Delaunay-Triangulation-Problem
fast tessellator + triangulation:
https://github.com/speps/LibTessDotNet
triangulation stuff (with sources/links) :
http://forum.unity3d.com/threads/181596-Triangulation-of-spline-to-mesh-questions-and-results
3D Delaunay Triangulator (see last comment with source download)
http://answers.unity3d.com/questions/307544/mesh-from-vertices-polygon-from-spline.html
interesting triangulation demo (Sweep Line algorithm, with sources)
http://computacion.cs.cinvestav.mx/~anzures/geom/triangulation.php
about clipper & poly2tri:
http://www.gamedev.net/page/resources/_/technical/artificial-intelligence/generating-2d-navmeshes-r3393
Computational Geometry Lecture 16: Polygon triangulation
using poly2tri:
http://luminaryapps.com/blog/triangulating-3d-polygons-in-unity/