Skip to content

Instantly share code, notes, and snippets.

@rlalance
Created September 7, 2017 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlalance/4fa9bce93f3974c0401f4f545b31983d to your computer and use it in GitHub Desktop.
Save rlalance/4fa9bce93f3974c0401f4f545b31983d to your computer and use it in GitHub Desktop.
static void simpleDeform_twist(const float factor, const float *dcut, float *co)
{
float x = co[0], y = co[1], z = co[2];
float theta, sint, cost;
theta = z*factor;
sint = sin(theta);
cost = cos(theta);
co[0] = x*cost - y*sint;
co[1] = x*sint + y*cost;
co[2] = z;
if(dcut)
{
co[0] += dcut[0];
co[1] += dcut[1];
co[2] += dcut[2];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment