Ray Casting #2
Finally got around to adding those few lines of code to add textured walls to the ray caster.
A few details:
1) The texture isn’t mine, I merely found it via Google Images with the term “wall texture” and it has the filename “Wall_Texture_by_shadowh3.JPG”
2) There’s still a problem with the corners of the grids having a weird fringe. It’s better than it was, but still not right. Haven’t tracked that down yet, but have some ideas
3) The somewhat hybrid mix (Courtesy of XNA) of performing the ray casting algorithm and then using the hardware to render (i.e. the column strips as Lines, plus using the hardware to render the correct strip of texture, which is all nice and filtered) is arguably making using the ray caster seem futile. Depends on how you look at that one I suppose. I think it’s neat
4) A bit of “FYI”. John Carmack’s article on how he wrote the iPhone version of Wolfenstein 3D is what really got me wanting to do this. Many thanks to him for the unrelenting inspiration!
.png)
.png)
Hey Terry, seems you spend a lot of time with your projects, anyway I suggest you to publish the source code.
by the way, I also have been working on a tiny raycast engine you can check it out here: http://wolf3dx.codeplex.com
The full source code is available.
Hi Hugo,
Sorry for the late response!
Great project, my friend! I’m going to go out on a limb here and say you’ve gone far beyond my amateur experimentations! That looks fantastic
I want to start posting up some source, but none of it is robust enough right now and I’d hate to give false information to anybody.
I’ll probably start with posting source code clips in posts that I can make sure are robust enough to be informative.
My ray caster in XNA merely did a standard ray cast (I actually copied verbatim my entire function from a C# GDI project version) and then rendered simple lines to the screen for the columns with the appropriate colour (or appropriate texture slice).
Nothing too impressive at the moment I’m afraid. The ray casting algorithm itself is very much mundane also.
Best regards,
Terry