Guest User

Untitled

a guest
Nov 21st, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. float PI = 3.14159265;
  2. float TWOPI = 6.28318531;
  3. float baseRadius = 1.0;
  4.  
  5. vec3 sphere( float u, float v) {
  6. u *= PI;
  7. v *= TWOPI;
  8. vec3 pSphere;
  9. pSphere.x = baseRadius * cos( v ) * sin( u );
  10. pSphere.y = baseRadius * sin( v ) * sin( u );
  11. pSphere.z = baseRadius * cos( u );
  12. return pSphere;
  13. }
Add Comment
Please, Sign In to add comment