Changed CMakeLists.txt to set the C standard to C11. Added multiple binary image files for new visual assets. Added several new image files to enhance rendering capabilities. Changed stb_image.h to improve support for various image formats. Changed ray tracing engine to enhance ray creation and intersection. Changed triangle structure to use a vertex array for better attribute handling. Changed scene initialization to accommodate new texture management.
17 lines
518 B
C
17 lines
518 B
C
#include "Rendering/Camera.h"
|
|
|
|
camera_t camera_create(vec3s position, versors rotation, float focal_length, float size_x, float aspect_ratio)
|
|
{
|
|
camera_t camera =
|
|
{
|
|
.position = position,
|
|
.rotation = rotation,
|
|
.focal_length = focal_length,
|
|
.size_x = size_x,
|
|
.size_y = size_x / aspect_ratio,
|
|
.fov_x = 2.0f * (float)atan(size_x / (2.0f * focal_length)),
|
|
.fov_y = 2.0f * (float)atan(size_x / (2.0f * focal_length * aspect_ratio)),
|
|
};
|
|
|
|
return camera;
|
|
} |