<p>It would seem that, in the second example, the morphNormals are targets while in in the first they are deltas.</p>

<p>This explains the difference in math used between the two pieces of code.</p>

CC BY-SA 4.0
2018-05-20T04:21:33.477Z
2018-05-20T04:21:33.477Z
Sebastián Mestre
<p>I am trying to verify that if I have my <code>inNormal</code> and some <code>N</code> amount of morph normals that I would want to do something such as</p>

<pre><code>outNormal = vec3(inNormal);
outNormal += morphNormal0 * morphWeight0;
outNormal += morphNormal1 * morphWeight1;
...
outNormal += morphNormalN * morphWeightN;
</code></pre>

<p>This seems to work for me (don't have a ground truth to compare) so I wanted to test it in Three.js knowing it would have an established method and I see <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl" rel="nofollow noreferrer">they use</a></p>

<pre><code>objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];
objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];
objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];
objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];
</code></pre>

<p>So now I am wondering how that math works out as it doesn't work for me. Both methods end up multiplying it by a <code>normalMatrix</code>so not sure what would be different.</p>

<p><strong>edit</strong>: Assuming both are loading in glTF 2.0 models</p>

CC BY-SA 4.0
2018-05-15T14:57:04.627Z
In your method, is morphNormalN a delta or the actual normal to morph towards?
bram0101
CC BY-SA 4.0
2018-05-15T19:58:27.907Z
@bram0101 the spec says "deviations in the Morph Target" and looking at the data it looks like morphNormal0 a delta, not the "new normal" of the morph target position
FrickeFresh
CC BY-SA 4.0
2018-05-15T20:05:25.040Z
Actually I realized I never checked if they altered the morphNormals prior to this
FrickeFresh
<vectors>
Morph Targets Normal adding math
FrickeFresh
# Morph Targets Normal adding math

(Asked by: username_0 on 2018-05-14)

I am trying to verify that if I have my `inNormal` and some `N` amount of morph normals that I would want to do something such as

```
outNormal = vec3(inNormal);
outNormal += morphNormal0 * morphWeight0;
outNormal += morphNormal1 * morphWeight1;
...
outNormal += morphNormalN * morphWeightN;

```

This seems to work for me (don't have a ground truth to compare) so I wanted to test it in Three.js knowing it would have an established method and I see [they use](https://github.com/mrdoob/three.js/blob/master/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl)

```
objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];
objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];
objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];
objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];

```

So now I am wondering how that math works out as it doesn't work for me. Both methods end up multiplying it by a `normalMatrix`so not sure what would be different.

**edit**: Assuming both are loading in glTF 2.0 models

**Tags:** vectors

> **Comments:**
> **username_1**: In your method, is morphNormalN a delta or the actual normal to morph towards?  
> **username_0**: @username_1 the spec says "deviations in the Morph Target" and looking at the data it looks like morphNormal0 a delta, not the "new normal" of the morph target position  
> **username_0**: Actually I realized I never checked if they altered the morphNormals prior to this  

---

## 1 answers

### Answer by username_2 on 2018-05-20. Score: 1

It would seem that, in the second example, the morphNormals are targets while in in the first they are deltas.

This explains the difference in math used between the two pieces of code.


---

