public override Color32[] get_pixels(NormalizedCartesianCoordinates[] positions)
 {
     Color32[] colors = new Color32[positions.Length];
     for (int index = 0; index < positions.Length; ++index)
     {
         SphericalRectangleUVCoordinates spherical_rectangle = positions[index].to_spherical_rectangle(canvas_variable);
         if (!spherical_rectangle.valid())
         {
             colors[index] = new Color32(0, 0, 0, 0); // Color.clear
         }
         else
         {
             colors[index] = texture.GetPixel(spherical_rectangle.uv.x.scale(texture.width), spherical_rectangle.uv.y.scale(texture.height));
         }
     }
     return(colors);
 }
Example #2
0
 /// <summary>
 /// Inspector - Creates a spherical rectangle UV coordinate from a point (implicit caller) and a rectangle (explicit).
 /// </summary>
 /// <param name="canvas">A Rect (measuring radians) representing the start and stop angles relative to Quaternion.identity. X/Y Range: (-2PI, +2PI).</param>
 /// <returns>UV Coordinates for a spherical rectangle.</returns>
 public SphericalRectangleUVCoordinates to_spherical_rectangle(Rect canvas)
 {
     return(SphericalRectangleUVCoordinates.cartesian_to_spherical_rectangle(data, canvas));
 }