# Truchet pattern 3D height map from blurred image

**URL:** <https://discourse.processing.org/t/truchet-pattern-3d-height-map-from-blurred-image/39492>\
**Category:** Coding Questions\
**Created:** [October 29, 2022, 5:12pm UTC](https://discourse.processing.org/t/truchet-pattern-3d-height-map-from-blurred-image/39492 "2022-10-29T17:12:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [October 31, 2022, 12:40pm UTC](https://discourse.processing.org/t/truchet-pattern-3d-height-map-from-blurred-image/39492/2 "2022-10-31T12:40:25Z")

</div>

Hi @asymmetric,

still the same used in earlier post.

> [@3D Perlin noise in Processing](https://discourse.processing.org/t/3d-perlin-noise-in-processing/37770/15):
>
> Hi again, Well, as the day is slowly coming to an end and I’ve had some thoughts about whether to post or not, I’ve come to the decision that I will post it after all. There are many pros and cons that could be listed, but none of them weigh so heavily that there would be a right or wrong. Reasons are … My code is just one of many examples and is far from an all-encompassing implementation. There are many things that can be worked out in addition to this on the topic. I’ve now added lots of…

> [@How to link grid to image as a height map](https://discourse.processing.org/t/how-to-link-grid-to-image-as-a-height-map/38254/3):
>
> Hi @asymmetric, just for the sake of completness … I extended to 3D Removed all the mouse picking stuff, as picking in 3D is another topic and would go beyond the scope here… Cheers — mnse float scl = 8.; int rows, cols; int halfWidth; int halfHeight; boolean mode = true; GridPoint[][] grid; PImage img; class GridPoint { PVector position; PVector oposition; PVector uv; boolean locked; float phase; public GridPoint(float x, float y, float z, float u, float v, boolean plocked) {…

Look at it again and try to figure out what’s to do…  
As a Hint: read the blurred image into a buffer (maybe convert to grayscale beforehand), and map ie brightness from black to white (-1 to 1) and apply it to the corresponding z-coords (maybe multiplied with a factor, ie. 50.).

Cheers  
— mnse

---

_[View the full topic](https://discourse.processing.org/t/truchet-pattern-3d-height-map-from-blurred-image/39492)._
