Building a Half-Edge Mesh from a Triangle List

The problem is to build a polygonal mesh from a triangle list efficiently. A solution is important specially when building or testing physics engines. The method below shows a possible solution. This can be done without needing the additional storage and processing cost of keeping a list of half-edges for a given face during its addition which would be linked at the end of the addition in that case.

Continue reading

Distance Constraint Derivation

Sometimes it’s desired to have a distance constraint. That constraint assumes a choosen separation distance for two points fixed in two bodies. I’ve written a derivation for it in 3D and shared here. An implementation should be pretty simple since we have minimally one Jacobian and solve a 1D linear system. Here is an example which you can use in your own projects.

Continue reading

Fast Segment-AABB Collision Detection

Let’s say we need to compute the intersection point and normal from a line segment to an axis-aligned bounding box (AABB) bounds, and we neither want to perform expensive plane computations nor keep the AABB boundaries as an intersection of 6 axis-aligned planes (as it is a waste of memory). A quick way to do that is by evaluating the slab plane equation for each axis-aligned plane of the AABB.

Continue reading

MATLAB R2015a Experiences

I look forward to get a MATLAB license after using the R2015a trial for a week. Scalar and vector functions, gradient fields, and level curves are very easy to be evaluated in my experience. Example:

Continue reading

Vectors and Points

I gave a simplistic talk last week at university for a couple of math and engineering students about vectors and points. You can download the slides translated to the English language here.