Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Perspective Texture Mapping & Raycasting

This thread is locked; no one can reply to it. rss feed Print
Perspective Texture Mapping & Raycasting
Bram Bouwmans
Member #772
November 2000

Hi,
I was trying to make a simple Mariokart clone and while searching for documentation i found out that it has something to do with perspective texture mapping (which seems to be used in raycasting).
The idea is to have a 2D bitmap of the racingfield and then project that in "3D", so it looks as if you're racing in 3D.
I have been searching for tutorials but haven't found really good ones. If someone could point me to a good tutorial or explain it to me, i would be thanksful.
THanks in advance,
Bram

axilmar
Member #1,204
April 2001

raycasting = simulating light rays in a 3d environment(reflections, shadows, etc)
perspective correction = without it, textures look broken up close (see any playstation game for examples)
quote:
The idea is to have a 2D bitmap of the racingfield and then project that in "3D"

you dont mean you need raycasting, do you ? All you need is simple texture mapping. Raycasting needs much more processing power, because light is reflected from a surface to another surface, creating all sorts of shadows and fx.

Bram Bouwmans
Member #772
November 2000

Well... aren't you talking about raytracing instead of raycasting?
So, i would need simple texturemapping? All the articles i could find that looked liked Mariokart were talking about raycasting and texturemapping. Mariokart does looks like a raycaster (wolfenstein), but with a textured floor and without walls and ceiling .
Any ideas?

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

Well... aren't you talking about raytracing instead of raycasting?

I think he is ;) There's a good article on doing exactly this in Pixelate issue 5 (Sin and Cos: the Programmer's Pals!), but the site seems to be down.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

lambik
Member #899
January 2001
avatar

MarioKart uses "mode 7"
Amarilion wrote an article about it in one of the Pixelates. I cannot check it for you right now because the Pixelate site seems to be down. If memory serves me right it was called 'sin and cos'
(edit) heh, 23 beat me to it. I didn't know that phonecall lasted that long :-)
[ January 25, 2002: Message edited by: lambik ]

axilmar
Member #1,204
April 2001

Sorry my mistake(English is not my native language). Here is a tutorial about raycasting.

You can use the current Allegro 3d and texture mapping routines for your game though. It would be much quicker than making a raycasting engine.

[ January 25, 2002: Message edited by: achil ]

Bram Bouwmans
Member #772
November 2000

Achil
Hmm, using Allegro's functions sounds good too. It's just that i have extremely little knowledge on the entire 3d-thingy and i would like to read a bit more about it.
I'm kinda confused about a lot of things, therefore i requested the articles .
I just tried to find some of the Allegro functions, but i have no idea on which to use. I think i'd better read a bit more first .

23yrold3yrold
Member #1,134
March 2001
avatar

s333654: Pixelate seems to be back up; the tutorial you wanna read (which even mentions SNES Mode 7; lucky you) isright here.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Zaphos
Member #1,468
August 2001

IIRC raycasting is NOT mode 7, and you want mode 7, not raycasting. Look at the tutorial 23 posted.

Bram Bouwmans
Member #772
November 2000

Hi,

The article in Pixelate seems pretty good, i'm currently reading it. Raycasting is not Mode 7, Mode 7 is just a name given to a specific screenmode or trick in the SNES. The article does refer to Mode 7 as being the "trick" to do the psuedo-3D, but it's not more than a given name.

Thanks everyone, i think that with that article i might get on the right track.

Go to: