raycasting sprites [Archive] - C Board

PDA

View Full Version : raycasting sprites


lmaster
12-21-2003, 08:29 PM
Anyone know how to display sprites in a raycasting engine? I am a bit stuck in figuring it out.

I have the distance of each column from the player How would i correctly position the sprite so it scales and looks correct in the world?

Bubba
12-22-2003, 12:34 AM
You must keep track of when you hit a cell that has a sprite in it. When you hit this cell, save the screen coords and distance. Then when you leave the cell, save the screen coords.

When you go through your buffer - start your sprite drawing at the saved screen coords and make the sprite spriteheight/distance pixels tall.