Exemplo n.º 1
0
        private static ThreeDSMesh.UV[] ParseTexVerts(DataReader3DS subSegment)
        {
            ThreeDSMesh.UV[] uv = new ThreeDSMesh.UV[subSegment.GetUShort()];

            for (int coord = 0; coord < uv.Length; coord++)
            {
                uv[coord].u = subSegment.GetFloat();
                uv[coord].v = subSegment.GetFloat();
            }

            return(uv);
        }
Exemplo n.º 2
0
        private static ThreeDSMesh.UV[] ReadTEXVERTS(FileStream file, Chunk chunk)
        {
            byte[] buffer = new byte[2];
            file.Read(buffer, 0, 2);
            ushort numVerts = BitConverter.ToUInt16(buffer, 0);

            ThreeDSMesh.UV[] map = new ThreeDSMesh.UV[numVerts];
            int size             = sizeof(float) * 2;

            buffer = new byte[size];
            for (int i = 0; i < numVerts; i++)
            {
                file.Read(buffer, 0, size);
                map[i].u = BitConverter.ToSingle(buffer, 0);
                map[i].v = BitConverter.ToSingle(buffer, sizeof(float));
            }

            return(map);
        }
Exemplo n.º 3
0
        private static ThreeDSMesh.UV[] ParseTexVerts(DataReader3DS subSegment)
        {
            ThreeDSMesh.UV[] uv = new ThreeDSMesh.UV[subSegment.GetUShort()];

            for (int coord = 0; coord < uv.Length; coord++)
            {
                uv[coord].u = subSegment.GetFloat();
                uv[coord].v = subSegment.GetFloat();
            }

            return uv;
        }