Skip to content

Instantly share code, notes, and snippets.

@andsve
Created October 7, 2008 17:40
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 andsve/15321 to your computer and use it in GitHub Desktop.
Save andsve/15321 to your computer and use it in GitHub Desktop.
float control_points[7*7*3];
for (int i = 0; i < n->numpoints; i++) {
for (int a = 0; a < 7; a+=1) {
float angle = (float)a/7.0f * 2 * PI;
control_points[i*7*7+a*3] = n->p[i+1].x*cos(angle);
control_points[i*7*7+a*3+1] = n->p[i+1].y;
control_points[i*7*7+a*3+2] = n->p[i+1].x*sin(angle));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment