There we go! The raycaster now has a camera that renders without distortion and can be pitched, yawed, and moved on the XYZ axis. I'm not sure now if I want to: Add lighting, improve performance, or start working on porting it to OpenCL

This commit is contained in:
2016-08-03 22:29:31 -07:00
parent 7829316625
commit 14987e3ba7
5 changed files with 46 additions and 21 deletions

View File

@@ -10,7 +10,7 @@ public:
list[i] = 0;
}
for (int i = 50; i < 52; i++) {
for (int i = 51; i < 52; i++) {
list[55 + dim.x * (55 + dim.z * i)] = 1;
}

View File

@@ -37,7 +37,7 @@ private:
sf::Vector3<float> camera_position;
// The distance in units the view plane is from the iris point
int view_plane_distance = 300;
int view_plane_distance = 200;
// Precalculated values for the view plane rays
sf::Vector3f *view_plane_vectors;