Skip to content

slight fisheye effect #7

Description

@rsarson

a slight fisheye effect is seen because line 30 of maze.c is

dir.y = -0.66;

instead of

dir.y = 0;

edit:
see https://lodev.org/cgtutor/raycasting.html, ie, "Make sure the camera plane is perpendicular to the direction, but you can change the length of it. The ratio between the length of the direction and the camera plane determinates the FOV, here the direction vector is a bit longer than the camera plane, so the FOV will be smaller than 90°"

in other words, if you change the initial direction (dir.x & dir.y), be sure to also change the initial camera plane (plane.x & plane.y) to be perpendicular to it

edit 2:
the above also reveals another small bug in input.c:
the line after /* rotate left */ should be if (keystate[SDL_SCANCODE_A])
the line after /* rotate right */ should be if (keystate[SDL_SCANCODE_D])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions