stevenlovegrove / Pangolin

Pangolin is a lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input.
MIT License
2.3k stars 837 forks source link

pangolin::Plotter change linewidth #934

Open Neoyning opened 1 month ago

Neoyning commented 1 month ago

Hi,

I am using pangolin::Plotter for plotting figures, notice that there are solid line, dashed line, and dotted line for line style. Is there an option for changing the line width of the plot?

Thanks

christian-rauch commented 4 weeks ago

There is no parameter that you can change at runtime. You need to add a glLineWidth() with your desired line width before glDrawArrays here: https://github.com/stevenlovegrove/Pangolin/blob/13e4a1804cefe8ddfd22cdddfac183d5d2828859/components/pango_plot/src/plotter.cpp#L558-L562

E.g. with glLineWidth(i*3); I get: Bildschirmfoto vom 2024-06-10 21-45-33

It would be nice to have a runtime option for this. Interested in sending a PR? :-)