diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-16 21:31:59 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-16 21:31:59 +0000 |
commit | cf3d6906df7ffb4efa5398832e44ab31fe3b2721 (patch) | |
tree | 0ed55ed0a315a27ccb42d3953ceaa9b02a868abd /libdimension | |
parent | bbe317fb2bde1b2b88df66e5426c9ee78e40a0b6 (diff) | |
download | dimension-cf3d6906df7ffb4efa5398832e44ab31fe3b2721.tar.xz |
Don't take a transformation matrix in dmnsn_new_perspective_camera().
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/cameras.c | 8 | ||||
-rw-r--r-- | libdimension/dimension/cameras.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libdimension/cameras.c b/libdimension/cameras.c index 9e0642f..54c7e7f 100644 --- a/libdimension/cameras.c +++ b/libdimension/cameras.c @@ -30,9 +30,9 @@ static dmnsn_line dmnsn_perspective_camera_ray_fn(const dmnsn_camera *camera, /* Create a new perspective camera. Rays are aimed from the origin to a screen located on the z = 1 frame, from (-0.5, -0.5) to (0.5, 0.5). Rays are then - transformed by the matrix `trans'. */ + transformed by the camera's transformation matrix. */ dmnsn_camera * -dmnsn_new_perspective_camera(dmnsn_matrix trans) +dmnsn_new_perspective_camera() { dmnsn_matrix *ptr; dmnsn_camera *camera = dmnsn_new_camera(); @@ -43,11 +43,11 @@ dmnsn_new_perspective_camera(dmnsn_matrix trans) dmnsn_delete_camera(camera); return NULL; } - *ptr = trans; - camera->ptr = ptr; + *ptr = dmnsn_identity_matrix(); camera->ray_fn = &dmnsn_perspective_camera_ray_fn; camera->free_fn = &free; + camera->ptr = ptr; } return camera; } diff --git a/libdimension/dimension/cameras.h b/libdimension/dimension/cameras.h index b135693..cc7ad4c 100644 --- a/libdimension/dimension/cameras.h +++ b/libdimension/dimension/cameras.h @@ -27,8 +27,8 @@ /* A perspective camera, at the origin, looking at (0, 0, 1). The feild of view is the section of the plane z = 1 from (-0.5, -0.5) to (0.5, 0.5). Rays are - transformed by the transformation matrix `trans'. */ -dmnsn_camera *dmnsn_new_perspective_camera(dmnsn_matrix trans); + transformed by the camera's transformation matrix. */ +dmnsn_camera *dmnsn_new_perspective_camera(); /* Get or set the transformation matrix */ dmnsn_matrix dmnsn_get_perspective_camera_trans(const dmnsn_camera *camera); |