# Documentation for vertexMC, normalMC, MCDCMatrix, MVCMatrix.

**URL:** <https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883>\
**Category:** Development\
**Created:** [October 8, 2019, 11:18am UTC](https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883 "2019-10-08T11:18:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sherinnovation](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@sherinnovation](https://discourse.vtk.org/u/sherinnovation)\
**Post date:** [October 8, 2019, 11:18am UTC](https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883/1 "2019-10-08T11:18:29Z")

</div>

Hi,  
I am starting my shader development in VTK. Earlier, I had some knowledge on the built-in vertex shader variables like gl\_ModelViewMatrix. However, those variables are no longer appearing valid in my python based VTK shader code. I think the new ones are vertexMC, normalMC, MCDCMatrix, MVCMatrix. etc. The problem is I could not find any good documentation or examples to understand these variables. Can someone help me in understanding these variable or point me to some relevant documentation.  
Thanks

---

<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:** [October 11, 2019, 7:02am UTC](https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883/2 "2019-10-11T07:02:22Z")

</div>

Hello,  
Every input variables are suffixed with its reference frame, so `vertexMC` means `vertex` in `ModelCoordinates`.  
All the matrices are the transformation matrix from a reference to another: `MCDCMatrix` means `ModelCoordinates to DeviceCoordinates matrix`.  
Here is the full list:

- `MC`: Model coordinates
- `WC`: World coordinates
- `VC`: View coordinates
- `DC`: Device coordinates

So, the equivalent of `gl_ModelViewMatrix` is `MCVCMatrix`.

---

<div class="post-metadata">

**Author:** ![guaje](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/85f322/32.png) [@guaje](https://discourse.vtk.org/u/guaje)\
**Post date:** [September 10, 2020, 4:34pm UTC](https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883/3 "2020-09-10T16:34:19Z")

</div>

Hello

After upgrading to VTK 9.0.1 vertexMC is behaving differently. It seems the values of this variable are constrained and beyond those constraints the values are no longer equal to the values of the vertex defined in python. Is there a new way to use vertexMC? Are there some new major changes also for MCDCMatrix, MCVCMatrix, etc.?

Thanks

---

<div class="post-metadata">

**Author:** ![Garyfallidis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/garyfallidis/32/1952_2.png) [@Garyfallidis](https://discourse.vtk.org/u/Garyfallidis)\
**Post date:** [September 10, 2020, 8:51pm UTC](https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883/4 "2020-09-10T20:51:13Z")

</div>

I have noticed similar strange behavior when upgraded to VTK 9.0.1. As you say vertexMC values seem clipped or something strange is going on between vertexMC that changed from VTK 8.1.2 to 9.0.1.  
You can replicate this by drawing a simple square and trying to position it close to the origin (0, 0, 0) or far from the origin (e.g. (20, 0., 0)) then you will see vertexMC values that at least to me do not make sense.

---

<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:** [September 11, 2020, 7:00am UTC](https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883/5 "2020-09-11T07:00:16Z")

</div>

It’s probably related to the shift/scale method that is automatically applied to improve precision when the dataset is far from the origin.  
You can try to disable it (See [https://vtk.org/doc/nightly/html/classvtkOpenGLPolyDataMapper.html#ad9643c903c7145ca1a1bd08c8d605401](https://vtk.org/doc/nightly/html/classvtkOpenGLPolyDataMapper.html#ad9643c903c7145ca1a1bd08c8d605401))

---

<div class="post-metadata">

**Author:** ![guaje](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/85f322/32.png) [@guaje](https://discourse.vtk.org/u/guaje)\
**Post date:** [September 15, 2020, 2:13pm UTC](https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883/6 "2020-09-15T14:13:10Z")

</div>

Thanks, Michael! This seemed to solve the problem. I still have to run some tests to see how the precision changes when some objects are far from the origin. But so far this is solving the problem.

---

<div class="post-metadata">

**Author:** ![metamurk](https://discourse.vtk.org/user_avatar/discourse.vtk.org/metamurk/32/9665_2.png) [@metamurk](https://discourse.vtk.org/u/metamurk)\
**Post date:** [December 11, 2024, 3:49pm UTC](https://discourse.vtk.org/t/documentation-for-vertexmc-normalmc-mcdcmatrix-mvcmatrix/1883/7 "2024-12-11T15:49:22Z")

</div>

This simply does not work and there is no documentation about that wonderful secret magic kitware did here 🙂
