Going to need to get rid of the spherical camera

This commit is contained in:
2016-08-01 23:32:25 -07:00
parent c3be6e2240
commit d609ed695a
3 changed files with 18 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ Ray::Ray(
sf::Vector3<float> camera_position,
sf::Vector3<float> ray_direction) {
this->pixel = pixel;
this->map = map;
origin = camera_position;
direction = ray_direction;
@@ -46,6 +47,13 @@ sf::Color Ray::Cast() {
fabsf((float) (1.0 / cartesian.z))
);
//97, 25, 34 is an interesting example of the problems
// Ahhh, ya know what? This is a problem with how spherical coords
// work when approaching 0 on the chi axis as rotation about
// the theta axis is completely useless. A viewing frustum will
// be needed unfortunately
// Intersection T is the collection of the next intersection points
// for all 3 axis XYZ.
@@ -59,6 +67,11 @@ sf::Color Ray::Cast() {
delta_t.z + origin.z
);
if (pixel.x == 0){
int i = 0;
i++;
}
int dist = 0;
do {