fixed projection pixel count, adjustable projection resolution, smaller initial resolution for projection, added button controls
This commit is contained in:
parent
6ca58040c4
commit
901177e2e4
4 changed files with 70 additions and 11 deletions
19
src/Main.cs
19
src/Main.cs
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue