Howdy!
I'm getting tired of beating my head against the wall here and would love some help or at least some advice.
I'd like to generate a world map where you have a set of points on a sphere that you can travel to. So naturally I need a graph based on some kind of reasonable triangulation of these points. In 2D I've used the bowyer-watson algorithm to get the delaunay triangulation. For 3d I figured I'd try to implement some convex hull algorithm.
I found this blog post which gives a decent overview of the quickhull algorithm (
http://thomasdiewald.com/blog/?p=1888). So I'm trying it out.
Along the way I've started implementing a HalfEdgeMesh api in Unreal because I don't know a better way to make a mesh with proper connectivity information. I'm "reasonably" certain my principle mesh setup is working... kinda reasonably certain.
so does anyone have some advice? I can post some code if you like. I'm not sure if I'm going overkill with the halfedge mesh implementation and there isn't just a way to get a decent convex hull without it.
Here are my structs for the halfedge stuff:
using FPointRef = TWeakPtr<FVector>;
using FEdgeRef = TWeakPtr<FEdge>;
using FVertexRef = TWeakPtr<FVertex>;
using FFaceRef = TWeakPtr<FFace>;
using FPointPtr = TSharedPtr<FVector>;
using FVertexPtr = TSharedPtr<FVertex>;
using FEdgePtr = TSharedPtr<FEdge>;
using FFacePtr = TSharedPtr<FFace>;
struct FVertex
{
FPointPtr Position;
FEdgeRef Edge;
explicit FVertex(FPointPtr Position_);
};
struct FFace
{
FEdgeRef Edge;
FVector Normal;
explicit FFace(FEdgePtr);
FVector CalculateNormal();
FEdgeIterator begin();
FEdgeIterator end();
FAdjacentFaceIterator AdjacentFaces();
};
struct FEdge
{
FEdgePtr Next;
FEdgePtr Adjacent;
FVertexPtr Vertex;
FFaceRef Face;
explicit FEdge(FVertexPtr& Vertex_);
bool IsBoundary() const;
};