Translate texture/uv coordinate to 3D position

Software: Away3D 3.x

PaulT, Newbie
Posted: 04 January 2012 09:12 PM   Total Posts: 2

Hi all,

For a project I’m doing I need to translate a texture coordinate to a coordinate in 3D space. So far I have not been able to find any clues on how to achieve this and I’m stuck with this problem.
Is there a method available that I can use, or should I hook some code in to achieve this?
Any help in pointing me in the right direction is highly appreciated!

Thanks,

Paul

   

Avatar
Fabrice Closier, Administrator
Posted: 04 January 2012 10:32 PM   Total Posts: 1265   [ # 1 ]

There is a class doing this practically out of the box: barycentricTest in tools. The only thing required, is to interpolate the values of the uv coordinates from the “bounds” that you define from the 3 face vertices and their respective uv’s.

   

PaulT, Newbie
Posted: 06 January 2012 02:20 PM   Total Posts: 2   [ # 2 ]

Thanks for your quick reply Fabrice and sorry for my late reply back to you.

It looks like this class that you are referring to does the opposite for what was needed, as this will return a UV coordinate based on a face’s position in space. What I was looking for is to get from a coordinate in a texture to a 3D position in space.

Fortunately my 3D object is quite simple, as I’m working with a sphere. This allows me to transform a texture coordinate myself with some math.

   

Avatar
Fabrice Closier, Administrator
Posted: 06 January 2012 04:29 PM   Total Posts: 1265   [ # 3 ]

The MouseEvent3d returns you the uv coordinates and the position in space.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X