Exemplo n.º 1
0
        /// <summary> Map mesh *from* local frame coordinates into "world" coordinates </summary>
        public static void FromFrame(IDeformableMesh mesh, Frame3f f)
        {
            int  NV          = mesh.MaxVertexID;
            bool bHasNormals = mesh.HasVertexNormals;

            for (int vid = 0; vid < NV; ++vid)
            {
                if (mesh.IsVertex(vid))
                {
                    Vector3d vf = mesh.GetVertex(vid);
                    Vector3d v  = f.FromFrameP((Vector3f)vf);
                    mesh.SetVertex(vid, v);
                    if (bHasNormals)
                    {
                        Vector3f n  = mesh.GetVertexNormal(vid);
                        Vector3f nf = f.FromFrameV(n);
                        mesh.SetVertexNormal(vid, nf);
                    }
                }
            }
        }