Esempio n. 1
0
Patch::Patch( Geometry *g ) :
    start( g->faces.count() ), count( 0 ), initv(
        g->vertices.count() ), sm( Patch::Smooth ), geom(
            g )
{
    qSetColor( faceColor, QColor( Qt::darkGray ) );
}
Esempio n. 2
0
File: cube.cpp Progetto: maxxant/qt
void TileBuilder::initialize(Tile *tile) const
{
    tile->start = start;
    tile->count = count;
    tile->geom = geom;
    qSetColor(tile->faceColor, color);
}
Esempio n. 3
0
File: cube.cpp Progetto: maxxant/qt
Tile::Tile(const QVector3D &loc)
    : location(loc)
    , start(0)
    , count(0)
    , useFlatColor(false)
    , geom(0)
{
    qSetColor(faceColor, QColor(Qt::darkGray));
}
Esempio n. 4
0
QMesh::QMesh(Geometry *g, aiMesh *mesh, aiNode *node)
    : start(g->faces.count())
    , count(0)
    , initv(g->vertices.count())
    , sm(QMesh::Faceted)
    , geom(g)
{
    qSetColor(QColor(231,158,109));
    this->node = node;
    for(unsigned int i = 0 ; i < mesh->mNumFaces;i++)
    {
        const aiFace& face = mesh->mFaces[i];

        QVector3D& vertex0 = QVector3D(mesh->mVertices[face.mIndices[0]].x,
                                         mesh->mVertices[face.mIndices[0]].y,
                                         mesh->mVertices[face.mIndices[0]].z);
        QVector3D& vertex1 = QVector3D(mesh->mVertices[face.mIndices[1]].x,
                                         mesh->mVertices[face.mIndices[1]].y,
                                         mesh->mVertices[face.mIndices[1]].z);
        QVector3D& vertex2 = QVector3D(mesh->mVertices[face.mIndices[2]].x,
                                         mesh->mVertices[face.mIndices[2]].y,
                                         mesh->mVertices[face.mIndices[2]].z);
        QVector3D& normal0 = QVector3D(mesh->mNormals[face.mIndices[0]].x,
                mesh->mNormals[face.mIndices[0]].y,
                mesh->mNormals[face.mIndices[0]].z);

        QVector3D& normal1 = QVector3D(mesh->mNormals[face.mIndices[1]].x,
                mesh->mNormals[face.mIndices[1]].y,
                mesh->mNormals[face.mIndices[1]].z);

        QVector3D& normal2 = QVector3D(mesh->mNormals[face.mIndices[2]].x,
                mesh->mNormals[face.mIndices[2]].y,
                mesh->mNormals[face.mIndices[2]].z);


        this->addTri(vertex0, vertex1, vertex2, normal0, normal1, normal2);
    }
}
Esempio n. 5
0
void QtLogo::setColor(QColor c)
{
    for (int i = 0; i < parts.count(); ++i)
        qSetColor(parts[i]->faceColor, c);
}
void phonemodel::setColor(QColor c)
{
    for (int i = 0; i < parts.count(); ++i)
        qSetColor(parts[i]->faceColor, c);
}