How to get UV coordinates of mesh

Software: Away3D 4.x

saadaftab90, Newbie
Posted: 06 July 2017 12:55 PM   Total Posts: 2

Hi all.

I already know that I can get UVs by using event:MouseEvent3D. event.uv is returning the same results what I need. But the problem is in my project I can’t use MouseEvent3D.

So is there any function which returns UV of a mesh ?

I can guess it’s called ‘unprojection’. But the function ‘unproject’ is only available for View3D & it’s not resolving my issue I want to unproject a mesh. I want UVs of that mesh.

Help please I’m searching for the solution since a last month :(


Fabrice Closier, Administrator
Posted: 06 July 2017 02:21 PM   Total Posts: 1265   [ # 1 ]

if you pass the mouse coordinates and use view3d.unproject you get a
position in space. To do what the MouseEvent3D does, you need hittest each face of the mesh on a line camera and the result position of the unproject method. Then if a hit, using barycentric coordinates for the location of the hit on the face, you can then retreive the uvs.

All the calcs are in to be found in a few classes such as : testSubMeshCollision.
You can also look at raytracers, they all use the same principles (except they usually do not use mouse coordinates).

As you need the mouse coordinates, why don’t you use MouseEvent3D?
If you can’t because the view is somehow mouse disabled, just define an event with the mouse coords and dispatch it.

‹‹ FBX File Support


Away3D Forum

Member Login