# Point cloud in pythreejs

**URL:** https://discourse.threejs.org/t/point-cloud-in-pythreejs/3238
**Category:** Questions
**Tags:** points
**Created:** [June 27, 2018, 1:14am UTC](https://discourse.threejs.org/t/point-cloud-in-pythreejs/3238 "2018-06-27T01:14:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sbonaretti](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@sbonaretti](https://discourse.threejs.org/u/sbonaretti)
#### Post date: [June 27, 2018, 1:14am UTC](https://discourse.threejs.org/t/point-cloud-in-pythreejs/3238/1 "2018-06-27T01:14:33Z")

</div>

Hi,

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:

```auto
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(
      array=ptsCoord,
      )
geometry = BufferGeometry(
           attributes={'position': pts
                      })

material = PointsMaterial(color='red', 
                          size=1)
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, 
                    scene=scene, 
                    controls=[OrbitControls(controlling=c)])
display(renderer)

```

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](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!  
Serena

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [June 27, 2018, 7:35am UTC](https://discourse.threejs.org/t/point-cloud-in-pythreejs/3238/2 "2018-06-27T07:35:58Z")

</div>

> [@sbonaretti](#):
>
> My points are rendered as squares instead of spheres. Any suggestions on why this happens?

This is the default of WebGL. You can see this at the following [example](https://threejs.org/examples/webgl_points_sprites.html) (just unmark the `texture` flag).

You can use a texture like this [disk](https://threejs.org/examples/textures/sprites/disc.png) to achieve the desired effect. Unfortunately, I can’t help you with your second question.
