I really liked this article about rendering with simple and fast ray intersection logic. So I decided to port the ray logic into a really lightweight object. There are number of raycasting implementations for Lua out there but most of them have a lot of dependencies. This implementation only depends on vrld's vector class (and that's really just for convenience).
Here's line.lua: https://gist.github.com/TannerRogalsky/9724785
You can see some of the applications in that original blog post or you can download my Love2D proof of concept below or you can check out my code.
Sight & Light
Sight & Light
- Attachments
-
- ray.love
- (176.24 KiB) Downloaded 148 times
Re: Sight & Light
Dude this is awesome! I'll definitely try it and see if I can implement the same shadow and image superposition the original author does! Thanks for sharing!
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Sight & Light
I am afraid I see some random errors on your implementation. Here are a couple screnshots (the cursor doesn't show, but it is always in the "vertex" of the "error black triangle":
When I write def I mean function.
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest