|
This is an effect that I have been working on at work
this last week. It's just a pet project but turned out quite good, so
I thought that I would spill the beans and tell you how I did it.
A nugget of purest green!...
I was looking at the lightning plugin that is on my other page and I was thinking, "This looks nice but how can I animate it?". Well after much scratching of head I figured it out. This tut will take you through many features of max including:- path controllers, expressions, and dynamic lofting. (wow, that all sounds good dunnit!). The main problem that I found with the lightning plugin is that it created lots of faces, no good if you need quick render times. My effect uses the minimum of faces and still looks as good. (of course thats just a matter of opinion). It has been designed so you can drop the effect into any future anim and alter a few figures, pull a couple of verts around and get a new effect. I'd like to try your wootang style, lets begin then!
It's all based around the fact that you can alter the
shape of a loft on any frame just by playing with the spline you used
for the path. This is how the effect is created, the loft paths are
given a noise modifier, and the values are animated. This is coupled
with smaller off shoots of lightning following the main path and flashing
on and off randomly. This is the first time that I've played with so
many features in one project. It may seem a little daunting, and a lot
of work just to get some jiggly lines, but I think it looks quite good,
and you should only need to do it once! Next put in three other smaller branches, try to give
them a shape that will look o.k at any position along the main branch.
Now the first step of cunning! We need the smaller branches to follow
the big main bolt, so set the pivot point of the small branches to one
end. Next goto the motion menu (the little unicycle) and click on the
position controller. The little green icon
Too loud man, too loud!...
It's no good those lines sitting at the top like that,
they need to wibble in a random type fashion!! Select a branch and call
up the track editor. Expand the tree until you find the position controller
and expand that. You will have an entry that is called percent (%!).
This tells the line how far along the path it should be, so if we give
it a random number it will jump about up and down the path like a maniac!
Do the same with the other branches...... Death by stereo....
Now we have lines that move up and down the main bolt
in a random way. But the lines themselves don't change shape! Until
now....
Now your lines jump about on their own and up and down the main bolt - cool! Big fat loft-a-thon.
Right, now we've got the line but they have no girth.
They need to be solid. Lets loft the buggers!
Light my fire, Light my fire, Light my fire...
This lightning is on all the time, "but wait a
minute, lightning sort of flashes on and off, doesn't it?" - your
thinking. Hmmmmm, good point. O.K we need to slap on a visibility track.
This etxra track tell the object which frames to appear in. A value
above 1 and the object is visible, below 1 and the object is invisible.
We need the main bolt to flicker on and off so...... Yes! it's time
for the good old noise controller. In the track editor select the main
bolt loft, you should see this icon become active - And now the end is near, I must face the final expression...
If you render up a quick test AVI you will see that
just the main bolt flashes and not the smaller branches. Bugger! - we
could put a noise controllers on them as well, but then we might get
the main bolt hidden and smaller one showing. Hmmmmmmm...... NO technical knowledge is required! An expression is a mthmatical formula that tell the
controller what to do. There are a list of commands that can be used
in an expression, and logical type descisions can be made. Give all
the smaller branches a visibility track and make the controller - float
expression.
Make sure the little option button is set to scalar,
type in a name for the variable (anything will do), and then click create.
Your variable name should now appear in the bottom left window. But
this variable is not linked to anything yet, it needs to be the result
of the main bolts visibilty track. Click on the variable and then click
Assign to controller. Select from the list of controller the
noise float for the main bolts visiblity. Whatever the result from the
nosie contoller is now passed to our variable. So we can check this
and tell if the main bolt is hidden or not! Type in this formula in the right hand side box (the big one). if ("your variable name">0,noise(100,sin(T),50),0) Wow that looks complex! But hey I'll talk you through
it..... Note:- if your lightning has children of small branches, ie - if your smaller branches fork at any point. Then be sure to point it's variable to it's parent branch and NOT to the main bolt. I got that funny feeling in my tummy...
O.K cool, now we've got our lightning flashing and jiggling
and looking funky. if we slap on a dual glow it should be nearly finished.
The last little thing is to get a big light to flash
on and off with the lightning, "clear enough miss Moneypenny, this
should present no significant problems". You need to link the multiplyer
of the light to the visibilty of the main bolt. With your new found
knowledge on expessions it should be a breeze. |