webgl-plot icon indicating copy to clipboard operation
webgl-plot copied to clipboard

Shapes rendering order

Open stefano-dallona opened this issue 1 year ago • 2 comments

Hi Danial, first of all congratulations for your awesome library and also for sharing it with the community. I was wondering if it would be possible to add a feature to control the order in which different shape types are rendered. I saw from the code that for example now squares are rendered after lines and there's now way to overcome this behavior due to the _draw... methods being private, which is obviously good from code encapsulation perspective. Would it be possible to add a new config property containing a list of the shapes in the desired rendering order and have the draw method honour it ?

stefano-dallona avatar Aug 27 '24 12:08 stefano-dallona

@stefano-dallona, thanks for bringing up this issue. Okay, I need to think of a way of calling the lower-level functions without affecting the higher-level ones. Which branch are you using?

danchitnis avatar Aug 27 '24 23:08 danchitnis

Hi Danial, I'm using the library version coming from the npm package webgl-plot: 0.7.1 I found a way to mitigate the problem by using transparency with the color alpha channel. Nevertheless I think the mentioned feature could be really useful.

stefano-dallona avatar Sep 04 '24 07:09 stefano-dallona