Qbasicnews.com

Full Version: blocking sprites in 3d
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do you block sprites with other sprites/walls, etc in raycasting?
Its called collision detection and its done by checking if any of the outer limits of the sprite touch touch any other limits of a wall or sprite. For the player this can be done by checking the current coordinates and checking the movement before actaully moving(e.g. checking after the keypress but before actually changing coordinates).

You can check an example at http://faq.qbasicnews.com/?blast=BallToBallCollision

EDIT:

For more specific help check out Joe King's raycasting tutorials at http://users.sisna.com/joeking4/deltacod...rials1.htm.
Quote:Its called collision detection and its done by checking if any of the outer limits of the sprite touch touch any other limits of a wall or sprite. For the player this can be done by checking the current coordinates and checking the movement before actaully moving(e.g. checking after the keypress but before actually changing coordinates).

You can check an example at http://faq.qbasicnews.com/?blast=BallToBallCollision

EDIT:

For more specific help check out Joe King's raycasting tutorials at http://users.sisna.com/joeking4/deltacod...rials1.htm.
actualy, what I ment was, how do you not draw certain strips of sprites if they are behind walls? also, I have noticed that in wolf3d, the guy moves very smoothly, and in my raycasters (and other games) there is alot of jerkyness. How do you get rid of that?

Oh. Thanks for the link. The ray tuts are awsome!!
Sorry I misunderstood your question. There are a few ways of doing that but I've not actually tried them in a raycaster. The simplest would be drawing the sprites/walls from the furtherest away to the nearest and the nearest would simply overwrite/overdraw objects in the way. If you don't see an answer in the raycaster tutorial let me know and I'll see if I can find an example.
The link to the raycasting tuts helped VERY MUCH!!!I emailed him and he gave me an answer for it. Thanks. Big Grin