Created
April 19, 2020 09:06
-
-
Save jhorikawa/cfb38fd66fc7f23e2962269bdb5d21ac to your computer and use it in GitHub Desktop.
Houdini VEX script to wrap sphere with curve.
This file contains 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
int res = chi("res"); | |
float rad = chf("rad"); | |
int poly = addprim(0, "polyline"); | |
for(int i=0; i<res; i++){ | |
float ang = $PI * 2 * chf("angmult") * i / (res - 1.0); | |
float rang = $PI * i / (res - 1.0); | |
float r = sin(rang) * rad; | |
float h = cos(rang) * rad; | |
float x = cos(ang) * r; | |
float z = sin(ang) * r; | |
int pt = addpoint(0, set(x, h, z)); | |
addvertex(0, poly, pt); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment