#### Archived

This topic is now archived and is closed to further replies.

# How to calculate texture coords?

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

## Recommended Posts

hi, this question is related to geometry that may dynamically change. for example: a polygon like this +--------+ | | | | | | | | +--------+ mutates to a polygon like this: +- | - | - | - | - + - - - - + - | - | - | - | + sorry for the inconvenienca i have thought which algorithm could do this... lets assume the former polygon had coordinates like (0, 0) (1, 0) and so on how then compute the new ones?? thanks, gammastrahler

##### Share on other sites
well.. if you want 2d polygon (x1,y1),(x2,y2),(x3,y3) morph to a new shape (dx1,dy1),(dx2,dy2),(dx3,dy3) in 5 steps:

1. interpolate (to get adding values)
deltax1 = (dx1 - x1) / 5
deltay1 = (dy1 - y1) / 5
deltax2 = (dx2 - x2) / 5
deltay2 = (dy2 - y2) / 5
deltax3 = (dx3 - x3) / 5
deltay3 = (dy3 - y3) / 5

2. morph
for (i=0;i<5;i++) {
x1 += deltax1;
y1 += deltay1;
x2 += deltax2;
y2 += deltay2;
x3 += deltax3;
y3 += deltay3;
}

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
16
5. 5

• 14
• 29
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631774
• Total Posts
3002287
×