raycasting sprites

This is a discussion on raycasting sprites within the Game Programming forums, part of the General Programming Boards category; Anyone know how to display sprites in a raycasting engine? I am a bit stuck in figuring it out. I ...

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    2

    raycasting sprites

    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?

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. making sprites
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 02-20-2010, 06:00 AM
  2. DirectX and Sprites
    By andyhunter in forum Game Programming
    Replies: 6
    Last Post: 12-24-2004, 05:40 PM
  3. Raycasting code
    By BMJ in forum Game Programming
    Replies: 2
    Last Post: 09-07-2004, 03:26 PM
  4. I Found some nice sprites but need more...
    By BigCheese in forum C++ Programming
    Replies: 1
    Last Post: 03-23-2004, 05:03 PM
  5. Animating Multiple Sprites
    By Tommaso in forum Game Programming
    Replies: 2
    Last Post: 10-11-2002, 12:06 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21