subdiv version wobble much more nicely than a lat/longitude version
| 35 | |
| 36 | //subdiv version wobble much more nicely than a lat/longitude version |
| 37 | static void inithemisphere(int hres, int depth) |
| 38 | { |
| 39 | const int tris = hres << (2*depth); |
| 40 | heminumverts = heminumindices = 0; |
| 41 | DELETEA(hemiverts); |
| 42 | DELETEA(hemiindices); |
| 43 | hemiverts = new vec[tris+1]; |
| 44 | hemiindices = new GLushort[tris*3]; |
| 45 | hemiverts[heminumverts++] = vec(0.0f, 0.0f, 1.0f); //build initial 'hres' sided pyramid |
| 46 | loopi(hres) |
| 47 | { |
| 48 | float a = PI2*float(i)/hres; |
| 49 | hemiverts[heminumverts++] = vec(cosf(a), sinf(a), 0.0f); |
| 50 | } |
| 51 | loopi(hres) genface(depth, 0, i+1, 1+(i+1)%hres); |
| 52 | } |
| 53 | |
| 54 | GLuint createexpmodtex(int size, float minval) |
| 55 | { |
no test coverage detected