Point cloud in pythreejs


I am new to pythreejs. I am trying to render a point cloud with a colormap. I am looking at the few available examples in pythreejs and I am trying to translate from the examples in threejs, but I have two main issues:

  1. My points are rendered as squares instead of spheres. Any suggestions on why this happens? Here is my code:
from pythreejs import *
# --points----------------------
ptsCoord = np.array([[-1.0, -1.0,  0.0],
                     [ 1.0, -1.0,  0.0],
                     [ 1.0,  1.0,  0.0],
                    ], dtype=np.float32)
pts = BufferAttribute(
geometry = BufferGeometry(
           attributes={'position': pts

material = PointsMaterial(color='red', 
pointCloud = Points(
             geometry = geometry, 
             material = material

# --rendering----------------------
c = PerspectiveCamera(
    position=[0, 5, 5], 
    up=[0, 1, 0],
    children=[DirectionalLight(color='white', position=[3, 5, 1], intensity=0.5)])

scene = Scene(
        children=[pointCloud, c, AmbientLight(color='#777777')])

renderer = Renderer(camera=c, 
  1. I am trying to associate a different color to a each point, similarly to what done in this example: https://github.com/mrdoob/three.js/blob/master/examples/webgl_geometry_colors_lookuptable.html (although I want to render a point cloud, not a mesh). How do I instantiate a lut in pythreejs? I get module 'pythreejs.pythreejs' has no attribute 'Lut'. Any suggestions on how to implement this?

Thanks a lot!

This is the default of WebGL. You can see this at the following example (just unmark the texture flag).

You can use a texture like this disk to achieve the desired effect. Unfortunately, I can’t help you with your second question.