Changeset 1280


Ignore:
Timestamp:
Apr 23, 2012, 2:20:26 PM (8 years ago)
Author:
sam
Message:

orbital: fix a bug in cylinders that made them twice the height.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/mesh.h

    r1279 r1280  
    501501
    502502        mat3 rotmat = mat3::rotate(360.0f / nsides, 0.f, 1.f, 0.f);
    503         vec3 p1(r1, -h, 0.f), p2(r2, h, 0.f), n;
     503        vec3 p1(r1, -h * .5f, 0.f), p2(r2, h * .5f, 0.f), n;
    504504
    505505        /* Construct normal */
    506506        n = p2;
    507         n.y = r1 * (r1 - r2) / (2.f * h);
     507        n.y = r1 * (r1 - r2) / h;
    508508        if (!smooth)
    509509            n = mat3::rotate(180.0f / nsides, 0.f, 1.f, 0.f) * n;
Note: See TracChangeset for help on using the changeset viewer.