# displaying 3D volume in RED

**URL:** https://discourse.vtk.org/t/displaying-3d-volume-in-red/804
**Category:** Support
**Created:** [April 20, 2019, 4:40pm UTC](https://discourse.vtk.org/t/displaying-3d-volume-in-red/804 "2019-04-20T16:40:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Marco\_Festugato](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marco_festugato/32/327_2.png) [@Marco\_Festugato](https://discourse.vtk.org/u/Marco_Festugato)
#### Post date: [April 20, 2019, 4:40pm UTC](https://discourse.vtk.org/t/displaying-3d-volume-in-red/804/1 "2019-04-20T16:40:54Z")

</div>

Hi,

I want to display my 3D volume (range from 0 to 255) in **uniform** red. I’ve thought of this code:

```
colorTransferFunction-> AddRGBPoint (0.0 0.0 0.0 0.0); // i don't know if with
                                            // these lines i actually display 'red'
colorTransferFunction-> AddRGBPoint (255.0 1.0 0.0 0.0);
colorTransferFunction-> AddRGBPoint (0.0 0.0 0.0 0.0);
colorTransferFunction-> AddRGBPoint (0.0 0.0 0.0 0.0);
colorTransferFunction-> AddRGBPoint (0.0 0.0 0.0 0.0);
volumeProperty->SetColor(colorTransferFunction);

```

but i receive this error for all the “AddRGBPoint” lines:

_sintax error: ‘constant’_

what am i doing wrong?

Thanks in advance for any help!

---

<div class="post-metadata">

### Author: ![marcomusy](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marcomusy/32/95_2.png) [@marcomusy](https://discourse.vtk.org/u/marcomusy)
#### Post date: [April 21, 2019, 3:36pm UTC](https://discourse.vtk.org/t/displaying-3d-volume-in-red/804/2 "2019-04-21T15:36:10Z")

</div>

you are missing all the commas in the arguments.

```
    colorTransferFunction->AddRGBPoint(minvalueofscalar, 1, 0, 0);
    colorTransferFunction->AddRGBPoint(maxvalueofscalar, 1, 0, 0);
```

---

<div class="post-metadata">

### Author: ![Marco\_Festugato](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marco_festugato/32/327_2.png) [@Marco\_Festugato](https://discourse.vtk.org/u/Marco_Festugato)
#### Post date: [April 21, 2019, 3:46pm UTC](https://discourse.vtk.org/t/displaying-3d-volume-in-red/804/3 "2019-04-21T15:46:07Z")

</div>

Thank you @marcomusy for your answer. I’ve put the commas and now the code is working.  
Thank u!
