fixed projection pixel count, adjustable projection resolution, smaller initial resolution for projection, added button controls

This commit is contained in:
Aada 2026-03-03 07:34:13 +02:00
parent 6ca58040c4
commit 901177e2e4
4 changed files with 70 additions and 11 deletions

View file

@ -24,6 +24,7 @@ public partial class Main : Control
private PlanetHelper.VertexData? _vertex = null;
private PlanetHelper.PlateData? _plate = null;
private int _resolution = 512;
private PlanetHelper _planetHelper;
public override void _Ready()
@ -62,7 +63,7 @@ public partial class Main : Control
{
if (tab == 1)
{
Projector.GatherPoints(_planetHelper);
Projector.GatherPoints(_planetHelper, _resolution);
_textureRect.Texture = Projector.Render(_planetHelper);
}
}
@ -136,4 +137,20 @@ public partial class Main : Control
_planetHelper = new PlanetHelper(_meshInstance, _textureRect);
}
public void Advance()
{
_planetHelper.Advance = true;
}
public void AutoRun()
{
_planetHelper.AutoRun = true;
}
public void ResolutionChange(String change)
{
change = new string(change.Where(c => char.IsDigit(c)).ToArray());
_resolution = Int32.Parse(change);
_resolution = Math.Clamp(_resolution, 64, 8192);
}
}