In my project, I am utilizing the Three.JS library to showcase a point cloud on a web browser. The point cloud is created once at the beginning and remains static with no additional points being added or removed. However, it does require functionality for rotation, panning, and zooming. I have referred to a tutorial on creating particles in Three.js which has been quite helpful here
Upon experimentating with the example provided, I was able to generate particles in the form of squares or utilize an image of a sphere as a texture. While the image option aligns more closely with my vision, I am curious if it is feasible to produce the point clouds without relying on an image, such as using a sphere geometry.
One issue encountered with using images is that when dealing with a large number of points, they tend to overlap each other around the edges, presumably due to the black region in a point's PNG file blocking the underlying image right behind the current point (though transparent to points farther back).
To address this overlapping concern, I made attempts to swap out particles = new THREE.Geometry()
with
THREE.SphereGeometry(radius, segments, rings)
, aiming to alter the vertices into spheres.
Therefore, my query is how can I tweak the sample code to render spheres (or points) instead of squares? Additionally, I am uncertain whether a particle system remains the most efficient choice for my specific scenario, or would it be better to directly generate the particles and set their individual positions. It's worth noting that the points are generated only once, following which they are subjected to rotation, zooming, and panning (utilizing the TrackBall sample code for mouse event integration).
I appreciate any guidance you can provide.