Guest User

Untitled

a guest
May 19th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -(void) genVerticesTunnel{
  2.     int i=0;
  3.     int depth = 5;
  4.     int revolutions = 5;
  5.     double delta_x = 360.0 / (double)depth;
  6.     double delta_y = 1.0;
  7.    
  8.     for (int y=0; y <revolutions; y++){
  9.         for (int x=0; x<depth; x++){
  10.            
  11.             //position
  12.             VerticesTunnel[i + 0] = (float)sin(GLKMathDegreesToRadians((double)x*delta_x));
  13.             NSLog(@"HALLO");
  14.             NSLog(@"%f",VerticesTunnel[i]);
  15.             VerticesTunnel[i + 1] = (float)cos(GLKMathDegreesToRadians((double)x*delta_x));    
  16.             VerticesTunnel[i + 2] = (float)-(y * delta_y);
  17.             //colors RGBA
  18.             VerticesTunnel[i + 3] = 1.0;
  19.             VerticesTunnel[i + 4] = 0.0;
  20.             VerticesTunnel[i + 5] = 0.0;
  21.             VerticesTunnel[i + 6] = 1.0;  
  22.             //TexCoord
  23.             VerticesTunnel[i + 7] = (float)x * 1.0f / (float)revolutions;
  24.             VerticesTunnel[i + 8] = (float)y * 1.0f / (float)depth;
  25.             //Normal
  26.             VerticesTunnel[i + 9] = 1.0;
  27.             VerticesTunnel[i + 10] = 1.0;
  28.             VerticesTunnel[i + 11] = 1.0;
  29.            
  30.             i += 12;
  31.         }
  32.     }
  33. }
Add Comment
Please, Sign In to add comment