Closed KenKenhehe closed 1 year ago
Below is an example:
// Create a LinesDrawable to visualize your line
auto drawable = new LinesDrawable("line");
// The two vertices of a line
const std::vector<vec3> vertices = { a, b }; // assume the two endpoints of the line are: a and b
// Upload the vertices of the line to GPU.
drawable->update_vertex_buffer(vertices);
// Set color (here we want a blue color)
drawable->set_uniform_coloring(vec4(0.0f, 0.0f, 1.0f, 1.0f)); // r, g, b, a
// Set the width of the line (here 5 pixels)
drawable->set_line_width(5.0f);
// Add the drawable to the viewer
viewer.add_drawable(drawable);
More examples are in the tutorials, e.g., Tutorial_301_Drawables.
Thank you! This is really helpful
I am trying to use orientedline for checking if it intersect with a face, and I want to visualize this line, is there a quick way? Or do I need to implement that from scratch?