Once more dear friends a stumbling lurch into the unknown terratory that is a max tutorial. This one being A. the first one in ages I've botthered my ass about doing and B. the first one to be in max4. I'm gonna build some eyes. Now I've seen several tuts on eye of late, mainly looking at how to build them. Well there's not that much going on in the building stakes. So I thought I'd take a look at how to get them moving and stuff as well. The eyes of the chugg will have an animatable diallation parameter and dual blinking lids. It's not what it is, it's what it will be - a cold blooded killer Not unsuprisingly we start off with a sphere. Ya standard settings shpere is all I used here. Nothing fancy. Collapse it down to an editable mesh and select a portion of the front of it, enough to make a good sized pupil out of, it's about 2 segments.
Copy these faces to a new object. I've also chopped the back few segments off - you'll never need them anyway (unless your anim calls for your hero to loose an eye of course - spoon it out) Go back to the main sphere and grab the centre vert, slap on some soft selection and drag it forward to make a nice corneal bump. Those who are keen of eye will also note that I subdivided the cornea section a little (a couple of extra segments), just to give a little better curve on the bulge. But unless your getting very close to the eye you probably won't need to do that.
Hhhmmm, look at that cornea. Tasty, yet light enough that it won't spoil your tea. Moving back to the faces we made a copy of, mirror them so they now dish inwards, and flip the normals. This is going to form our iris. Line it back up to the place we cut it from (use vert sanp for this) then take the middle vert and pull it right back into the eye. This will simulate the dark depth of a passionate eye (wot?) Now is also a good time to give these faces a new face ID number for the material and a new different dsmoothing group to the rest of the eye. Make sure that all the faces of the iris are ID "1" and give them a smoothing group of "2". Go back to the main eye and pick the cornea faces and make them ID "2", make all the other faces ID "1". Then re atach the iris to the rest and weld the verts.
Sure as eggs is eggs, sure as every odd numbered star trek movie is shit we nee to get some texture on this bad boy. Now the obvious method for this would be to apply spherical mapping co-ords yes? NO YOU BIG SPAZ! We want to draw our eye in a sensible fasion ie pupil on a square texture in the middle of the page. We need minimum distortion of texture, so we need to use adapted planar co-ords. Slap planar UV's on it from the front then use the unwrap UVW mod on it. The UV's will look a little messy, but it's no problem to sort out. Go in to UW view and select all the UV's from the back of the eye up until the point that the UV rows distance in UV view start to even out. Hmmm, that makes very little sense. OK. In UV view you'll notice that in the middle near the cornear that the distance between the rings of the sphere is pretty even. But the more you move towards the back of the eye as the sphere starts to curve away from you the UV's all bunch up. It's that bunching we are trying to correct. When we go into UW view we can see the eye from the side and therfore it's easy to grab to right UV's. Grab all the ones that are bunched up and in UV view scale them to remove the nearest circulars rows bunching. The go back to UW view and deselect that row. Keep going back and forth between views scaling the bunch out of the UV's. It's a lot easier to do this than it is to explain it. When your done you should have something that looks a bit like a dart board.
This layout sorts out all our mapping problems and it means we can draw a sinsible bitmap. speaking of which here they are.
I drew the diffuse first then did contrast adjust etc to get a specular level and glossiness map. I also used a subtle bump just to pick out the viens a little. And I use raytrace rflection on the eye which I masked with a bitmap so that the iris and pupil didn't reflect. This is because the cornea has reflection on it and we don't want double reflections. The cornea has all the same maps on a the rest of the eye excep they have had the iris removed from them and it's transparency set to 0%. Use a multi-material. This should all be straight forward. And no I'm not giving you these maps - you can draw ya bloody own!
"Let's blay" No we will put in the control for the iris. Select all the verts that lie on the edge of the iris (they make the bottom of the cone) Leave it in vert mode and slap on an x-form mod. You will see a small orange square around your verts.
we'll just leave this for now and come back to it in a bit. Duplicate the eye and call them sensible names. I suggest "left eye" and "right eye" but then I'm just a traditionalist, let's not mock the modern - call them whatever you like. We now need to setup some of the controls for these eye. They need to look somewhere, so thats what we'll do first. Make a dummy object exactly in the middle of the two eyes and about 5 or 6 eye lengths away. This will be our main look at target. But we can't look at this cuz it'll give our character cross eyes, so make two point objects and line them up with the pupils of your eyes (not your eyes, the ones we're building) and then link them to the main dummy. Now go to the animation menu and select "Constraints" and pick "look-at", click on the object that you want to look at. Left point for left eye, you get the idea. We need to make one small adjustment to the look-at constraint to make it work good. Change the upnode from work to "pick" and click on the main dummy. This just makes sure that when/if your character goes upside down then the look at constraint doesn't flip round the other way. When you get that feeling it's like - sexual healin'
Now it's time to add a little funk to our chicken and explore the black arts of parameter wiring. We need to add some controls to animate the pupil dilation and the lids. Go to animation again and this time select "add custom attribute". You'll get a wee dialogue come up where you can add sliders or spinners or buttons to an objects rollout that can be used to control stuff. I like to use spinners instead of sliders because you can type in the exact value you want.
We will also need to add two other controls for the lids. Call them "left_lids" and "right_lids". Now when you go to the modify panel fror the dummy you should see some funky controls.
Next bring up the wire parameters dialogue from the animation menu.
You have two list of objects like in the trackview. On the left pick the left eyes x-form modifier and it's scale controller. On the right pick the main dummy's dialate controller. (You may notice that my dialate, spelt wrongly!, is a float list. This is because I put the controller into a list with a noise float to give a bit of jitter. But you don't have to do this). Click the arrow that points from the dialate controller to the x-form. This makes it a one way control, and in the "expression for scale" box at the bottom type.... [0.2 + (dialate * 1.3), 0.2 + (dialate * 1.3), 0.0] The expression works like this. The scale is expecting a point three value, that is [x,y,z] values to scale each axis in. The 0.2 is the smallest our iris will be then add on our dialate controllers value (remember it's in the 0.0 to 1.0 range) scaled by the maximum we want the iris to be - 1.3. So when our iris is dead small the value will be 0.2 + (0 * 1.3) = 0.2 and when it's at it's biggest it's 0.2 + (1.0 * 1.3) = 1.5. It's in there twice because we need to do it in both the X and Y axis. Now we do the lids. I'm just putting simple hemispheres here with the intention that they will be used as bones on a skin. Make two hemispheres per eye and line them up over the top. You need to give the lids sensible names again and change their rotation controller from "TCB" to "euler XYZ". Next select both lids one your chosen eye and rotate them down a bit to get the lid line when they are closed. Reset the x-forms of both upper and lower lid. Now rotate them back to a position that will be their most open and take note of the angle that you used. Reset both lids again and goto the wire dialogue. Find the lid control of the dummy and the X rotation of the upper lid first and click the one way arrow. in the expression box type.... degtorad(left_lids * 57) 57 was the opposite of the angle I picked when I rotated the lid back. Do the same for the lower lid putting in the opposite of the lower lid angle. What you should find now is that when the spinner is at 0.0 the lids are open and when it's at 1.0 (can you guess?) it's closed. The upper and lower lids will move in time with each other. Now do the same with the other eye. It's a simple way to set the lid rotations with very little thought. We should be listening to kicking choons, thumping bass - God I sound stupid! So there we go, blinking dialating eyes that track where you want them to go properly. Ya can't say fairer than that guv'na.
"fairer than that"
|