Start adding grid

This commit is contained in:
James Grogan 2022-11-17 17:33:48 +00:00
parent 9301769d58
commit f04d86e0ad
37 changed files with 709 additions and 211 deletions

View file

@ -87,6 +87,7 @@ void OpenGlMeshPainter::paint(SceneModel* model, DrawingContext* context)
const auto height = float(surface->getHeight());
auto mesh = dynamic_cast<TriMesh*>(model->getMesh());
std::cout << "Paint mesh for model " << model->getName() << std::endl;
auto transform = model->getTransform();
@ -97,6 +98,7 @@ void OpenGlMeshPainter::paint(SceneModel* model, DrawingContext* context)
{
auto x = vertices[idx]*transform.getScaleX() + transform.getLocation().getX();
vertices[idx] = 2*x/width - 1.0;
std::cout << "Vert x is " << vertices[idx] << std::endl;
}
else if(idx%3 == 1)
{
@ -108,6 +110,7 @@ void OpenGlMeshPainter::paint(SceneModel* model, DrawingContext* context)
const auto indices = mesh->getFaceNodeIds();
auto model_color = model->getColor().getAsVectorDouble();
std::cout << "Color is " << model_color[0] << "|" << model_color[0] << std::endl;
std::vector<float> color = {float(model_color[0]), float(model_color[1]), float(model_color[2]), float(model_color[3])};
paint(vertices, indices, color);