gram-schmitdt正交化

  void gramSchmidtOrthogonalize( nv::vec3f& t, const nv::vec3f& b, const nv::vec3f& n )
{
    // Gram-Schmidt orthogonalize
    t = nv::normalize(t - n * nv::dot(n, t));

    // Calculate handedness
    if ( nv::dot(nv::cross(n, t), b) < 0.0f )
        t = t * -1.0f;
}

posted on 2012-07-06 16:04  zengqh  阅读(381)  评论(0编辑  收藏  举报