Cyclic Coordonate descent Inverse Kynematic (CCD IK)

[Maya C++ API] paint weights with MPxDeformer

Polar decomposition of a 3x3 matrix

Leaving [  C++ code ] to decompose a 3x3 matrix into rotation and scale/shear with polar decomposition.

[Maya C++ API] Get selected vertices of a mesh

[Maya C++ API] Set skinning weight attributes

Some C++ Maya API code to set skin weights (multi attributes) of a skin cluster node.

Bulge free Dual Quaternion Skinning (Trick)

Left: standard DQS. Right DQS bulge correction (both use same automatic skin weight: "smooth bind" inside Maya).

Laplacian smoothing (C++ code to smooth a mesh)

Dropping a procedure to compute the Laplacian smoothing of a 3D mesh (with cotangent weights).

C++ code for cotangent weights over a triangular mesh

$$w_{ij} = \cot(\alpha_{ij}) + \cot(\beta_{ij})$$

Voro++.0.4.5 with cmake for easy compilation under windows

Dropping my code of the [ cmake version of voro++0.4.5 ]. It helped me to compile the voro++ library under windows with cmake.

Singular value decomposition of a 2x2 matrix (C++ code)

Dropping some [ code here] to do a singular value decomposition (SVD) of a 2 by 2 real matrix.

Source code for poisson disk sampling of a triangle mesh

2d poisson disk

Here you can download the C++ code] to do a Poisson disk sampling of a triangular mesh. The code is a simple wrapper for the vcglib library. It takes in input a std::vector of triangles and vertex position/normals and outputs std::vector of samples positions/normals computed with the Poisson disk sampling.

EDIT: Victor Martins pointed out that the above code doesn't compile on MAC and kindly provided an [  update] bundled with a newer version of vcglib.

N.B: if you are looking for a way to do Poisson disk sampling fast/in real-time take a look at this siggraph paper and matlab code. There is also a C++ implementation here.

3D viewer for Hermite Radial Basis Function

This is a simple demonstrator of the HRBF technique presented and explained here. You can visualize and edit the implicit surface generated with HRBF.

C++ code for spline curves

2d spline

Dropping on github C++ code to compute spline curves of arbitrary dimensions 3D curves or 2D splines anything is possible. The class can be instantiated with any point type (1d (float), 2d, 3d etc.) as long as the appropriate operator overload are implemented. This class use the efficient blossom algorithm to compute a position on the curve.

Trackball C++ code without quaternions

I'm leaving some code to handle a simple trackball interface to move 3D objects around. Trackballs give an intuitive rotation given an input mouse motion: given a clicked point and a second point moving on the screen we compute a rotation (that you apply to some 3D object in the scene) that gives the user the impression of dragging a 3D ball where we first clicked on it.

The code actually wasn't done by me, but I can't remember where I took it! Originally it was C code which I've wrapped up in a C++ class with way more comments and an example of how to use it. [  C++ trackball code ].

C++ code to emulate openGL old direct mode drawing

glVertex3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.0f, 1.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 1.0f);

 [  compact version ] | [  modular version ]

Remember the old days when you were able to simply draw a few primitives with GL_POINTS, GL_LINES or GL_QUADS within a pair of good old begin() end(). Well I'm providing a C++ class which will enable you to do this again under OpenGL 3.1 or higher.

C code for 4x4 matrix inversion

Just leaving some code here to invert either column or row major 4x4 matrices.

  • 1