Skip to content

Commit 9807683

Browse files
committed
Add 01-flat-triangle
1 parent f9e187f commit 9807683

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*.slo
66
*.lo
77
*.o
8-
*.obj
98

109
# Precompiled Headers
1110
*.gch
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 01-flat-triangle.obj
2+
# A single triangle with vertices defined in 3D space
3+
4+
# Define vertex positions
5+
v 0.0 0.5 0.0 # Vertex 1
6+
v -0.5 -0.5 0.0 # Vertex 2
7+
v 0.5 -0.5 0.0 # Vertex 3
8+
9+
# Define the face using the vertices
10+
f 1 2 3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#version 330 core
2+
3+
out vec4 FragColor;
4+
5+
void main()
6+
{
7+
FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#version 330 core
2+
3+
void main() {
4+
vec3 offsets[3] = vec3[](
5+
vec3(0.0f, 0.5f, 0.0f),
6+
vec3(-0.5f, -0.5f, 0.0f),
7+
vec3(0.5f, -0.5f, 0.0f)
8+
);
9+
gl_Position = vec4(offsets[gl_VertexID], 1.0f);
10+
}

0 commit comments

Comments
 (0)