fixed view plane distance calculation to use tan() and convert degrees to radians

git-svn-id: svn://anubis/fart/trunk@41 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2009-01-23 16:44:39 +00:00
1 parent a1c81e5adc
commit 20eafaf9f4
3 files changed
+19 -5

No files matched your search

+2 -2
View File
@@ -54,7 +54,7 @@ Scene::Scene(map<string, const char *> options,
}
/* view plane distance is calculated based on the field of view */
m_view_plane_dist = (m_height / 2.0) / atan(m_vfov / 2.0);
m_view_plane_dist = (m_height / 2.0) / tan(M_PI * m_vfov / 360.0);
}
Scene::~Scene()
@@ -73,7 +73,7 @@ void Scene::load(const char * filename)
{
/* TODO: parse file somehow */
Shape * shape = new Sphere(1.0);
m_transform.translate(2.0, 2.0, 0.0);
m_transform.translate(2.0, 4.0, 1.0);
shape->setTransform(m_transform);
m_shapes.push_back(shape);
}