<p>My guess is that to get the texture to look right, you'll have to subdivide the interior of the triangle as well, and approximate the non-linear UV mapping within it.</p>

<p>Currently, it looks like you're subdividing around the edges of the triangle, and forming a fan of smaller triangles between the edge and the incenter. This would be fine if you were just rendering the triangle in a solid color. But when applying a texture, you're getting discontinuities at the boundaries of those subdivisions, because the texture is just stretched linearly across each subdivided triangle and not correctly approximating the hyperbolic mapping along the radial direction.</p>

<p>You'll need to subdivide along both axes, something like this:</p>

<p><img src="https://i.sstatic.net/jhKX2.gif" alt="enter image description here"></p>

<p>and position all the vertices appropriately in screen space and UV space to approximate the hyperbolic coordinates in the interior of the triangle. If you subdivide finely enough, this should produce the illusion of a continuously curving texture mapping.</p>

CC BY-SA 3.0
2016-02-29T20:58:35.013Z
Thanks, I'll try this. It was one of my original methods of building the polygon, however much more complex mathematically so I went with the simpler method. I'll give it another shot and report back.
Lewy Blue
CC BY-SA 3.0
2016-03-04T17:16:09.480Z
Thank you. I was able to modify your suggestion into a solution. See my edit above.
Lewy Blue
CC BY-SA 3.0
2016-02-29T20:21:54.260Z
2016-02-29T20:21:54.260Z
Nathan Reed
<p>I've been stuck on how to approach this for a while, so any suggestions would be gratefully appreciated!</p>

<p>I want to map a texture in the form of a lower right euclidean triangle to a hyperbolic triangle on the Poincare Disk.</p>

<p>Here's the texture (the top left triangle of the texture is transparent and unused). You might recognise this as part of Escher's Circle Limit I</p>

<p>Sorry, see the comment as I am not allowed to post more than two links it seems! </p>

