# gourard interpolation in vtk js

**URL:** https://discourse.vtk.org/t/gourard-interpolation-in-vtk-js/11025
**Category:** Web
**Created:** [March 22, 2023, 3:19pm UTC](https://discourse.vtk.org/t/gourard-interpolation-in-vtk-js/11025 "2023-03-22T15:19:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![wael869](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/w/9f8e36/32.png) [@wael869](https://discourse.vtk.org/u/wael869)
#### Post date: [March 22, 2023, 3:19pm UTC](https://discourse.vtk.org/t/gourard-interpolation-in-vtk-js/11025/1 "2023-03-22T15:19:43Z")

</div>

I am trying to change interpolation to gourard but it shows results as phong or flat.  
in desktop version of my application using activwiz it worked well when I added polydatanormals filter and computed normals.  
how to do so in JS

---

<div class="post-metadata">

### Author: ![Thibault\_Bruyere](https://discourse.vtk.org/user_avatar/discourse.vtk.org/thibault_bruyere/32/6585_2.png) [@Thibault\_Bruyere](https://discourse.vtk.org/u/Thibault_Bruyere)
#### Post date: [March 22, 2023, 4:08pm UTC](https://discourse.vtk.org/t/gourard-interpolation-in-vtk-js/11025/2 "2023-03-22T16:08:34Z")

</div>

Hello,  
To use the vtkPolyDataNormals filter, you can do the following:

```js
import vtkPolyDataNormals from '@kitware/vtk.js/Filters/Core/PolyDataNormals';
// Compute the normals
const computeNormals = vtkPolyDataNormals.newInstance();
computeNormals.setInputData(polydata);
computeNormals.update();
// Set the normals of the polydata
const pointNormals = computeNormals
    .getOutputData()
    .getPointData()
    .getNormals();
polydata.getPointData().setNormals(pointNormals);

```

It looks like the vtkPolyDataNormals filter currently mutate the input polydata, but this is a bug.  
So the `\\ Set the normals of the polydata` part is not necessary as of today, but you should definitely use it as it could change in the future.

Tracking the issue [here](https://github.com/Kitware/vtk-js/issues/2762).
