Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void) genVerticesTunnel{
- int i=0;
- int depth = 5;
- int revolutions = 5;
- double delta_x = 360.0 / (double)depth;
- double delta_y = 1.0;
- for (int y=0; y <revolutions; y++){
- for (int x=0; x<depth; x++){
- //position
- VerticesTunnel[i + 0] = (float)sin(GLKMathDegreesToRadians((double)x*delta_x));
- NSLog(@"HALLO");
- NSLog(@"%f",VerticesTunnel[i]);
- VerticesTunnel[i + 1] = (float)cos(GLKMathDegreesToRadians((double)x*delta_x));
- VerticesTunnel[i + 2] = (float)-(y * delta_y);
- //colors RGBA
- VerticesTunnel[i + 3] = 1.0;
- VerticesTunnel[i + 4] = 0.0;
- VerticesTunnel[i + 5] = 0.0;
- VerticesTunnel[i + 6] = 1.0;
- //TexCoord
- VerticesTunnel[i + 7] = (float)x * 1.0f / (float)revolutions;
- VerticesTunnel[i + 8] = (float)y * 1.0f / (float)depth;
- //Normal
- VerticesTunnel[i + 9] = 1.0;
- VerticesTunnel[i + 10] = 1.0;
- VerticesTunnel[i + 11] = 1.0;
- i += 12;
- }
- }
- }
Add Comment
Please, Sign In to add comment