Commit 58c42b9d authored by Philip Trettner's avatar Philip Trettner

made types explicit

parent 2925f2a5
Pipeline #11540 passed with stage
in 24 minutes and 45 seconds
......@@ -30,21 +30,21 @@ int main()
// Load a polymesh mesh
pm::Mesh m;
auto pos = m.vertices().make_attribute<glm::vec3>();
auto pos = m.vertices().make_attribute<tg::pos3>();
load(dataPath + "suzanne.obj", m, pos);
normalize(pos); // make it -1..1
// prepare some data
auto uv = pos.map([](glm::vec3 v) { return glm::vec2(v.x, v.y); });
auto vdata = pos.map([](glm::vec3 v) { return v.y; });
auto vnormals = vertex_normals_by_area(m, pos);
auto fdata = m.faces().map([&](pm::face_handle f) { return f.vertices().avg(pos).z; });
auto tex = glow::Texture2D::createFromFile(dataPath + "textures/tiles.color.png", glow::ColorSpace::sRGB);
auto atex = glow::AsyncTextureLoader::load2D(dataPath + "textures/tiles.color.png", glow::ColorSpace::sRGB);
auto fcolors = m.faces().map([&](pm::face_handle) { return glow::colors::color(dis(rng), dis(rng), dis(rng)); });
auto vcolors = attribute(m.vertices(), glow::colors::color(1, 0, 0));
auto edge_lengths = m.edges().map([&](pm::edge_handle e) { return edge_length(e, pos); });
auto ptsize = m.vertices().map([&](pm::vertex_handle v) { return v.edges().avg(edge_lengths); });
pm::vertex_attribute<glm::vec2> uv = pos.map([](tg::pos3 v) { return glm::vec2(v.x, v.y); });
pm::vertex_attribute<float> vdata = pos.map([](tg::pos3 v) { return v.y; });
pm::vertex_attribute<tg::vec3> vnormals = vertex_normals_by_area(m, pos);
pm::face_attribute<float> fdata = m.faces().map([&](pm::face_handle f) { return f.vertices().avg(pos).z; });
glow::SharedTexture2D tex = glow::Texture2D::createFromFile(dataPath + "textures/tiles.color.png", glow::ColorSpace::sRGB);
glow::AsyncTexture2D atex = glow::AsyncTextureLoader::load2D(dataPath + "textures/tiles.color.png", glow::ColorSpace::sRGB);
pm::face_attribute<glow::colors::color> fcolors = m.faces().map([&](pm::face_handle) { return glow::colors::color(dis(rng), dis(rng), dis(rng)); });
pm::vertex_attribute<glow::colors::color> vcolors = attribute(m.vertices(), glow::colors::color(1, 0, 0));
pm::edge_attribute<float> edge_lengths = m.edges().map([&](pm::edge_handle e) { return edge_length(e, pos); });
pm::vertex_attribute<float> ptsize = m.vertices().map([&](pm::vertex_handle v) { return v.edges().avg(edge_lengths); });
// Simplest view
glow::viewer::view(pos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment