# Can the VTK get the world coordinates of the vertices in the read model in the OpenGL shader?

**URL:** https://discourse.vtk.org/t/can-the-vtk-get-the-world-coordinates-of-the-vertices-in-the-read-model-in-the-opengl-shader/5325
**Category:** Support
**Created:** [March 5, 2021, 3:04am UTC](https://discourse.vtk.org/t/can-the-vtk-get-the-world-coordinates-of-the-vertices-in-the-read-model-in-the-opengl-shader/5325 "2021-03-05T03:04:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jone7](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/j/e36b37/32.png) [@Jone7](https://discourse.vtk.org/u/Jone7)
#### Post date: [March 5, 2021, 3:04am UTC](https://discourse.vtk.org/t/can-the-vtk-get-the-world-coordinates-of-the-vertices-in-the-read-model-in-the-opengl-shader/5325/1 "2021-03-05T03:04:17Z")

</div>

I want to use the world coordinates of the model to do the lighting calculation, and I saw in VTK opengl shader can get the model coordinates and view coordinates of vertex, I think that using model matrix multiplicate model coordinates can get the world coordinate, but I have no way to get the model matrix, do you have any good way to get the world coordinates, or model matrix?  
Thanks advance for you help!

---

<div class="post-metadata">

### Author: ![dmreagan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dmreagan/32/7489_2.png) [@dmreagan](https://discourse.vtk.org/u/dmreagan)
#### Post date: [March 5, 2021, 4:01pm UTC](https://discourse.vtk.org/t/can-the-vtk-get-the-world-coordinates-of-the-vertices-in-the-read-model-in-the-opengl-shader/5325/2 "2021-03-05T16:01:21Z")

</div>

It looks like this is only in the 2D polydata mapper, but maybe the links below can help.

> <https://github.com/Kitware/VTK/blob/858225c204ab626e7572070139c91c75b1c61e24/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx#L545>

> <https://github.com/Kitware/VTK/blob/948a48ec545a4489e50c77a27cb5a84a2234fd30/Rendering/OpenGL2/glsl/vtkPolyData2DVS.glsl#L25>
