コード例 #1
0
        public static void TransformationRotation(List <TriMesh.Vertex> vertice, Vector3D rotation, bool local)
        {
            Vector3D center = Vector3D.Zero;
            Matrix4D m      = Matrix4D.Identity();

            if (local)
            {
                center = TriMeshUtil.GetCenter(vertice);

                Matrix4D moveC = ComputeMatrixMove(ref center);
                center.Negate();
                Matrix4D moveCReverse = ComputeMatrixMove(ref center);
                Matrix4D r            = ComputeMatrixRotation(rotation);
                m = moveCReverse * r * moveC;
            }
            else
            {
                m = ComputeMatrixRotation(rotation);
            }
            TransformationVertex(vertice, m);
        }