// // Created by Wouter Groeneveld on 11/07/20. // #include #include void WiredRenderer::render(const MatrixFx &transformationMatrix, const MatrixFx &worldView, const Mesh* mesh) { for (auto &face : mesh->faces()) { auto &vertexA = mesh->vertices()[face->a()]; auto &vertexB = mesh->vertices()[face->b()]; auto &vertexC = mesh->vertices()[face->c()]; auto pixelA = engine->project(vertexA.get()->coords(), transformationMatrix); auto pixelB = engine->project(vertexB.get()->coords(), transformationMatrix); auto pixelC = engine->project(vertexC.get()->coords(), transformationMatrix); engine->plotLine(pixelA, pixelB, mesh->colorIndex()); engine->plotLine(pixelB, pixelC, mesh->colorIndex()); engine->plotLine(pixelC, pixelA, mesh->colorIndex()); } }