<p>The most straightforward way would be to put x into the red channel, y into the green channel, and z into the blue channel of each pixel. </p>

<p>You could also make a 1 channel image where intensity is used to describe height. This is called a <a href="https://en.wikipedia.org/wiki/Heightmap" rel="nofollow noreferrer">height map</a>. Usually the x and y of the mesh are the same as the x and y of the image, so no need to store them in any way.</p>

CC BY-SA 3.0
2017-06-14T01:59:17.187Z
is it possible to generate a height map using 3d software such as maya or blender rather than trying to create one manually using python? and does the generated map store the 3d coordinates in each channel like you have described?
Mark Markrowave Charlton
CC BY-SA 3.0
2017-06-14T02:33:49.793Z
I haven't done it that way before, but I believe you can. (I'm usually generating them in code.) There is a [Blender Stack Exchange](https://blender.stackexchange.com) where you could ask about that. The [Video Production Stack Exchange](https://video.stackexchange.com) may have info on Maya or other apps. In my experience height maps are usually just grayscale images where brightness represents height rather than putting all 3 coordinates into the r, g, and b channels, so I'd expect most apps to output that way.
user1118321
CC BY-SA 3.0
2017-06-14T05:36:24.007Z
@MarkMarkrowaveCharlton Yes all you have to do is choose a format that allows writing the zbuffer and check ot under camera settings. If really need this in a rgb image you can just write the distance to the pixel value using a node (sampler info in maya)
joojaa
CC BY-SA 3.0
2017-06-14T01:56:42.377Z
2017-06-14T01:56:42.377Z
user1118321
<p>How can i store the X,Y,Z vertex points of a mesh into a 2d image, such that reading the image pixel values will correspond to the 3d coordinates? is it possible to just store x, y, values on a grid and use the Z value as an intensity value?</p>

<transformations>
Store 3d coordinates in a 2d image?
Mark Markrowave Charlton
# Store 3d coordinates in a 2d image?

(Asked by: username_0 on 2017-06-14)

How can i store the X,Y,Z vertex points of a mesh into a 2d image, such that reading the image pixel values will correspond to the 3d coordinates? is it possible to just store x, y, values on a grid and use the Z value as an intensity value?

**Tags:** transformations


---

## 1 answers

### Answer by username_1 on 2017-06-14. Score: 2 | Accepted answer

The most straightforward way would be to put x into the red channel, y into the green channel, and z into the blue channel of each pixel.

You could also make a 1 channel image where intensity is used to describe height. This is called a [height map](https://en.wikipedia.org/wiki/Heightmap). Usually the x and y of the mesh are the same as the x and y of the image, so no need to store them in any way.

> **Comments:**
> **username_0**: is it possible to generate a height map using 3d software such as maya or blender rather than trying to create one manually using python? and does the generated map store the 3d coordinates in each channel like you have described?  
> **username_1**: I haven't done it that way before, but I believe you can. (I'm usually generating them in code.) There is a [Blender Stack Exchange](https://blender.stackexchange.com) where you could ask about that. The [Video Production Stack Exchange](https://video.stackexchange.com) may have info on Maya or other apps. In my experience height maps are usually just grayscale images where brightness represents height rather than putting all 3 coordinates into the r, g, and b channels, so I'd expect most apps to output that way.  
> **username_2**: @username_0 Yes all you have to do is choose a format that allows writing the zbuffer and check ot under camera settings. If really need this in a rgb image you can just write the distance to the pixel value using a node (sampler info in maya)  

---

