How can I convert from a UV to a world coord?

Blitz3D Forums/Blitz3D Programming/How can I convert from a UV to a world coord?

Vorderman(Posted 2006) [#1]
Anyone know how I can convert from UV coordinates to world space coords, without relying upon vertices being present at that location?

Assuming a simple mesh representing a curved wall, with a texture mapped 0 to 1 along and up the wall.

What I want to do is -

1. pick a point on the wall - eg. UVs = 0.24 and 0.78

2. round up and down to the nearest 0.1 to get 4 points surrounding the picked UV - eg. 0.2 to 0.3 and 0.7 to 0.8.

3. work out the world space coords of each of these 4 UV points.


jfk EO-11110(Posted 2006) [#2]
>>without relying upon vertices being present at that location?<<

I'm afraid you can't since UV is a 2D system. You may easily calculate their world coordinates when you use the 3 vertices of the triangle. simply shift the UV space (winthin 1.0) to the triangle size, add the min vertex coordinate, then use tformpoint.


Beaker(Posted 2006) [#3]
Do these help?:

PickedU()/PickedV()
http://www.blitzbasic.com/codearcs/codearcs.php?code=515

PickedQuad()
http://www.blitzbasic.com/codearcs/codearcs.php?code=1603