Wolf3D raycast Fisheye bug
Hi there. I have just made a untextured Wolf3D Engine.
First i want to say that i already know whats wrong but i need to know how to do correct it.
I have the players position saved in ''PlayerDirection''
I have a constant Field Of Vision on 90 degrees.
My app roams through the different angles and find the distance so the current vertical line can be drawed correctly with the correct lenth and colour. Works almost fine. You maby allready have guessed that i use a sin cos calculation to loop all the way untill it hits a wall right? And then you maby know this gives me a fisheye effect...
I want this to be corrected but - how?
I need the rays to be cast at the same "speed" if you understand what i mean. The outer rays have to travel with a bigger speed than the one in the middle. How do i calculate that?
If I remember correctly, you need to add to the distance of the ray from the eye to the wall by the cosine of the angle from the center of the screen to the column being drawn.
Now say that 3 times really fast
Now say that 3 times really fast
Hi! Here comes some ASCII art
Instead of using the length of d to determine the wall height
you should use the length of e. And it shouldn't be difficult to calculate since you know the length of d and the a angle.
[edited by - Jim Adams on December 6, 2002 1:01:38 PM]
______________ | | | | | | | | | | _______________ /| d / | / | e /a | * viewpoint
Instead of using the length of d to determine the wall height
you should use the length of e. And it shouldn't be difficult to calculate since you know the length of d and the a angle.
[edited by - Jim Adams on December 6, 2002 1:01:38 PM]
You ASCII works fine here...
Sorry but I ain''t that good at SIN and COS. How can i find e from your ASCII art if i have the angle and d?
Sorry but I ain''t that good at SIN and COS. How can i find e from your ASCII art if i have the angle and d?
I''m sure you mean cos( a ) * d
This works fine but gives the walls a strange curved look... what can be wrong???
This works fine but gives the walls a strange curved look... what can be wrong???
It should be sin(a). Here is a better image, it could make things clearer : "http://www.extra.hu/jocof1/pic1.bmp"
You could send a screenshot, maybe it would help.
You could send a screenshot, maybe it would help.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement