Cleanup graphics assignment 6: ray tracing 1

parent 665c5c0d
PROG=Opgave6_Kroes_VanVeen
MKDIR=mkdir
PACK=tar -czvf
CC=gcc
CP=cp
RM=rm -rf
WARNING_FLAGS=-Wall -Wextra -Werror-implicit-function-declaration -Wshadow -Wstrict-prototypes -pedantic-errors
CFLAGS=-g -O2 -std=c99 $(WARNING_FLAGS)
......@@ -12,9 +18,18 @@ main: intersection.o main.o plymodel.o rply.o scene.o shaders.o v3math.o
$(CC) $(LDFLAGS) -o main intersection.o main.o plymodel.o rply.o scene.o shaders.o v3math.o
clean:
rm -f $(PROG).tar.gz
rm -f *.o
rm -f main
tarball:
$(MAKE) clean
$(MKDIR) $(PROG)
$(CP) * $(PROG) 2> /dev/null || true
$(RM) $(PROG)/*.pdf
$(PACK) $(PROG).tar.gz $(PROG)/* ../scenes
$(RM) $(PROG)
shaders.o : constants.h intersection.h scene.h shaders.h v3math.h shaders.c
scene.o : plymodel.h scene.h scene.c
intersection.o : types.h intersection.h
......
......@@ -189,8 +189,8 @@ ray_trace(void)
// Find midpoint and point 0,0
vec3 p = v3_subtract(
v3_add(v3_add(origin, forward_vector),
v3_multiply(up_vector, 0.5 * (image_plane_height - 0.5 * scale))),
v3_multiply(right_vector, 0.5 * (image_plane_width - 0.5 * scale))
v3_multiply(up_vector, .5 * (image_plane_height - .5 * scale))),
v3_multiply(right_vector, .5 * (image_plane_width - .5 * scale))
);
// Loop over all pixels in the framebuffer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment