# Help on visualize large number of Point/Sphere with different colors for each point/sphere

**URL:** https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214
**Category:** Development
**Created:** [December 19, 2019, 2:29pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214 "2019-12-19T14:29:24Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [December 19, 2019, 2:29pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/1 "2019-12-19T14:29:24Z")

</div>

Dear Experts,

I have the requirement to visualize a large number of points/sphere with different color,

Currently, i writing my own plugin and user multiBlockDataSet to store each sphere in polydata format,

so i can change color by blockIndex.

My questions are:  
Do you have better way to do this with higher performance?  
Any suggestions?

Best Regards,  
Sharon

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 19, 2019, 2:32pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/2 "2019-12-19T14:32:33Z")

</div>

3D Glyphs + Coloring by array.

Let me know if you need help set it up.

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [December 19, 2019, 3:53pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/3 "2019-12-19T15:53:53Z")

</div>

Point Gaussian might even be better.

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [December 20, 2019, 12:54pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/4 "2019-12-20T12:54:40Z")

</div>

Thank you Mathieu!

You mean choose 3D Glyphs representation and use scalar vector to set color?  
if not this case, please give me more details.

In my requirement, i also need to visualize the density of the points, i am using vtkPointDensityFilter to calculate density value, but this will generate a vtkImageData, i need a volume representation to visualize the result?  
Any suggestion, if i want to know density of each origin point?

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [December 20, 2019, 12:56pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/5 "2019-12-20T12:56:30Z")

</div>

Thank you Sebastien!

I will have a try, by the way, do you know why Point Gaussian can visualize large number of point in Sphere format, but with very high performance, while my meshed many spheres have very bad performance.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 20, 2019, 12:58pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/6 "2019-12-20T12:58:09Z")

</div>

PointGaussian and 3D Glyphs both use shaders on the GPU to show the points/glyphs.

With a lot a spheres, (almost) everything is done on the CPU.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 20, 2019, 1:02pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/7 "2019-12-20T13:02:16Z")

</div>

Do the following :

- Open your point dataset, Apply
- Use your PointDensity filter, Apply
- (Note : the PointDensity filter is not exposed in ParaView but can be exposed with a simple xml plugin)
- Click on the PointDensity in the pipeline browser
- Filter -\> RessampleWithDataSet
- Destination Mesh -\> Select your point dataset
- Apply

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [December 20, 2019, 1:25pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/8 "2019-12-20T13:25:28Z")

</div>

Thank you Mathieu, that’s explained why its performance amazingly so good!!  
I need to have a study of shaders.

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [December 20, 2019, 1:26pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/9 "2019-12-20T13:26:09Z")

</div>

Thank you Mathieu very much!!

This is very helpful, i will try this!

Best Regards,  
Sharon

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [December 23, 2019, 12:21pm UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/10 "2019-12-23T12:21:33Z")

</div>

Hi Mathieu,

I followed your instruction, generally i got the result, but there are two problems:  
\<1\> the first problem  
I create myPointerDensityFilter which inherited from vtkPointDensityFilter, then write filter proxy in XML file, it works. but when i exposed some properties in the xml, program will crash at class “pqPipelineModel” line 393: it is show the source get from port is NULL

 ![image](https://discourse.paraview.org/uploads/default/original/2X/1/186fe4a99e5ea234930fedfb7390c08b6f2a000b.png)

\<2\> the second one is when i use RessampleWithDataSet, my Destination Mesh is a vtkMultiBlockData, this is supported or not? because when i do this, program become dead, dont know what’s the reason…but i haven’t try if convert it into vtkPolyData. Any ideas?

Best Regards,  
Sharon

---

<div class="post-metadata">

### Author: ![sharon](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@sharon](https://discourse.paraview.org/u/sharon)
#### Post date: [December 26, 2019, 11:59am UTC](https://discourse.paraview.org/t/help-on-visualize-large-number-of-point-sphere-with-different-colors-for-each-point-sphere/3214/11 "2019-12-26T11:59:21Z")

</div>

This two issues are solved.  
First one is because i made a mistake that use “doubleVector” for “int” value, after correct this, there is no crash.  
For second one is also fixed after select right source and target mesh. Source should be density, and target mesh should be origin data point.
