Vectorfield Visualization

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
SCARD
Prole
Posts: 45
Joined: Tue Sep 04, 2012 12:44 pm

Vectorfield Visualization

Post by SCARD »

Hi guys

I am currently working on my master thesis. Basically it is about flow visualization (i.e. vector field stuff) and extracting mystical structures to improve the world (or so :P). To prototype things I usually use the wonderful löve2D engine. I just wrote a little tool that generates a random vector field and extracts coordinates of separated points (zero vectors) by using newton iterations and colorcodes the type of the separated points (source, sink or saddle). It also draws the streamline that goes through the current mouse cursor position and sampled vector at the position of the mouse cursor. What does not work for now is to color code swirling behaviour due to the lack of imaginary number support (maybe I am going to write some imaginary number table later..)

Controls:
left mouse drag: move the domain
mousewheel: zoom (attention, don't scroll too much out or the program will crash >.<)
space: create new random vector field

When starting the program it may take some time to generate and calculate everything.

Have fun testing it :)

EDIT:
Updated files with MIT License. Feel free to use the code!
Attachments
VF.love
(8.19 KiB) Downloaded 310 times
Last edited by SCARD on Thu Dec 08, 2016 4:11 pm, edited 1 time in total.
User avatar
Popolon
Prole
Posts: 25
Joined: Mon Nov 07, 2016 11:03 am
Location: France/Paris

Re: Vectorfield Visualization

Post by Popolon »

Really nice stuff, I like to see the incredible behaviour of the curved line, especially twirlings. This could be used as the basis of lot of nice effects. I don't see any license for your code. Can it be used as a lib or something like that?
User avatar
SCARD
Prole
Posts: 45
Joined: Tue Sep 04, 2012 12:44 pm

Re: Vectorfield Visualization

Post by SCARD »

I wrote all myself in like two or three days and if you want you can use it as a library of course.
Basically it is linear algebra calculations, linear, bilinear and trilinear sampling and a runge-kutta-4 integrator. It would be nice if you mention me when using it. I never published something under some licence so maybe someone can help me with this?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Vectorfield Visualization

Post by kikito »

SCARD wrote:I never published something under some licence so maybe someone can help me with this?
I usually go with the MIT license. In common English it means "do whatever you want with this code, just don't sue me, and mention me somewhere". It is also short enough so that you can put it directly in the source code so that it is even easier to comply with the "mention me somewhere" part (if they are open source, just by copying the .lua file they are satisfying the clause).
When I write def I mean function.
User avatar
SCARD
Prole
Posts: 45
Joined: Tue Sep 04, 2012 12:44 pm

Re: Vectorfield Visualization

Post by SCARD »

Thanks kikito! I just updated my sources with the files :)
User avatar
Popolon
Prole
Posts: 25
Joined: Mon Nov 07, 2016 11:03 am
Location: France/Paris

Re: Vectorfield Visualization

Post by Popolon »

So nice, thank you very much for your work and license ! I'm starting for few month using/testing lua & löve very slowly. Didn't coded a lot for a while, busy with too much things, I progress with very slow steps one or two time every n weeks ^^. I would like to do something with crowd (probably animals crowd), It could be interesting to use this kind of algorithm as path for some animals following water/wind flux or more probably ground path. I will probably start with basic crowd in first step using particles system. If I manage to go to the level where I use it I promise to mention you (as license expect now :). I will probably release my own code in GPL or mixed licence like WTFPL/MIT for some parts that could be reused ???
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests