# Calculating texture cordinates

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

## Recommended Posts

I created a geosphere, but am having a few problems putting texture coordinates on it. The problem is that where the texture wraps around. as the geosphere is created from tessellation and not angles, I can't calculate it that way. Instead I'm using this: (theta of (x,y) / 2pi + 0.5, asin(x)/pi + 0.5) There are some triangles whose theta values for the vertex have different signs, so it basically goes from zero to one. But does anyone have any ideas how to solve this problem?

##### Share on other sites
I take it "theta of (x,y)" is atan2(x,y) and asin(x) is asin(z) or some permutation of the x's, y's and z's? My only guess it that your problem is when you wrap from 0 to 1. Perhaps pretty much drawing the complete width of the image across one polygon. Like perhaps them strips out in the indian ocean are africe, south america and indonesia.

##### Share on other sites
You need to figure out where the texture coordinates wrap, and duplicate those vertices. By duplicating I mean that the vertex positions are the same, but the texture coordinate t0 on one vertex is in the range 0..1 and the other vertex has texture coordinate t1 = t0 + 1, being in range 1..2.

With slices and stacks spheres it is trivial to 'duplicate', by creating slice edge vertices both at 0 and 2*Pi - their positions will end up same, but the texture coordinates will be different.

##### Share on other sites
How did you do that? Specifically how did you get the URL for that page? I know they use to have a place you could click to copy the URL, but I searched all over and just couldn't see it.

1. 1
2. 2
Rutin
20
3. 3
khawk
17
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633759
• Total Posts
3013715
×