Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing a raycasting engine like the one used in DOOM, Wolfenstein 3D, etc.

My engine is capable of correctly displaying walls and textures on walls, but I'm stuck at sprites rendering.

Given that my engine is based on lines and angles only (just trigonometry), is there a way to render sprites without going for matrices? And if so, which technique should I use?

share|improve this question

In order for the correct parts of the sprite to be obscured by walls and other sprites, you need to create a plane in the rendering space upon which you can blit the sprite.

The plane itself should be the size of the interactable you want to draw, and its normal should be facing the camera, essentially a moving wall perpendicular to the view angle.

Once that is in place, you can just use the same techniques you've used to draw textures on walls.

share|improve this answer

There are two problems in using billboard sprites in these kind of engines.

First, determine the view, if there is more than one, that you should display given the orientation of both the object and the player.

Second, drawing the billboard itself.

Assuming that your sprite has only one image, you can choose to render it at the same time you render your level, by considering it as part of the general geometry of the level, represented by a quad, a movable wall as @William Totland has explained.

Another option would be to fill a z-buffer while you render and rendering the sprite against it.

All in all, it's very dependant on your rendering algorithm.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.