|
This one is quick and simple. It shows you how you
can create lens flares without having a lens flare plugin. It also
teaches you some useful bits about expressions and texture parameters.
Up, up and away, in my beautiful balloon! When is a square not a square? - Who cares... Lets start off with a line, it seems as good a place
as any. Draw a spline,a helix in fact. Make sure the helix has one
radius of "0" and another of "1". We need to use
a helix instead of a standard line because it's the only Max spline
that has a length parameter.
As we're going to be cloning this square it's best if we apply mapping now, so off you go! Slap on UVW co-ords - planar will do just fine, and make sure the gizmo fits all snugly. "Lash me down, for I fear I will blow away...!" Now the principals of lens flare are thus.... What we need to do then is work out the distance from
the light to the centre of the screen. First of all we need a camera
of course, or all of this banter is academic. Create a target camera
in the scene, make sure to start with the target is fairly close to
the helix. Next open up the track editor and find the controller for
helix length. Click on the change controller icon SEGUE - Hold your horses fella! what are expressions anyway? Expressions are mathematical formula that control
how object parameters behave....Sounds good eh?
Call up the expression dialogue box and enter this expression... CONST+(POS1-POS2) POS1 = position controller of the helix POS 1 and 2 should be created as vector variables, and CONST is a constant variable. Part 2 of this is getting the helix to "look
at" the camera target (and therefore the centre of the screen).
For this we need to change the "transforms" controller of
the helix to be a "look at" controller instead. The look
at controller always points the objects -Z axis towards a selected
object. Basically if you rotate the pivot foe the helix so that the
Z (blue) arrow points directly along the line away from the camera
target. This will probably involve rotating it 180 degrees.
Home straight When you've got your rectangle with mapping and your straight helix pointing at the camera target, you can start to clone the rectangles. Make as many as you need elements in your flare. When you've done that, scale some of the rectangles so that there more or less the sizes of the flare elements.
Now we have to get these bits to stick to the line
- in an orderly fashion. For this we need to be using the path controller.
Goto the motion panel and open up the controllers portion of the roll
out. Select "position" and click the change controller icon
-
click the pick path button and choose the helix. MAX2 NOTE:- In max2 there is a spinner for % along the path, in Max1 there is not. So Max1 users will have to goto the track editor to change the value of the key. Do this for all of the rectangles you made and space them along the helix. "Look at me when I'm talking to you!" Now it should look a bit like this....
But this is no good! Because lens flares are not objects and so are always flat to the screen. This, fortunately, is not too hard. For all of the rectangles you need to goto the motion panel and select "transforms" in the controller list. Then change it to read "look at". "Iee lieek thur preeetee coolars, marmmy" All thats left now is to apply the flare maps. These are the maps I used (but they were true colour and bigger, obviously).
Take each bitmap and make a material that is 100% self illuminating and has no shininess. In the "extended parameters" section make it an additive transparency - you will also need to change opacity to 99 to make it work. you shouldn't need to change any other parameters.
you should (if you set the bitmaps to display in the
viewport) have something that looks a bit like this..... Until next time - lets be careful out there. |