Esempio n. 1
0
 void UpdateRotation(HyperCubeMesh cube)
 {
     for (int i = 0; i < 16; i++)
     {
         float[] src = new float[4];
         src[0] = cube.srcVertices[i].x;
         src[1] = cube.srcVertices[i].y;
         src[2] = cube.srcVertices[i].z;
         src[3] = cube.srcVertices[i].w;
         float[] dst = new float[4];
         manager.GetComponent <Manager>().trackball.transform(src, dst);
         cube.updatepoint4(dst, i);
     }
 }
Esempio n. 2
0
        public void UpdateRotation(HyperCubeMesh cube)
        {
            center_ = new Vector4();
            for (int i = 0; i < 16; i++)
            {
                float[] src = new float[4];
                src[0] = cube.srcVertices[i].x;
                src[1] = cube.srcVertices[i].y;
                src[2] = cube.srcVertices[i].z;
                src[3] = cube.srcVertices[i].w;
                float[] dst = new float[4];

                manager.GetComponent <Manager>().trackball.transform(src, dst);
                center_.x += dst[0];
                center_.y += dst[1];
                center_.z += dst[2];
                center_.w += dst[3];
                cube.updatepoint4(dst, i);
            }
            center_ = center_ / 16f;
            updatevertices(mesh);
        }