Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float PI = 3.14159265;
- float TWOPI = 6.28318531;
- float baseRadius = 1.0;
- vec3 sphere( float u, float v) {
- u *= PI;
- v *= TWOPI;
- vec3 pSphere;
- pSphere.x = baseRadius * cos( v ) * sin( u );
- pSphere.y = baseRadius * sin( v ) * sin( u );
- pSphere.z = baseRadius * cos( u );
- return pSphere;
- }
Add Comment
Please, Sign In to add comment