![]() |
|
Raycasting - Doors |
Roman Tech.
Member #600
August 2000
![]() |
After examining how Wolf3d uses doors, I would like to add some doors to my raycasting engine but I'm having some problems with the rendering and animation of the doors.. The doors in Wolf3d are set back into the walls slightly, and I haven't been able to figure correctly set the block back and not have it distorted. The doors seem to be integrated with the walls, not separately like they are drawn as objects but I also am having a hard time getting the correct sliding effect without distortion or smooth movement.. Anyone have advice on how to do any of these things? I know that the Wolf3d source code is released and I have taken a look at it but it's a lot to digest and the optimizations in that code also make it difficult to correctly understand. I can put up code of how I handle drawing walls and what I try to do with the setting back of doors if necessary. |
nonnus29
Member #2,606
August 2002
![]() |
I haven't done this but i was thinking a quick n easy way to do it would be to merely treat each door as a sprite. Although it would differ from the typical wolf3d sprite by being a non billboard. Just my .02 Edit: now that I think about it; it could still be a billboard couldn't it? Since you have to approach the door straight on to open it... |
Thomas Harte
Member #33
April 2000
![]() |
Just treat it as a wall, but in a separate tilemap, which is slightly offset from the normal tilemap. When you open it, move its tilemap relative to the player. [My site] [Tetrominoes] |
David Layne
Member #2,053
March 2002
|
I recently did just this while making my Wormenstein engine. You can see the results if you do a search for old posts in the depo forum. Basically, my approach was pretty much the following: While scanning the grid, if you encounter a door: To make doors that can open, just ignore collisions if the x/y values of the collision are outside the boundaries. Also remember to peg textures so that they move with the door. |
Carrus85
Member #2,633
August 2002
![]() |
Wait, are you refering to the actual door-doors, or the walls that move into the background secret doors?
|
Roman Tech.
Member #600
August 2000
![]() |
Yeah, I'm not really refering to secret doors, but that would be cool to do.. I got it to work with by moving of the tilemap it works nice, so far to draw the door so I can see the floor/ceiling textures and the block behind the door I have to draw the screen twice but I'm working on it right now to see if there's a faster way.. |
|