Public Group

Face Specifics

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

Recommended Posts

Hey everyone!
does anyone at all know how I can calculate the width of a face so I am able to get the TL, TR, BL BR (Top Left, Bottom Left etc) values correctly.

I am able to draw all the verticies perfectly well and am able to view them in blender and a game engine being written, the thing is I need to be able to calculate the texture coordinates to allow for shift, stretch etc, to do this I need to get the above values and perform a calculation on them and I am unsure how to obtain these values when some of the faces have more than or less than 4 verticies.

any help would be greatly appreciated.

thanks.

Share on other sites
If you are looking for the width between two points, its as simple as find the distance between the two points (dX= TR.x - TL.x, dY= TR.y - TL.y ), then distance can be calculated by taking the square root of

distance = squareroot(dX[size="4"]² + dY[size="4"]²)

Of course, if you just want the distance along a single axis between two points, it's just a matter of point2.x - point1.x == width

Truth of the matter is, I don't think this is what you are looking for, what you want is UV coordinates.

Share on other sites
I was under the impression that if I am able to calculate the following sum:

'256 / 64 * 0.25'

256 = texture width
64 = face width
0.25 = the stretch

then the total is == 1

which is the kind of coordinates I was expecting? is this not correct?

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 23
• 40
• 23
• 13
• 13
• Forum Statistics

• Total Topics
631733
• Total Posts
3001928
×