Page 1 of 1

Raycaster

Posted: Thu Nov 26, 2009 12:27 am
by wtetzner
So I wrote a raycaster a while back (in April I think) and rediscovered it while digging through my unfinished projects.
I intend to turn it into an actual game at some point, but for now all you can do is walk around.

It's written in C++, and uses SDL for drawing and input.
The main thing still missing from the rendering engine is the ability to draw sprites.

Anyway, I thought I'd make a YouTube video of the raycaster in action and show it off.

So, here it is:

http://www.youtube.com/watch?v=LYci8S1Mdsc

Oh, and since the video isn't the best quality, here's a screenshot:
Image

Re: Raycaster

Posted: Thu Nov 26, 2009 1:57 am
by jaymonster138
thats really tight. What exactly is a "Raycaster"?

Re: Raycaster

Posted: Thu Nov 26, 2009 9:57 am
by dandymcgee
jaymonster138 wrote: What exactly is a "Raycaster"?
You stole the words out of my mouth.

Edit: I think he was demonstrating hidden surface removal, but since the surfaces were hidden to begin with you see no visual differences, only performance gain.

Re: Raycaster

Posted: Thu Nov 26, 2009 11:56 am
by andrew
jaymonster138 wrote:What exactly is a "Raycaster"?
Ray Casting

Games that used it: Doom, Wolfenstein 3D, lots of others too.

Example of a very small ray caster in C with Allegro.

Re: Raycaster

Posted: Thu Nov 26, 2009 12:12 pm
by jaymonster138
So does the program recognize which way you are looking and decides to build where your looking? or am I way off? Whats the point of tracing the rays?

Re: Raycaster

Posted: Thu Nov 26, 2009 4:34 pm
by andrew
Here you go:
'Doom' 3D Engine techniques. This explains it briefly.

This one is mentioned in the other link as having a much more detailed explanation of raycasters.
acksrc.zip

Re: Raycaster

Posted: Thu Nov 26, 2009 9:00 pm
by Falco Girgis
Note that he's using SDL for drawing. That's pretty damn badass. Very impressive, sir.

Re: Raycaster

Posted: Thu Nov 26, 2009 9:26 pm
by dandymcgee
GyroVorbis wrote:Note that he's using SDL for drawing. That's pretty damn badass. Very impressive, sir.
Wtf.. how? Looks like OGL.

Re: Raycaster

Posted: Fri Nov 27, 2009 1:18 am
by XianForce
So basically it takes a 2D map, and like... makes it appear 3D?

Re: Raycaster

Posted: Fri Nov 27, 2009 1:02 pm
by andrew
XianForce wrote:So basically it takes a 2D map, and like... makes it appear 3D?
Exactly.
Just like this.

Re: Raycaster

Posted: Fri Nov 27, 2009 2:35 pm
by RyanPridgeon
Maybe you guys should stop commenting like this if you don't know what it is. He's not using OpenGL or any pre-set 3d calculation, he's made a raycaster which draws the screen by the pixels, using "rays" to work out the size and texture splicing of the walls that the player can see. There's a good tutorial on it on Gamedev.net.

And yeah this is awesome, you should totally go for a full-on Doom style FPS game with this.

Re: Raycaster

Posted: Fri Nov 27, 2009 10:04 pm
by Falco Girgis
Gentlemen, don't you remember playing Doom 95 and Wolfenstein 3D on Windows 3.1 and Windows 95 before dedicated 3D cards were even invented?

Ever wondered how in the fuck Doom was ported to the Super Nintendo? Wonder no more.