Sight & Light

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Tanner
Party member
Posts: 166
Joined: Tue Apr 10, 2012 1:51 am

Sight & Light

Post by Tanner »

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.
Attachments
ray.love
(176.24 KiB) Downloaded 147 times
User avatar
Satinxs
Prole
Posts: 9
Joined: Thu Jun 14, 2012 4:14 pm

Re: Sight & Light

Post by Satinxs »

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! :nyu:
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Sight & Light

Post by kikito »

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":
Screen Shot 2014-03-29 at 16.10.33 .png
Screen Shot 2014-03-29 at 16.10.33 .png (18.34 KiB) Viewed 1612 times
Screen Shot 2014-03-29 at 16.11.46 .png
Screen Shot 2014-03-29 at 16.11.46 .png (17.45 KiB) Viewed 1612 times
When I write def I mean function.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests