daily update on 20240413 by nitload youmu, camera complete

This commit is contained in:
YoumuLiu
2024-04-13 04:04:14 +08:00
parent f0f80f72f1
commit 7c755fe1e2
99 changed files with 1351 additions and 1119 deletions
+29 -22
View File
@@ -70,10 +70,10 @@ namespace StgSharp
0.0f, 0.5f, 0.0f
);
Rectangle rec = new Rectangle(
-0.3f, 0.3f, 0.0f,
0.3f, 0.3f, 0.0f,
0.3f, -0.3f, 0.0f,
-0.3f, -0.3f, 0.0f
-0.3f, 0.3f, 130.0f,
0.3f, 0.3f, 130.0f,
0.3f, -0.3f, 130.0f,
-0.3f, -0.3f, 130.0f
);
Polygon5 polygon = new Polygon5(
-0.4f, 0.5f, 0.0f,
@@ -121,24 +121,18 @@ namespace StgSharp
/**/
camera = new Camera(
new vec3d(1,1,1),
new vec3d(0,0,0),
new vec3d(0,0,200),
new vec3d(0,0,100),
new vec3d(0,1,0)
);
camera.SetViewRange(new Radius(Scaler.Pi / 2),this.Size,(0,0),(1f,1f));
camera.SetViewRange(new Degree(5),Size,(0,0),(50f,50f));
camera.GainAllUniforms(shader, "camera");
/**/
camera.Test(
new vec4d(0.5f,0.5f,0, 1),
new vec4d(0.5f, -0.5f, 0, 1),
new vec4d(-0.5f, -0.5f, 0, 1),
new vec4d(-0.5f, 0.5f, 0, 1)
);
/**/
//camera.Test();
}
protected override void Main()
{
float movement = 0.005f;
GL.ClearColor(0.333f, 0.555f, 0.555f, 1.0f);
GL.Clear(MaskBufferBit.COLOR | MaskBufferBit.DEPTH);
@@ -157,18 +151,31 @@ namespace StgSharp
/**/
float time = CurrentFrameCount / 60.0f;
camera.SetViewDirection(
new vec3d(Scaler.Cos(time * 10), 1, Scaler.Sin(time * 10)),
new vec3d(0, 0, 0),
new vec3d(0, 1, 0)
);
if (InternalIO.glfwGetKey(this.WindowID,GLconst.GLFW_KEY_UP) == KeyStatus.PRESS)
{
camera.Pitch(new Radius(movement));
}
else if (InternalIO.glfwGetKey(this.WindowID, GLconst.GLFW_KEY_DOWN) == KeyStatus.PRESS)
{
camera.Pitch(new Radius(-movement));
}
if (InternalIO.glfwGetKey(WindowID, GLconst.GLFW_KEY_LEFT) == KeyStatus.PRESS)
{
camera.Yaw(new Radius(-movement));
}
else if (InternalIO.glfwGetKey(WindowID, GLconst.GLFW_KEY_RIGHT) == KeyStatus.PRESS)
{
camera.Yaw(new Radius(movement));
}
GL.SetValue(color,
0.5f + MathF.Cos(time),
0.5f + MathF.Sin(time * 0.66667f + 2 * Scaler.Pi / 3),
0.5f + MathF.Sin(time * 0.33333f + Scaler.Pi / 3),
0.5f + MathF.Sin(time * 0.66667f + (2 * Scaler.Pi / 3)),
0.5f + MathF.Sin(time * 0.33333f + (Scaler.Pi / 3)),
time
);
camera.SetAllUniforms();
/**/
+1 -1
View File
@@ -22,7 +22,7 @@ void main()
);
TexColor = color;
TexCoord = aTextCoord;
vec4 temp = (vec4(aPos.xyz,1.0) + vec4(color.yz-vec2(0.5,0.5),0.0,0.0)) * rotation;
vec4 temp = vec4(aPos.xyz,1.0);
gl_Position = /**/ camera * /**/ temp;
}
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+e1e416bb41a7e16ddec5e7c16d64c72d6aa380e1")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f0f80f72f14d191bade9e1e542454d72f0d304a6")]
[assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")]
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
5fc65e27ab1eae6b9eeb60c61c388d2d98eeb396f53cbb6b719f6e99588e5cd4
078ad1de8316ac39cc24c9015ddc6ea463215f431658ec068a6783dbac5eadd6
@@ -1 +1 @@
7992bdcbaa0d5122f4f0ecc5f6d631ac76aabe4e624830ef7dbc805de504abae
8a770e7e64a1828f478ce21dee393946f2ed012dee01f75199360879a335f8ce
@@ -1 +1 @@
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/e1e416bb41a7e16ddec5e7c16d64c72d6aa380e1/*"}}
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/f0f80f72f14d191bade9e1e542454d72f0d304a6/*"}}
@@ -217,11 +217,26 @@
</member>
<member name="T:StgSharp.Graphics.ElementBuffer">
<summary>
A collecion of handle to Element Buffer Object in OpenGL.
A collection of handle to Element Buffer Object in OpenGL.
Each <see langword="uint"/> value indexed from instance of this class this
is the only handle to one Element Buffer Object.
</summary>
</member>
<member name="M:StgSharp.Graphics.FrameBuffer.Bind(System.Int32)">
<summary>
Bind the frame buffer object with name frame buffer to the frame buffer target specified by target.
<see langword="FrameBufferTarget.All"/> will be set as default target.
</summary>
<param name="index">Index of object to be binded in handle set</param>
</member>
<member name="M:StgSharp.Graphics.FrameBuffer.Bind(StgSharp.Graphics.FrameBufferTarget,System.Int32)">
<summary>
Bind the frame buffer object with name frame buffer to the frame buffer target specified by target.
Target of this frame buffer should be set manually.
</summary>
<param name="target">The frame buffer target of the binding operation.</param>
<param name="index">Index of object to be binded in handle set</param>
</member>
<member name="M:StgSharp.Graphics.Texture.LoadTexture(System.Int32,System.String,StgSharp.Graphics.ImageLoader)">
<summary>
</summary>
@@ -285,6 +300,14 @@
This <see langword="glHandle"/> will be not usable.
</summary>
</member>
<member name="M:StgSharp.Graphics.GL.BindFrameBuffer(StgSharp.Graphics.FrameBufferTarget,StgSharp.Graphics.glHandle)">
<summary>
Bind a frame buffer to a frame buffer target
Same function as <see href="https://docs.gl/gl3/glBindFramebuffer">glBindFramebuffer</see>.
</summary>
<param name="target"> The frame buffer target of the binding operation.</param>
<param name="handle"> The handle of the frame buffer object to bind.</param>
</member>
<member name="M:StgSharp.Graphics.ShaderEdit.IglConvertable.SetAllUniforms">
<summary>
@@ -641,7 +664,7 @@
Create a new <see cref="T:StgSharp.TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
<param name="provider"></param>
</member>
<member name="M:StgSharp.TimeSpanProvider.#ctor(System.Double,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary>
@@ -649,14 +672,14 @@
Length of a single time span is defined in seconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
<param name="provider"></param>
</member>
<member name="M:StgSharp.TimeSpanProvider.#ctor(System.Int64,System.Int32,StgSharpDebug.Logic.TimeSourceProviderBase)">
<summary>
Create a new <see cref="T:StgSharp.TimeSpanProvider"/> and define the length of time span. Length of a single time span is defined in microseconds.
</summary>
<param name="spanLength"></param>
<parma name="provider"></parma>
<param name="provider"></param>
</member>
<member name="P:StgSharp.TimeSpanProvider.DefaultProvider">
<summary>