I decided to make a raycaster, but it doesn't look like any other raycaster there is. And I kind of expected it to be like that, I don't know how other raycasters do it.
So how does mine work? It sends out rays from the player's position, and then it checks each one. If a ray hit something, it's gonna draw a rectangle with a height depending on the length of said ray.
Usually in 3d games (raycasting or not), when you stand in front of a straight wall, it's gonna look straight, right? Well, in my case, it's not. Because rays are sent out around the player - the closer a ray is to the center of the screen, the more curved the wall is going to appear.
Looks weird, right?
How do other raycasters work? And how can I fix mine? Thanks in advance!
Trying to make a raycaster
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Trying to make a raycaster
- Attachments
-
- raycaster(kindof).love
- (1.26 KiB) Downloaded 148 times
-
- Citizen
- Posts: 87
- Joined: Tue Dec 30, 2014 6:07 pm
Re: Trying to make a raycaster
I think you need to somehow get all the rays from the player to the corners of each rectangle shape and fill in the spaces in between so the sides look straight and the edges well defined.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Trying to make a raycaster
No, you need to adjust for the fisheye effect. I don't know exactly how you do that but when I made my first raycaster, someone helped me with it too. I'd suggest searching the forums for one of the many raycaster projects people have made. I suggest either mine or Davidobot's.
I'll save you the trouble.
Here's David's thread: viewtopic.php?f=5&t=78608&hilit=raycast
Here's mine: viewtopic.php?f=4&t=6834&p=45728&hilit=raycast
I'll save you the trouble.
Here's David's thread: viewtopic.php?f=5&t=78608&hilit=raycast
Here's mine: viewtopic.php?f=4&t=6834&p=45728&hilit=raycast
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Trying to make a raycaster
Found this here:
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Re: Trying to make a raycaster
There should be more tutorials for doing this in Lua, cause i can't find any as of right now ;(
Who is online
Users browsing this forum: No registered users and 10 guests