~zjm/Moon3D

ref: 0fe31db4998f636b8f65ca790b75c0585ba47d86 Moon3D/src/3d/image/camera.h -rw-r--r-- 421 bytes
0fe31db4Zack Michener refactor camera/projection to avoid globals 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include "../abstract.h"

typedef struct Camera {
	Vector position;
	Vector direction;
	Vector up;
	Transform transform;
} Camera;

Camera *NewCamera(Vector position);
void LookAt(Vector p, Camera *camera);
void RotateCamera(double rx, double ry, double rz, Camera *camera);
void MoveCamera(Vector dv, Camera *camera);
Transform AlignCameraToAxis(Camera *camera);
Transform CameraTransform(Camera *camera);