# Draw outline of 3D object

**URL:** https://discourse.vtk.org/t/draw-outline-of-3d-object/3711
**Category:** Support
**Created:** [July 6, 2020, 1:00pm UTC](https://discourse.vtk.org/t/draw-outline-of-3d-object/3711 "2020-07-06T13:00:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rprueckl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@rprueckl](https://discourse.vtk.org/u/rprueckl)
#### Post date: [July 6, 2020, 1:00pm UTC](https://discourse.vtk.org/t/draw-outline-of-3d-object/3711/1 "2020-07-06T13:00:48Z")

</div>

Hi,

is there a possibility to render the outline of a 3D object just like Blender does? I mean the orange outline that is displayed around the maximum extents of the object when selected:  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/2/2501cad0983d9319443a6840eb407985722f331c.jpeg)  
Thanks for your help.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [July 7, 2020, 2:44pm UTC](https://discourse.vtk.org/t/draw-outline-of-3d-object/3711/2 "2020-07-07T14:44:50Z")

</div>

Hello, friend,

You need something called outline shader. That would require lower level calls to OpenGL (assuming this is your rendering backend). Hence, you will need to write a custom `vtkMapper` to add that effect. You can take a look at the code of your current mapper ( see all `vtkMapper` classes here: [https://vtk.org/doc/nightly/html/classvtkMapper.html](https://vtk.org/doc/nightly/html/classvtkMapper.html) ). To see how to implement outline shading, you can read about it here: [https://www.codeproject.com/Articles/8499/Generating-Outlines-in-OpenGL](https://www.codeproject.com/Articles/8499/Generating-Outlines-in-OpenGL) and here: [https://gamedev.stackexchange.com/questions/70861/how-to-outline-a-3d-object-with-a-cartoon-style-stroke](https://gamedev.stackexchange.com/questions/70861/how-to-outline-a-3d-object-with-a-cartoon-style-stroke) .

cheers,

Paulo

---

<div class="post-metadata">

### Author: ![rprueckl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@rprueckl](https://discourse.vtk.org/u/rprueckl)
#### Post date: [July 10, 2020, 8:52am UTC](https://discourse.vtk.org/t/draw-outline-of-3d-object/3711/3 "2020-07-10T08:52:26Z")

</div>

Thank you for that input.

---

<div class="post-metadata">

### Author: ![scotsman60](https://discourse.vtk.org/user_avatar/discourse.vtk.org/scotsman60/32/6000_2.png) [@scotsman60](https://discourse.vtk.org/u/scotsman60)
#### Post date: [July 13, 2020, 1:27am UTC](https://discourse.vtk.org/t/draw-outline-of-3d-object/3711/4 "2020-07-13T01:27:32Z")

</div>

Doesn’t vtkPolyDataSilhouette do this?

I’ve never used it, but it’s on my list of things to look at when I get time…

---

<div class="post-metadata">

### Author: ![Michael](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael/32/16_2.png) [@Michael](https://discourse.vtk.org/u/Michael)
#### Post date: [July 13, 2020, 7:05am UTC](https://discourse.vtk.org/t/draw-outline-of-3d-object/3711/5 "2020-07-13T07:05:19Z")

</div>

Someone made a contribution to add this feature (not merged yet): [https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/6812](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6812)
