Viewport scale vs project_pixel_size #8020
Replies: 2 comments 2 replies
-
Some of the point cloud functionality was developed 4 or 5 years ago for streetscape.gl for visualizing LIDAR clouds from self driving cars. At least in that application,, if we didn't adjust the size of points based on distance from viewer, the point clouds became very sparse when moving close to them, substantially changing the visual weight and almost disappearing, which did not work out well, as the clouds represented pedestrians, bicyclists, carts etc. Because of this a focal-distance type concept was added, and point sizes were made bigger if close to the viewer. Assuming things haven't changed, it should still work this way. And of course, this may not have been the right tradeoff for all applications. Unfortunately I don't have the details fresh in my mind and making a change to disable this behavior may or may not be a delicate operation. |
Beta Was this translation helpful? Give feedback.
-
@ricardoekm Apologies for resurrecting a year old thread, but I am interested in your original use case. I am also trying to figure out how to have the viewport scale with the size of the browser window such that content in the viewport appears at the same size relative to the dimensions of the deck.gl canvas as the browser window grows or shrinks. Despite this seeming like an obvious use case, I have not been able to figure out how to do it. It sounds like you've been able to achieve this with your flow charts, could you point me in the right direction? How do I modify the "viewport scale"? |
Beta Was this translation helpful? Give feedback.
-
We're using the viewport scale to tweak the size of our flow chart visualizations. Originally the scale is Math.pow(2, zoom). We're applying a factor depending on the screen size to make sure everyone sees more or less the same thing (i.e. flowcharts created on big screens are still fully visible on smaller screens).
All layers using commons are resized accordingly. Most layers using pixels kept their size in pixels (e.g. icon layer, text layer), except the scatterplot layer. Investigating the issue further if we set billboard true the scatterplot layer works as expected (the size in pixels is preserved).
Shouldn't the scatterplot layer keep its size in pixels regardless of the scale?
It seems something related to the project_pixel_size in the vertex shader:
https://github.com/visgl/deck.gl/blob/master/modules/layers/src/scatterplot-layer/scatterplot-layer-vertex.glsl.ts#L90
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions