Hi all! I’ve been reading this BB for a while and this is my first post
I’m a CS student and I’m quite new at game development, though I have good Java skills.
After working on some 2D games I decided to try to implement a Wolfenstein 3D-like game engine from scratch (I know it’s not a novel idea :P).
My current engine is capable of correctly displaying walls and textures, but I’m stuck at sprites rendering.
My engine does not use matrices, just some geometry and trigonometry; but I’m missing the technique needed to get sprites on screen.
It’s quite easy to determine if a sprite is currently visible on the screen, but I definitely don’t know how to determine the portion of the sprite image that has to be drawn.
In the following picture, if the red dot is the viewer (with its field of view) and the blue dot is a sprite, how can I render it on screen? How can I determine the on-screen x coord of the sprite?
https://dl.dropbox.com/u/43271824/rc.png
Thanks a lot (I hope my english is not that bad ;))