Page 1 of 1

I know I'm gonna get flamed for this..

Posted: Thu Jul 02, 2009 9:57 pm
by Arya
This might be the noobiest question ever, but really, what is raycasting? Is there any tutorials about it, and how can I use it to make a simple FPS? Is there any functions I should know about raycasting? I read the CollisionDetection tutorial in the Irrlicht tutorials, and although I have very minor knowledge in that, I still really don't know what raycasting his. I heard, to be able to shoot in an FPS, you need this. Can someone explain this to me as best as they can? Thank you very much in advance, and I really hope I'm not acting too much of a noob. :oops:

Posted: Thu Jul 02, 2009 10:11 pm
by bitplane
Raycasting is just sending (casting) a line (ray) out of the camera and intersecting it with the scene, like in the collision example.

The only thing you'll be flamed for is not having a meaningful title ;)

Posted: Thu Jul 02, 2009 10:24 pm
by Manawenuz
I would add that you have to cast one ray per screen pixel. And each time, you test if the half-line defined by its origin (the camera position) and one of its point (the pixel screen you're testing) intersects something in the scene.
To have realistic light effects, you must add levels of recursion: if the half-line intersects something, you can continue the computation for the reflected ray...
So for real time rendering, it's not yet usable (unless you have a simple scene, with shapes like spheres, cylinders, planes for example. But see this, which should be amazing when it's released: http://www.openrt.de/

Posted: Thu Jul 02, 2009 10:35 pm
by Halifax
Manawenuz wrote:I would add that you have to cast one ray per screen pixel. And each time, you test if the half-line defined by its origin (the camera position) and one of its point (the pixel screen you're testing) intersects something in the scene.
To have realistic light effects, you must add levels of recursion: if the half-line intersects something, you can continue the computation for the reflected ray...
So for real time rendering, it's not yet usable (unless you have a simple scene, with shapes like spheres, cylinders, planes for example. But see this, which should be amazing when it's released: http://www.openrt.de/
You're talking about ray-tracing. He's talking about ray-casting for the sake of collision resolution. (Not the type of ray-casting that is defined by the first Wolfenstein etc.)

Posted: Fri Jul 03, 2009 10:12 am
by Manawenuz
OK Sorry for the misundestanding