Update loc of Vertex.

This commit is contained in:
Troispoils 2024-03-01 15:03:45 +01:00
parent bb723036c0
commit 4ea0101cf6
4 changed files with 55 additions and 27 deletions

View file

@ -53,8 +53,10 @@ namespace Map3DRendering {
_shader.Use();
mapRender.OnLoad(_shader);
_texture = Texture.LoadFromFile("atlas.jpg");
_texture.Use(TextureUnit.Texture0);
var file = Directory.EnumerateFiles(@"./terrains");
_texture = Texture.LoadFromArray(file.ToArray());
_texture.UseArray(TextureUnit.Texture0);
axesGizmo = new AxesGizmo();
@ -74,7 +76,7 @@ namespace Map3DRendering {
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
_shader.Use();
_texture.Use(TextureUnit.Texture0);
_texture.UseArray(TextureUnit.Texture0);
_shader.SetMatrix4("view", _camera.GetViewMatrix());
_shader.SetMatrix4("projection", _camera.GetProjectionMatrix());
@ -142,10 +144,10 @@ namespace Map3DRendering {
_camera.Position += _camera.Right * cameraSpeed * (float)e.Time; // Right
}
if (input.IsKeyDown(Keys.Space)) {
_camera.Position += _camera.Up * cameraSpeed * (float)e.Time; // Up
_camera.Position += Vector3.UnitY * cameraSpeed * (float)e.Time; // Up
}
if (input.IsKeyDown(Keys.LeftShift)) {
_camera.Position -= _camera.Up * cameraSpeed * (float)e.Time; // Down
_camera.Position -= Vector3.UnitY * cameraSpeed * (float)e.Time; // Down
}
// Get the mouse state