Pages

Sunday, May 1, 2016

Lightning and chaotic behavior


I dabble a lot in Houdini. Its fun.

Latest task required me to create a lightning bolt effect falling from high up onto the ground. I decided an easy approach would be to create a line, and displace it randomly. Sounds pretty simple. Should give us a "jagged" line running from sky to the ground.

However, it turns out that lightning has a lot more complexity to it than what one would initially assume.

To start off, here is a line, with about a thousand points along it.


A line, ready to be displaced.
Polyframe node provides us with the needed bitangent vectors
which we shall be randomizing to displace the line around it's axis.

Bitangent vectors on the line which need to be rotated.

After rotating each vector randomly along the line's axis. This screenshot uses the basic random function of houdini.
After displacing the given points using a noise function, this is what we end up with.

So i shifted to a more uniform random number generation, sobol in this case.
The result is still very very noisy.

This made me realize that random number per point was not the right way to go about it. There had to be an order to it. A random direction for every point didn't make sense. Hence i decided to shift to turbulent noise for the random vectors.

Turbulent noise isn't all that turbulent afterall..!
Surprisingly, it gives us something like a coil! Never thought that a little extra order to randomness would result in this! Quite intriguing. What might be the reason one may ask? Well for one, the noise used for displacement itself might be not rough enough. However, if we look at the vectors used here, it would be much more clearer.
Variation here is much much smoother, resulting in an almost spiral shape.

The same turbulent noise visualized on a grid.
So where did we really go wrong? It's in the premise. It's in the assumption that randomly displacing a line with a noise function will really give us the look that we are going for.
Lightning is not a glow along a pre-existing path. Its iterative in nature. Its a transport of force that takes place. electrons flow in the shortest distance possible to transfer energy. Iterative nature perhaps comes from the fact that which direction to take next somehow depends on the incoming electron. This is much like how water flows along streams, or even across the floor, following the path of least resistance.

One thing that helps us with this is l-systems. They are by default iterative in nature, and houdini even bundles a lightning preset to achieve the same. We will explore that in the next blog post. And perhaps other iterative approaches to modeling lightning.

Friday, December 27, 2013

Genesis!!


Yeah yeah i couldn't think of a more creative title for the post, but hey, it fits!!

So, here comes a birthday. Yet another birthday of my life. But this time, i decided i’ll also let it mark the birth of my blog here. Better late than never i guess!!

While i was hoping that finally this year, this common man will get some spotlight now that Sachin has retired, may be the common man will have a little bit of limelight. However, according to some sources (not belonging to paid media), the limelight this birthday would be on AAP taking oath. Nonetheless, i am hoping that displaying the birth date on facebook profile will have some impact.

This blog i shall maintain mostly for general ramblings about the world outside. And also the voices inside my head which need to come out somewhere (Please refer to the title and description of blog). However, for the reader’s convenience, and of course my own safety, i will try my best to not put all the thoughts out here. But as a general heads up, expect a lot of posts to be non-conformist, open minded, rather blunt and tongue-in-cheek. Occasionally they could be humorous too. At some point, i also figured out that offending a person or a group in particular amounts to discrimination. Hence, i shall also try my best to offend everyone equally in case i need to.

If at some point you feel bored reading my blog, feel free to head over to 9Gag, quora or youtube!! (That obviously depending on which end of social spectrum you belong to of course!).

That is it for now. Read on!! And oh, next post shall be on new year resolutions, and how to not have them to save yourself from post-november depression..!