aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--42.gifbin0 -> 1014386 bytes
-rw-r--r--README.md10
-rw-r--r--shader/vertex.glsl3
-rw-r--r--src/main.c17
-rw-r--r--src/texture.c2
-rw-r--r--teapot.gifbin0 -> 949857 bytes
6 files changed, 14 insertions, 18 deletions
diff --git a/42.gif b/42.gif
new file mode 100644
index 0000000..53c73b1
--- /dev/null
+++ b/42.gif
Binary files differ
diff --git a/README.md b/README.md
index 8ec5d26..20ab958 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,13 @@
# scop
scop project of school 42
+
+![42](./42.gif)
+![teapot](./teapot.gif)
+
+# Control
+
+- ESC : exit
+- t : switch between color and texture
+- mouse wheel : zoom in and out
+- p : cycle through polygon modes (fill, line, point)
diff --git a/shader/vertex.glsl b/shader/vertex.glsl
index e61ec34..6f73689 100644
--- a/shader/vertex.glsl
+++ b/shader/vertex.glsl
@@ -15,5 +15,6 @@ void main()
{
gl_Position = u_proj * u_view * u_model * in_position;
v_color = in_color;
- v_texture_coord = in_texture_coord;
+ /* v_texture_coord = in_texture_coord; */
+ v_texture_coord = vec2(in_position.y, in_position.z);
}
diff --git a/src/main.c b/src/main.c
index 3820cd5..6f4460a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/05/09 10:20:09 by charles #+# #+# */
-/* Updated: 2020/05/14 16:48:35 by charles ### ########.fr */
+/* Updated: 2020/05/14 19:10:40 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,23 +17,8 @@
** - texture
** - parse vt
** - parse coord index of f
-** - transition color/texture
-** - cleaner code
*/
-void debugmat(t_ftmmat4 *mat)
-{
- for (int i = 0; i < 4; i++)
- {
- for (int j = 0; j < 4; j++)
- {
- printf("%.2f, ", mat->m[i * 4 + j]);
- }
- printf("\n");
- }
- printf("\n");
-}
-
int main(int argc, char **argv)
{
t_state state;
diff --git a/src/texture.c b/src/texture.c
index 057db5f..733453d 100644
--- a/src/texture.c
+++ b/src/texture.c
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/05/11 14:27:34 by charles #+# #+# */
-/* Updated: 2020/05/14 18:41:44 by charles ### ########.fr */
+/* Updated: 2020/05/14 19:22:20 by charles ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/teapot.gif b/teapot.gif
new file mode 100644
index 0000000..f5fd327
--- /dev/null
+++ b/teapot.gif
Binary files differ