Working Raycasting example! WolfenLöve 3D if you will...

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
IndieKid
Citizen
Posts: 80
Joined: Sat Dec 22, 2012 7:05 pm
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by IndieKid » Sun Dec 23, 2012 11:40 am

Jasoco wrote:My project is currently not in progress. You should probably ask the other guy currently doing Raycasting.

viewtopic.php?f=5&t=12069

I'm currently tied up with 3D polygons.

Short answer, if you've coded it correctly, and I assume you have if you have successfully replicated the numerous demos availble on the internet, you divide each wall tile into quads, figure out where along the wall the ray is hitting, (The value will be between 0 and 1 as a decimal value. Simply multiply that by the tile width you use and floor it to get your quad number) and display that quad.

Go to that link above. That is where most active discussion will be taking place until I decide to take up this project again.
Thanks a lot ^^

Sarius
Prole
Posts: 2
Joined: Tue Jan 08, 2019 7:02 pm

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Sarius » Tue Feb 26, 2019 7:43 am

It would mean tons if you could just comment the code, what you have done, so that people can understand it easier. I'm trying to write my own first raycaster engine, and i'm taking a look at others code just to see different ways of doing it. Maybe you could comment it?

User avatar
Jeeper
Party member
Posts: 542
Joined: Tue Mar 12, 2013 7:11 pm

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Jeeper » Sat Mar 09, 2019 11:07 pm

Sarius wrote:
Tue Feb 26, 2019 7:43 am
It would mean tons if you could just comment the code, what you have done, so that people can understand it easier. I'm trying to write my own first raycaster engine, and i'm taking a look at others code just to see different ways of doing it. Maybe you could comment it?
Considering he wrote it 7 years ago, your guess is probably as good as his.

User avatar
Jasoco
Inner party member
Posts: 3641
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Jasoco » Thu Mar 14, 2019 4:12 am

This is a realllllly old topic. And numerous better similar Wolf-like engines have been created since then. Including one that's much better than mine that was based on my original code. (I forget who made it right now)

And my original code was ported (by me) to Lua from a JavaScript engine I found on Google once years ago. (Just like my 3D engines are all ported from some archaic math I found in a QuickBASIC project 20 years ago.)

Also I've never been one for commenting code much. It just doesn't come naturally to me.

User avatar
Davidobot
Party member
Posts: 1146
Joined: Sat Mar 31, 2012 5:18 am
Location: Game-Dev. Land
Contact:

Re: Working Raycasting example! WolfenLöve 3D if you will...

Post by Davidobot » Thu Mar 14, 2019 1:55 pm

Sarius wrote:
Tue Feb 26, 2019 7:43 am
It would mean tons if you could just comment the code, what you have done, so that people can understand it easier. I'm trying to write my own first raycaster engine, and i'm taking a look at others code just to see different ways of doing it. Maybe you could comment it?
You can find an example of a raycaster I did here: viewtopic.php?f=5&t=78608

I think the code is quite well-documented and there is some extra info in the thread.
My library:
LovelyMoon

Check out my current project:
Raycaster

Oh hey, I have a website now!

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 8 guests