projection to png saving

This commit is contained in:
Aada 2026-03-03 08:51:52 +02:00
parent aefc76c178
commit 2ace157573
3 changed files with 112 additions and 34 deletions

View file

@ -5,7 +5,7 @@ using System.Threading.Tasks;
public static class Projector
{
public static int[,] Points = new int[1024,512];
public static int[,] Points = new int[512,256];
public static void GatherPoints(PlanetHelper helper, int resolutionH = 2048)
{
Points = new int[resolutionH,resolutionH / 2];
@ -45,6 +45,11 @@ public static class Projector
}
public static ImageTexture Render(PlanetHelper helper)
{
return ImageTexture.CreateFromImage(RenderImage(helper));
}
public static Image RenderImage(PlanetHelper helper)
{
var image = Image.CreateEmpty(Points.GetLength(0), Points.GetLength(1), false, Image.Format.Rgb8);;
@ -55,6 +60,7 @@ public static class Projector
image.SetPixel(x,y, helper.Mdt.GetVertexColor(Points[x,y]));
}
}
return ImageTexture.CreateFromImage(image);
return image;
}
}