예제 #1
0
파일: Form1.cs 프로젝트: huyinjie/x3dom
 public OutputNode(double xOffset, double yOffset, double factor, 
                 int level, int quadNumber, UV[,] UVCoords, Bitmap bmp, 
                 Bitmap resultBmp, String storingPath, String type,
                 int column, int row, TreeTileData [] treeTileData)
 {
     Column = column;
     Row = row;
     XOffset = xOffset;
     YOffset = yOffset;
     Factor = factor;
     Level = level;
     QuadNumber = quadNumber;
     BMP = bmp;
     ResultBMP = resultBmp;
     TransformedUVCoords = new UV[UVCoords.GetLength(0), UVCoords.GetLength(1)];
     StoringPath = storingPath;
     TreePathData = treeTileData;
     Type = type;
     // transforms the original texture coordinates to local space
     for (int x = 0; x < UVCoords.GetLength(0); x++)
     {
         for (int y = 0; y < UVCoords.GetLength(1); y++)
         {
             TransformedUVCoords[x, y] = new UV(xOffset + UVCoords[x, y].U * factor, 
                                                yOffset + UVCoords[x, y].V * factor);
         }
     }
 }
예제 #2
0
파일: Form1.cs 프로젝트: huyinjie/x3dom
        /// <summary>
        /// Creates the coordinates of all pixels that will be generated in texture space 
        /// </summary>
        /// <param name="size">resolution in x and z direction</param>
        /// <returns></returns>
        private UV[,] createVertexData(double size)
        {
            UV [,] result = new UV[(int)(size), (int)(size)];
            double step = 1.0 / (size - 1.0);

            for (int y = 0; y < size; y ++)
            {
                for (int x = 0; x < size; x ++)
                {
                    result[(int)x, (int)y] = new UV(y * step, x * step);
                }
            }

            return result;
        }