papercraft/camera.h

38 lines
497 B
C
Raw Normal View History

2017-09-27 03:37:22 +02:00
#pragma once
#include "v3.h"
typedef struct _camera_t camera_t;
extern camera_t *
camera_new(
2017-09-27 04:59:09 +02:00
v3_t eye,
2018-02-27 14:21:49 +01:00
v3_t lookat,
2018-02-27 19:13:58 +01:00
v3_t up,
float fov,
float scale
2017-09-27 03:37:22 +02:00
);
extern void
camera_setup(
camera_t * const c,
2017-09-27 04:59:09 +02:00
v3_t eye,
2018-02-27 14:21:49 +01:00
v3_t lookat,
2018-02-27 19:13:58 +01:00
v3_t up,
float fov,
float scale
2017-09-27 03:37:22 +02:00
);
/** Transform a XYZ point into a screen point.
*
* Returns 0 if this is behind us. Perhaps it should do a z buffer?
*/
extern int
camera_project(
const camera_t * const c,
const v3_t * const v,
v3_t * const v_out
);