Jump to content
  • Advertisement
Sign in to follow this  

Raycasting

This topic is 4741 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a problem implementing a tutorial (permadi) which I am sure most of you have read. If I start the player off at say 90* facing north. Before I subtract the 30* degrees for doing the ray sweep (60* field of view) I would subtract SCREEN_WIDTH/FOV * 30 correct? And this will be the first angle casted? Then all I basically need to do is: //until ray hits a wall ray_x += vector * cos(angle * M_PI/180); ray_y += vector * sin(angle * M_PI/180); //increment ray by SCREEN_WIDTH/FOV? If this is correct I have another question. I have seen some tutorials which use lookup tables with predefined angles (integers) Can somsone please explain this technique to me? I'm trying to get a simple non-textured raycaster done but i'm stuck on the raycsating step. I get horrible results when I run the program.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!