Пример #1
0
void GraphicsPainter::drawTriangle(const Point3f &a, const Point3f &b, const Point3f &c)
{
    // verticies
    QVector<Point3f> verticies(3);
    verticies[0] = a;
    verticies[1] = b;
    verticies[2] = c;

    // normals
    Vector3f normal = (b - a).cross(c - b).normalized();
    QVector<Vector3f> normals(3);
    normals.fill(normal);

    // indicies
    QVector<unsigned short> indicies;
    indicies << 0 << 1 << 2;

    // setup buffer
    GraphicsVertexBuffer buffer;
    buffer.setVerticies(verticies);
    buffer.setNormals(normals);
    buffer.setIndicies(indicies);

    // draw buffer
    draw(&buffer);
}
Пример #2
0
/// Returns the number of verticies in the alpha shape.
int AlphaShape::vertexCount() const
{
    return verticies().size();
}