versuch quad szene zu machen zeigt dass meine kollisions erkennung nicht klappt. ich habe versucht eine neue fuer quadrate zu inplementieren, aber ich sehe nur einen weissen streifen
This commit is contained in:
+34
@@ -8,6 +8,7 @@
|
||||
#include "raytrace.h"
|
||||
#include <stdlib.h>
|
||||
#include "interface.h"
|
||||
#include "helper.h"
|
||||
|
||||
void example_color(int width, int height, int channels, unsigned char **image) {
|
||||
for (int i = 0; i < height * width; i++) {
|
||||
@@ -57,6 +58,39 @@ void exampleSphere( int width, int height, int channels, unsigned char **image)
|
||||
|
||||
|
||||
|
||||
displaySzene(objectList, objectCount, cam1, width, height, channels, image);
|
||||
|
||||
}
|
||||
|
||||
void exampleCornell( int width, int height, int channels, unsigned char **image) {
|
||||
camera cam1;
|
||||
cam1.origin.x = 0;
|
||||
cam1.origin.y = 0;
|
||||
cam1.origin.z = 0;
|
||||
cam1.direction.x = 0;
|
||||
cam1.direction.y = 0;
|
||||
cam1.direction.z = 1;
|
||||
cam1.resolutionX = width;
|
||||
cam1.resolutionY = height;
|
||||
cam1.screenDistance = 1;
|
||||
cam1.width = 1.920;
|
||||
cam1.height = 1.080;
|
||||
int objectCount = 7;
|
||||
object objectList[objectCount];
|
||||
|
||||
cube makroObj1 = createCuboid((vec3){0.5,-0.5,5}, (vec3){1,0,0}, (vec3){0,1,0}, (vec3){0,0,1},(RGBA){1,0,0.5,1});
|
||||
objectList[0] = (object){1, &(makroObj1.quad1), 0};
|
||||
objectList[1] = (object){1, &(makroObj1.quad2), 0};
|
||||
objectList[2] = (object){1, &(makroObj1.quad3), 0};
|
||||
objectList[3] = (object){1, &(makroObj1.quad4), 0};
|
||||
objectList[4] = (object){1, &(makroObj1.quad5), 0};
|
||||
objectList[5] = (object){1, &(makroObj1.quad6), 0};
|
||||
|
||||
quad light1 = (quad){(vec3){0,1,5}, (vec3){0,0,1}, (vec3){0,1,0}, (vec3){0,-1,0}, (RGBA){1,1,1,1}};
|
||||
objectList[6] = (object){1, &(light1), 1};
|
||||
|
||||
|
||||
|
||||
displaySzene(objectList, objectCount, cam1, width, height, channels, image);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user