raycasting engine -- how to do floor casting?
hello,
i am working on an ai and decided that raycasting would be a
nice way for visualising the environment.
so i wrote a classic raycaster like wolfenstein 3d with
help of this tutorial (http://www.gamedev.net/reference/articles/article872.asp)
but when it comes to floor casting it's awfully slow. too slow.
so no i've just been reading a tutorial on this forum
(http://www.gamedev.net/reference/articles/article872.asp)
about section based raycasting.
but it seems the autor never wrote the second part where
it comes to floor casting. and also section based casting
like there doesn't fit in my project because the ai is able
to change the envionment (building thinks digging and stuff like that)
that's why classical block based raycasting like in wolfenstein 3d fits better.
well, the point is, i just can't find a usefull tut or something
about FAST floor casting like it's done in games like doom and duke nukem 3d.
thanks
Permadi has some information about floors and ceilings that may be useful. It may not give you all of the answers, but may give you a prod in the right direction.
hey,
thanks but i'm allready doing it nearly like this.
its just the problem that when the walls are far away
on 800x600 pixels screen resolution the code nearly calculates
480.000 pixels for floor and ceiling.
which results in 40 frames per MINUTE.
thanks but i'm allready doing it nearly like this.
its just the problem that when the walls are far away
on 800x600 pixels screen resolution the code nearly calculates
480.000 pixels for floor and ceiling.
which results in 40 frames per MINUTE.
I guess you have performance problems because of the division by z each pixel.
An age-old tutorial is in the PCGPE. Check out the article on Free Direction Texture Mapping. Basically, you would render the floor by rasterizing horizontal scanlines, where the z stays the same for the whole scan line, so you can precompute the division by z.
An age-old tutorial is in the PCGPE. Check out the article on Free Direction Texture Mapping. Basically, you would render the floor by rasterizing horizontal scanlines, where the z stays the same for the whole scan line, so you can precompute the division by z.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement