Created
September 7, 2017 07:43
-
-
Save rlalance/4fa9bce93f3974c0401f4f545b31983d to your computer and use it in GitHub Desktop.
From https://www.reddit.com/r/blender/comments/1x10ba/help_with_understanding_the_simple_deform_bend/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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