More experiments on Javascript and html5 rendering..
Implementing the Quickhull algorithm. This will find out a fast optimal bounding volume encapsulating all the points.
Steps:
The interactive canvas below (requires google chrome):
Implementing the Quickhull algorithm. This will find out a fast optimal bounding volume encapsulating all the points.
Steps:
- Find the bounding box
- Find the points lying on the box, they form a quad..
- Eliminate the points lying inside the formed boundary
- Find the farthest point away from each edges and form a triangle of that edge with the point.
- Eliminate the points lying inside the triangle and add the two new edges to the hull
- Repeat the steps 3-5 till no points are found outside the hull.
So far, being able to capture points on canvas, was able to compute AABB and the inside quad, need to create a javascript datastructure for storing edges, and inserting edges in between. Remaining tomorrow...
The interactive canvas below (requires google chrome):
No comments:
Post a Comment