free camera
This commit is contained in:
parent
7d830d13d1
commit
d6ba8e354c
2 changed files with 37 additions and 12 deletions
|
@ -117,12 +117,19 @@ pub fn main() anyerror!void {
|
|||
Sphere{ .center = Point3{ .x = 0, .y = -100.5, .z = -1 }, .radius = 100, .material = materialGround },
|
||||
Sphere{ .center = Point3{ .x = 0, .y = 0, .z = -1 }, .radius = 0.5, .material = materialCenter },
|
||||
Sphere{ .center = Point3{ .x = -1, .y = 0, .z = -1 }, .radius = 0.5, .material = materialLeft },
|
||||
Sphere{ .center = Point3{ .x = -1, .y = 0, .z = -1 }, .radius = -0.45, .material = materialLeft },
|
||||
Sphere{ .center = Point3{ .x = 1, .y = 0, .z = -1 }, .radius = 0.5, .material = materialRight },
|
||||
};
|
||||
const world = World{ .spheres = spheres[0..spheres.len] };
|
||||
|
||||
// Camera
|
||||
const camera = Camera.init();
|
||||
const camera = Camera.init(
|
||||
Point3{ .x = -2, .y = 2, .z = 1 },
|
||||
Point3{ .x = 0, .y = 0, .z = -1 },
|
||||
Vec3{ .x = 0, .y = 1, .z = 0 },
|
||||
20.0,
|
||||
aspectRatio
|
||||
);
|
||||
|
||||
const window = sdl.c.SDL_CreateWindow(
|
||||
"Raytracing in One Weekend",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue