Doom Floors

Started by
22 comments, last by Neoteric 21 years, 2 months ago
I''ve searched everywhere for a fast (any) alogrithm to render floors and celings in my raycasting engine, without success, can anyone help?
Advertisement
How exactly, are you doing it?
The usual way I guess, the floor is ray-casted and the walls drawn on top, whatever I do I can't the floor movement to fit the wall movement. The FOV is correct, the scaling constant, view height, everything seems right but it just doesn't quite work.

I thought I would give somebody else's algoritms a go because I'm about to ditch mine.

[edited by - Neoteric on January 25, 2003 11:33:37 AM]

Before you draw the walls, paint the lower half of the screen your floor color, and the upper part your roof color. That''s what wolfenstein 3d did, and just about every other raycaster I''ve seen does.

But, you say, Doom has better floors that that!

Yeah, because Doom didn''t use raycasting. I''m not sure why there''s this persistent rumor that it did.
Ray casting was used to draw the textures onto the polygons after they came out of the tree, I assume floors were done similarly.

I think the problem is how I'm handling the fisheye on the ceiling, it seems to distort slightly at the far edges, Just need to figure out exactly what needs fixing. The math seems to work in my head and on paper, but not in practice. It's something obvious though.

(I apologise for the un-optimised speed, example moved to next post)




[edited by - Neoteric on January 29, 2003 11:55:17 AM]
...the problem is better illustrated when the floor moves...

select the applet and use W,S,A and D to move.

[Edited by - Neoteric on July 1, 2004 9:53:25 AM]
quote:
Ray casting was used to draw the textures onto the polygons
after they came out of the tree, I assume floors were done similarly.


I don''t think so, the walls were drawn using a column based rasterizer (similar to the final process of ray-casting in 2.5d worlds but not quite). The floors and ceilings were scanline rasterized, making use of the constant-z scanlines coz all the floors were flat.
quote:Original post by JuNC
I don't think so, the walls were drawn using a column based rasterizer (similar to the final process of ray-casting in 2.5d worlds but not quite). The floors and ceilings were scanline rasterized, making use of the constant-z scanlines coz all the floors were flat.


I stand corrected.

I was thinking of the beginning of the process, my floors work similarly, I think, but then again i've used sources from all over the place to put that togeather. .

The problem is the field of view is too large on the floor, it should be right, but I'm forgetting something.



[edited by - Neoteric on January 29, 2003 3:56:54 PM]
>...the problem is better illustrated when the floor moves...
the x of the walls have fisheye disortion
quote:Original post by Anonymous Poster
>...the problem is better illustrated when the floor moves...
the x of the walls have fisheye disortion


Wouldn't that make the walls bend when looking straight on? You're right though, they seem to compress around the screen edges. The column scale is worked out like this, with fisheye correction. Am I missing something?

ray_len = (ray_len/120) * Math.cos(ray_angle);




[edited by - Neoteric on January 30, 2003 3:04:59 PM]

This topic is closed to new replies.

Advertisement