// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include"icosphere.h"
#include <GL/gl.h> #include <map>
usingnamespace Eigen;
//-------------------------------------------------------------------------------- // icosahedron data //-------------------------------------------------------------------------------- #define X .525731112119133606 #define Z .850650808352039932
IcoSphere::IcoSphere(unsignedint levels)
{ // init with an icosahedron for (int i = 0; i < 12; i++)
mVertices.push_back(Map<Vector3f>(vdata[i]));
mIndices.push_back(new std::vector<int>);
std::vector<int>& indices = *mIndices.back(); for (int i = 0; i < 20; i++)
{ for (int k = 0; k < 3; k++)
indices.push_back(tindices[i][k]);
}
mListIds.push_back(0);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.