What I really need is a way to convert the 3D coordinates (I can ignore elevation as in this case I won't really need it) of a point that lies on a mesh into 2D coordinates that correspond to a point on the bitmap making up the mesh WHILE TAKING SUBDIVISION INTO ACCOUNT. I can't simply divide the X and Y coordinates by the mesh X and Y scale values since at certain subdivision values this point is off by a certain amount.
Is there any way? Thanks, Ari On Sep 2, 7:34 pm, Ari Braginsky <[EMAIL PROTECTED]> wrote: > I'm having an issue retrieving 2D coordinates off of a mesh based on a > 3D object's position on the mesh. > > You can normally retrieve the 2D coordinates on the bitmap making up > the mesh by dividing the coordinates of the object by the mesh's X and > Y scale values (see extrusions/CollisionMap.as class). > > However, if you look at the position on the mesh and compare it to the > raw bitmap, due to some deformations that happen to the mesh with > certain subdivision values, the objects that appear in the bitmap > don't line up with the 2D coordinates on the raw bitmap. If you tweak > the subdivision values, the objects on the bitmap in the mesh move > around/get squashed/etc. > > Example: > > Create a bitmap with a circle in the center filled with the color red. > > Create an elevation using a flat height map and use the bitmap for its > skin. > > When rendered in 3D, you will see the red circle in the center of the > mesh. If you move your mouse over it, you can translate the 3D > coordinates into 2D space and divide them by the mesh's X and Y scale > values to get the real coordinates on the raw bitmap. > > What I'm seeing with subdivision values X = 200 and y = 200 is that my > point on the mesh doesn't correlate to the same point on the 2D bitmap > when I convert the 3D coordinates to 2D, taking into account the mesh > scale values. > > Is there something else I need to do to account for the subdivision > values? > > If I didn't want any deformation of the mesh, are there subdivision > values I can use such that 3D points on the mesh would exactly match > up with 2D points on the associated bitmap? > > Thanks, > Ari
