Jump to content
  • Advertisement
Sign in to follow this  
looeee

Map triangular texture onto triangle with curved edges

This topic is 869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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, which looks like this:
 
U48rc.png
 
 
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:
 
SEi0G.png
 
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 curves as in the first picture):
 
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:
 
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: I was able to solve this with a solution given to me by a kind soul over on computergraphics.stackexchange.com
Edited by looeee

Share this post


Link to post
Share on other sites
Advertisement
You could try to use barycentric coordinates to do the mapping: For each point P in the triangle ABC, compute the areas of ABP, BCP and CAP, then look a the point with those barycentric coordinates in the triangle that describes the texture.

Share this post


Link to post
Share on other sites

I notice that the two places where it looks like it gets cut happen to be the two places that have a really thin triangle going through them. You may want to look into that as well.

Share this post


Link to post
Share on other sites

I tried adjusting the subdivision distance so that there are no thin triangles, it helps a bit but the texture is still very distorted. I'm going to try a more standard subdivision method like this 

jhKX2.gif

And see if that helps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!