I'm very new to the Raycasting algorithim, and was reading a webpage on how it works with CPP code to accompany. I followed what the page described and converted it into Python/Pygame and then ran it, but my result was very different. I have a feeling it has something to do with

try: 
    deltaDistX = sqrt(1 + (rayDirY * rayDirY) / (rayDirX * rayDirX));
    deltaDistY = sqrt(1 + (rayDirX * rayDirX) / (rayDirY * rayDirY)); 

except ZeroDivisionError: 
    pass 

Here is the code I wrote: http://pastebin.com/nLW6ELvv
And here is the webpage on Raycasting: http://lodev.org/cgtutor/raycasting.html
Help is appreciated <3

I'm thinking about the question,if i have any idea,i will told you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.