melowntech / vts-browser-js

JavaScript WebGL 3D map rendering engine
BSD 2-Clause "Simplified" License
218 stars 42 forks source link

API to draw points on top of VTS earth environment #193

Open shrikant-panchal opened 4 years ago

shrikant-panchal commented 4 years ago

The APIs to draw line, circle or image are exposed and available for use. Do we have any API for drawing a point? If No, is there any example available that demonstrates how to draw points?

Any help would be appreciated!

davidmtech commented 4 years ago

There is no API for drawing point. But you can use renderer.drawImage to draw points. Small image is almost as good as point. In case you need to draw many points like point cloud, you can modify rendere.drawMesh function to support points as rendering primitive:

Just add option to this function:

https://github.com/melowntech/vts-browser-js/blob/a0d80a516fe82a8e626f96009b4b27ba250a16d3/src/core/renderer/interface.js#L162

Pass that option into this function:

https://github.com/melowntech/vts-browser-js/blob/a0d80a516fe82a8e626f96009b4b27ba250a16d3/src/core/renderer/gpu/mesh.js#L107

and replace gl.TRIANGLES with gl.POINTS

skazemi commented 3 years ago

The APIs to draw line, circle or image are exposed and available for use. Do we have any API for drawing a point? If No, is there any example available that demonstrates how to draw points?

Any help would be appreciated!

You can do it using renderer.drawLineString() and passing an array with a single point in it.