Jump to content
• Advertisement

# Map texture triangle to a right triangle

This topic is 3812 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

Hi! In a my precedent post, I've implemented this method: I've a model with texture, I read the frame buffer and I store the data on a image. Now I take the same model, but without the original texture, and I want to texture this model with the precedent image. It runs correctly. Now I want to create a compact texture map from this image, so map each triangle of the texture to a right angle triangle, and these are packed together. The problem is choose a correct size of this right triangle (that must be a multiple of 2^n). Trying a "random" number, the method runs correctly but the result is, obviously, ugly. It appears blurred. With my teacher I've found a method to determinate a correct right triangle size. Must be find the projected area of the triangle (in pixel), and must select the right triangle, of dimension 2^n, that approximates the original area. For example, if a triangle have a projected area of 37890 pixel, the n value is: log2(37890)=15.2 I can choose 15 or 16. A right triangle of 2^16 pixel is 65536. Now we must found the width and the length of this triangle with (width=length). So l=sqrt(65536*2)=362, this value is expressed in pixel. This is my problem: with this l value, how can I return to the value in world space coordinate? If I find this value, I can construct the righ triangle and map the texture. I hope that this post is not confused! Thanks!

#### Share this post

##### Share on other sites
Advertisement

• Advertisement

### Announcements

• Advertisement

• ### Popular Contributors

1. 1
2. 2
Rutin
31
3. 3
4. 4
5. 5
khawk
14
• Advertisement

• 11
• 11
• 23
• 10
• 9
• ### Forum Statistics

• Total Topics
633647
• Total Posts
3013108
×

## Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!