<p>And this is what my polygon looks like (it's centred at the origin, which means that two edges are straight lines, however in general all three edges will be circular arcs):</p>

<p><a href="https://i.sstatic.net/1QB1E.png" rel="noreferrer"><img src="https://i.sstatic.net/1QB1E.png" alt="Wireframe Polygon"></a></p>

<p>The centre of the polygon is the incentre of the euclidean triangle formed by its vertices and I'm UV mapping the texture using it's incentre, dividing it into the same number of faces as the polygon has and mapping each face onto the corresponding polygon face. However the the result looks like this:</p>

<p><a href="https://i.sstatic.net/3Jw9I.png" rel="noreferrer"><img src="https://i.sstatic.net/3Jw9I.png" alt="Textured Polygon"></a></p>

<p>If anybody thinks this is solvable using UV mapping I'd be happy to provide some example code, however I'm beginning to think this might not be possible and I'll have to write my own mapping functions.</p>

<p>SOLVED with some refinement of @Nathan's answer below since the lines AB, AC, BC may actually be arcs not lines. </p>

<p>Method: pick the longest side, say BC, then subdivide this into an even number of parts. Subdivide the other two side into the same number of parts. Then the lines connecting these (DE in the answer below) must actually also be arcs, not straight lines. Subdivide these new arcs as required, add the new triangles as faces then UV map the lower right triangle of the texture to these new faces. </p>

<p>Simple? Not at all. But it worked. 
<a href="https://i.sstatic.net/90UQF.jpg" rel="noreferrer"><img src="https://i.sstatic.net/90UQF.jpg" alt="Fish 1"></a>
<a href="https://i.sstatic.net/bJ08M.jpg" rel="noreferrer"><img src="https://i.sstatic.net/bJ08M.jpg" alt="Fish 2"></a></p>

CC BY-SA 3.0
2016-02-29T19:19:59.807Z
Here is the texture I'm using: 
https://i.sstatic.net/SEi0G.png
Lewy Blue
CC BY-SA 3.0
2016-03-03T00:06:08.263Z
I actually fixed that shortly after posting this by making the subdivisions consistent and smaller, it fixes the shearing somewhat (although not completely). However the texture is still very distorted. I'm working on @nathan suggestion below, which at the very least will allow for a much finer subdivision.
Lewy Blue
CC BY-SA 4.0
2018-11-17T15:58:59.583Z
@Looeee Could you pass your code please, I'm very interested in this field of graphics
information
CC BY-SA 4.0
2018-11-18T12:41:10.047Z
Yes, you can find my code here: https://github.com/looeee/blackthread-heroku/tree/master/assets/js/src/pages/experiments/escherSketch

And the live version: https://blackthread.io/experiments/eschersketch/

Honestly, it's so long since I looked at this that I can't remember where in the code the functions that solve this are, but if you have trouble making sense of it drop me another comment here and I'll take a look.
Lewy Blue
<texture><uv-mapping>
Map a texture onto a hyperbolic triangle
Lewy Blue
# Map a texture onto a hyperbolic triangle

(Asked by: username_0 on 2016-02-29)

I've been stuck on how to approach this for a while, so any suggestions would be gratefully appreciated!

I want to map a texture in the form of a lower right euclidean triangle to a hyperbolic triangle on the Poincare Disk.

Here's the texture (the top left triangle of the texture is transparent and unused). You might recognise this as part of Escher's Circle Limit I

Sorry, see the comment as I am not allowed to post more than two links it seems!

And this is what my polygon looks like (it's centred at the origin, which means that two edges are straight lines, however in general all three edges will be circular arcs):

[![Wireframe Polygon](https://i.sstatic.net/1QB1E.png)](https://i.sstatic.net/1QB1E.png)

The centre of the polygon is the incentre of the euclidean triangle formed by its vertices and I'm UV mapping the texture using it's incentre, dividing it into the same number of faces as the polygon has and mapping each face onto the corresponding polygon face. However the the result looks like this:

[![Textured Polygon](https://i.sstatic.net/3Jw9I.png)](https://i.sstatic.net/3Jw9I.png)

If anybody thinks this is solvable using UV mapping I'd be happy to provide some example code, however I'm beginning to think this might not be possible and I'll have to write my own mapping functions.

SOLVED with some refinement of @username_2's answer below since the lines AB, AC, BC may actually be arcs not lines.

Method: pick the longest side, say BC, then subdivide this into an even number of parts. Subdivide the other two side into the same number of parts. Then the lines connecting these (DE in the answer below) must actually also be arcs, not straight lines. Subdivide these new arcs as required, add the new triangles as faces then UV map the lower right triangle of the texture to these new faces.

Simple? Not at all. But it worked.
[![Fish 1](https://i.sstatic.net/90UQF.jpg)](https://i.sstatic.net/90UQF.jpg)
[![Fish 2](https://i.sstatic.net/bJ08M.jpg)](https://i.sstatic.net/bJ08M.jpg)

**Tags:** texture, uv-mapping

> **Comments:**
> **username_0**: Here is the texture I'm using:  https://i.sstatic.net/SEi0G.png  
> **username_0**: I actually fixed that shortly after posting this by making the subdivisions consistent and smaller, it fixes the shearing somewhat (although not completely). However the texture is still very distorted. I'm working on @username_2 suggestion below, which at the very least will allow for a much finer subdivision.  
> **username_1**: @Looeee Could you pass your code please, I'm very interested in this field of graphics  
> **username_0**: Yes, you can find my code here: https://github.com/looeee/blackthread-heroku/tree/master/assets/js/src/pages/experiments/escherSketch  And the live version: https://blackthread.io/experiments/eschersketch/  Honestly, it's so long since I looked at this that I can't remember where in the code the functions that solve this are, but if you have trouble making sense of it drop me another comment here and I'll take a look.  

---

## 1 answers

### Answer by username_2 on 2016-02-29. Score: 7 | Accepted answer

My guess is that to get the texture to look right, you'll have to subdivide the interior of the triangle as well, and approximate the non-linear UV mapping within it.

Currently, it looks like you're subdividing around the edges of the triangle, and forming a fan of smaller triangles between the edge and the incenter. This would be fine if you were just rendering the triangle in a solid color. But when applying a texture, you're getting discontinuities at the boundaries of those subdivisions, because the texture is just stretched linearly across each subdivided triangle and not correctly approximating the hyperbolic mapping along the radial direction.

You'll need to subdivide along both axes, something like this:

![enter image description here](https://i.sstatic.net/jhKX2.gif)

and position all the vertices appropriately in screen space and UV space to approximate the hyperbolic coordinates in the interior of the triangle. If you subdivide finely enough, this should produce the illusion of a continuously curving texture mapping.

> **Comments:**
> **username_0**: Thanks, I'll try this. It was one of my original methods of building the polygon, however much more complex mathematically so I went with the simpler method. I'll give it another shot and report back.  
> **username_0**: Thank you. I was able to modify your suggestion into a solution. See my edit above.  

---

