Changeset 1879 for trunk/src/easymesh
 Timestamp:
 Sep 5, 2012, 3:11:45 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/easymesh/easymesh.cpp
r1875 r1879 512 512 { 513 513 int ibase = m_indices.Count(); 514 515 for (int j = 0; j < ndivisions; j++) 516 for (int i = 0; i < ndivisions; i++) 514 int nidiv = ndivisions; /* Crosssection */ 515 int njdiv = ndivisions; /* Full circumference */ 516 517 for (int j = 0; j < njdiv; j++) 518 for (int i = 0; i < 2 * nidiv; i++) 517 519 { 518 520 for (int di = 0; di < 2; di++) 519 521 for (int dj = 0; dj < 2; dj++) 520 522 { 521 int i2 = (i + di) % n divisions;522 int j2 = (j + dj) % n divisions;523 float x = 0.5f * (r1 + r2) + 0.5 * (r2  r1) * lol::cos(2.0 * M_PI * i2 / n divisions);524 float y = 0.5f * (r2  r1) * lol::sin(2.0 * M_PI * i2 / n divisions);523 int i2 = (i + di) % nidiv; 524 int j2 = (j + dj) % njdiv; 525 float x = 0.5f * (r1 + r2) + 0.5 * (r2  r1) * lol::cos(2.0 * M_PI * i2 / nidiv); 526 float y = 0.5f * (r2  r1) * lol::sin(2.0 * M_PI * i2 / nidiv); 525 527 float z = 0.0f; 526 528 527 float ca = lol::cos(2.0 * M_PI * j2 / n divisions);528 float sa = lol::sin(2.0 * M_PI * j2 / n divisions);529 float ca = lol::cos(2.0 * M_PI * j2 / njdiv); 530 float sa = lol::sin(2.0 * M_PI * j2 / njdiv); 529 531 float x2 = x * ca  z * sa; 530 532 float z2 = z * ca + x * sa;
Note: See TracChangeset
for help on using the changeset viewer.