11 void RingMesh::InitRing(
float iradius,
26 int numspheres = slices/4;
38 oldmesh = AllocNewMeshesEachInSizeofMeshSpace( numspheres );
42 iradius ), 0 ), oldmesh );
49 vector< MeshDrawContext > *odq = NULL;
50 for (
int l = 0; l < numspheres; l++) {
63 dtheta = (theta_max-theta_min)/(GLfloat) slices;
65 int numQuadstrips = 2;
68 int numvertex = (slices+1)*4;
72 int *QSOffsets =
new int[numQuadstrips];
75 for ( i = imin; i < imax; i++, (fir = 1-fir), (sec = 1-sec) ) {
76 GFXVertex *vertexlist = vl+(i*(slices+1)*2);
77 for (j = 0; j <= slices; j++) {
78 theta = j*dtheta+theta_min;
79 QVector unitpos( R.Scale( -
sin( theta ) )+S.Scale( -
cos( theta ) ) );
81 vertexlist[j*2+fir].
i = up.i;
82 vertexlist[j*2+fir].
k = up.j;
83 vertexlist[j*2+fir].
j = up.k;
84 vertexlist[j*2+fir].
s = wrapx*theta/(2*
M_PI);
85 vertexlist[j*2+fir].
t = 0;
86 vertexlist[j*2+fir].
x = unitpos.i*iradius;
87 vertexlist[j*2+fir].
z = unitpos.j*iradius;
88 vertexlist[j*2+fir].
y = unitpos.k*iradius;
91 vertexlist[j*2+sec].
i = unitpos.i;
92 vertexlist[j*2+sec].
k = unitpos.j;
93 vertexlist[j*2+sec].
j = unitpos.k;
94 vertexlist[j*2+sec].
s = wrapx*theta/(2*
M_PI);
95 vertexlist[j*2+sec].
t = wrapy;
96 vertexlist[j*2+sec].
x = unitpos.i*oradius;
97 vertexlist[j*2+sec].
z = unitpos.j*oradius;
98 vertexlist[j*2+sec].
y = unitpos.k*oradius;
103 QSOffsets[i] = (slices+1)*2;
113 int texlen = strlen( texture );
114 bool found_texture =
false;
116 if (texture[texlen-1] ==
'i' && texture[texlen-2] ==
'n'
117 && texture[texlen-3] ==
'a' && texture[texlen-4] ==
'.') {
118 found_texture =
true;
120 Decal.push_back( NULL );
124 if (!found_texture) {
126 Decal.push_back( NULL );