| Creating
eyeballs in Softimage XSI
Updated July 22nd 2003

Depending on
the style of animation you wish to create, a sphere with a texture
map can work perfectly well in portraying an eyeball, especially
if you are going for a cartoon look. However, I was quite interested
in creating an eye which had a lot more depth.......the kind of
eyeballs you might expect in 'Monsters Inc' and 'Ice Age'.
When recreating
such an eye, we notice that it shares alot of similarities with
a real eye: they look wet, have subdued reflections and are able
to catch sharp highlights in certain areas, which gives the illusion
that the eye has depth. In this tutorial we are going to look at
four stages associated when creating such an eye in XSI; the geometry,
the shader, lighting and rigging the eye so that we can control
the size of pupil and eyeball.
Lets start with
the geometry first. The best way to fake the eye is to break the
eyeball into it's basic components and then model each one separately.
We can then group each mesh together so that it resembles the eye.
Normally the
eye can be broken down into 4 components:
- The spherical
structure of the eye white
- Pupil
- Cornea
- Iris
The Pupil is
a simple flat black 2d circle that sits in the iris.
The Cornea is
a key component to the eye. It allows us to catch sharp highlights
and it gives the eye depth. Actually the combination of the cornea,
iris and pupil are what give the appearance of depth but without
the cornea this eye would look flat. The cornea is transparent and
has a light reflection map. Its main purpose is to catch a sharp
highlight
However I'm
going to cheat. The pupil can be left out as we are going to use
shape animation on the Iris to open and close, allowing us to see
inside the eyeball....which will be an inner sphere with a constant
black material. Don't worry, it will all make sense later on in
the tutorial. All u need to know is that for now, we are going to
model the 4 components below.

Note :
Don't freeze any of the objects that we create (and make sure you
are not in 'Immed' mode........as we want to keep some parts of
the history and certain operators, the reason will become apparent
as you work through the tutorial..........
First of all
grab a polygon sphere Get>Primitive>Polygon mesh>sphere
and name it 'white_eye' and rotate it locally in x
by -90 degrees (u can use a surface mesh if u prefer too). Up the
subdivision in the geometry property page to 12 for both u and v.
Then go toTransform>Freeze all transforms to reset
the rotations to 0.
When creating
the eyeball it's important to have all the components rotated in
the same direction so that we can use the 'poles' of the sphere
to aid us in the modeling process. Therefore, to make sure we have
exact copies, duplicate this sphere 3 times by using the ctrl-d
shortcut. Rename the three new duplicates
'inner constant colour', 'iris' and 'cornea' respectively and then
hide them by pressing 'h'.
Select the sphere
named 'Eye_white' and press return to open it's property page. If
it doesn't open then go toselection and click on the
polygon general property icon

In
the property page that opens, change the start angle in V to 20
, so that we have a hole in the front of the sphere.

Unhide the sphere
named 'cornea'. The corneas sits in the front of the eye, it's transparent
and allows us to catch the highlight from any lightsources. Depending
on whether you are using polygon or NURBS object, then the setting
may be different.....just use values that look correct. I used a
polygon object and increased geometry approximation at render time
to get the look I want. Therefore if you used a polygon object,
I found that after Opening the corneas property page, changing it's
Subdivisions in U to 12 and V to 1, and then the End
V to 20 was quite adequate. The cornea should fit tightly
over the sphere called 'White_eye'. However the cornea should bulge
slightly in the front as shown in picture below. Therefore grab
the front points or polygons and move them slightly forward.

Some
thoughts on the Iris and Pupil
Some consideration should also be paid to the topology of
how the eye is created, especially if the animator is expecting
other functionality from the eye. In my case, I want the character's
pupil/iris size to get bigger and smaller depending on what his
circumstances are i.e. happy, shocked, scared, drunk etc. As we
progress through this section, you'll see why we haven't frozen
any objects, so bear with me for a little longer!
The
Iris can be tackled in two ways. In both methods however, the Iris
will also act as our pupil. The first method is a little long winded,
however, could be useful if you wanted to create different pupil
shapes....i.e. Like a cat or monster.
1)
The Shape Key Way
This
method can only be used with Polygon meshes, as it requires us to
delete faces. Unhide the Iris sphere and in it's property page make
the subdivisions in U and V 12 and 1 respectively. The Iris bends
inwards, so tag some points and move them backwards. Then go into
raycast mode (u), select the inner polygons and delete
them.......this hole is going to be our pupil.



Now
duplicate the Iris object twice and move them to one side and name
them 'default_shape' and 'big_iris_shape'. In order to give the
illusion that the pupil is getting bigger and smaller, we need the
original mesh's hole to increase/decrease in size, this is why we
are going create shape targets for the 'iris' mesh to blend between
in the animation mixer. Select the 'big_iris_shape' mesh and tag
the points around the hole. Scale them using the transform tool,
so that the hole gets bigger.

Select
the original 'Iris' mesh and then in the Animation panel go to Deform>Shape>Select
shape key and choose the meshes 'default_shape' and 'big_iris_shape'.
Right click to end picking. We have now created the shape targets.
To make them work we need to lay the shape clips on a shape track
in the Animation mixer. From any of the viewports
select Animation Mixer, or press alt+0 to bring up floating window.
Select the original Iris mesh and update the mixer. You should see
two green Action tracks, we want two shape tracks, so right click
in the tracks and select Add Track>Shape or press
shift+s. Two blue tracks will appear. To insert the
shape clips, right click once again on the shape tacks and select
Insert source, another menu will appear with the
names of the shape clips that we created earlier. Place each one
on separate track as shown below.

Click
to enlarge
Resize
the clips length so that it extends for the entire animation's length.
You should now find that changing the blending weight on the track
with the 'big_iris_shape' clip will make the iris mesh located on
the eyeball change shape.

There is currently
a problem though. Have you noticed that when blending between the
shapes, the Iris is not morphing into the exact shape we had anticipated....instead
the shape being created is more subdued. This is because the mixer
is currently averaging between the two shape targets 'default_shape'
and 'big_iris_shape'. We want the mixer to be in additive mode.
With additive mixing, the shapes are literally added together to
create a composite result. With additive mixing, you can exaggerate
shapes by setting values higher than 1. In order for the mixer to
deal with shape clips in a additive manner, we need to turn off
'Normalize' in the Shape Mixer Properties. Go to Mix>Shape
Animation Properties in the Animation mixer window and turn
off Normalize.

Now when we
blend the weights, the iris shape should update correctly. One more
thing to note: should you want the pupil to ever become as small
as a pinhole, then we can amend the mesh 'default_shape' (the one
that is a shape target) so that the hole is smaller (tag the points
near the hole and scale them down). As there is a relationship between
this mesh and the original iris mesh (because of the stored shape
key information), the new meshes shape will propagate to the original
'iris' mesh.
2) The
Property Page Method
This method
is a lot easier, bit not as flexible as the shape animation method.
For a start, we won't be able to have different Iris/pupil shapes,
however, because we are going to be using a standard property page
that is associated with every object created within XSI, we will
have no operators to slow our computers down. Whilst the NURBS 'Iris'
mesh is sected, click on selection in the Transformation
panel. Typically under each object, there is a subnode named Polygon
Mesh, NURBS Surface Mesh etc. which contains parameters that allow
us to change the properties of an object.

Because we have
not frozen any of the meshes (I told u it would come in useful!)
we can use this Property page to make further amendment to the mesh,
and animate them. Because we are using a NURBS mesh, we won't be
able to delete the points to create the hole. You can however set
the subdivisions to 12 and 2 in U and V, and use the Start V in
the Extent (Angles) sub heading to create the hole!
Don't slide this value higher than the End V, otherwise the mesh
will twist back on its self.
The Constant
shader
The last component
of the eye is another sphere. This sphere is given a constant black
shader and scaled to be slightly smaller than the 'white_eye' sphere.
It is then placed inside the 'white_eye' mesh, so that when we look
at the Iris mesh, the hole allows us to see the black sphere behind
it, or as I like to think of it, the Pupil! Because we don't have
a pupil mesh, we don't have to worry about pupil resizing correctly
when we want it too..............it's all taken care of by the Iris!

Picture shows the inner sphere with a constant shader applied.
Polygons have been hidden on the 'White_eye' mesh to make this clearer.
Putting
it all together
As mentioned
before, in XSI there is an attribute that is associated with every
primitive object that is created, and we can use this to tie together
all our spheres geometry, so we can animate the Iris/pupil sizes,
with just one slider. Once again we are going to use the subnode
found under each mesh to amend the the Start and End U and
V's found in the Extent (Angles) area.
We know that
all of the components we have created for the need to be amended
as one. We are now going to place a simple expression on the Start
and End UV so that they are all linked....therefore when
one slider is moved, all the others move as well.
Select the 'White_eye'
mesh, and open its property page by pressing return. Lock this window.
Notice that when we increase the value of the Start V slider,
the hole on the mesh appears to get bigger.
Now open the
'Iris' mesh's property page. Lock this window too. Notice again
that inceasing the value of the End V slider, the
Iris mesh grows to create a sphere. (note, if you rotaed the sphere
in + 90 degrees at the start of the tutorial, this will be the other
way round!). Therefore, in effect ,it will plug the hole created
when appending the 'white_eye Start V slider.
To create the
link, right click on the Iris's End V green nodule,
and select Set Expression.
Click to enlarge
In
the expression editor that pops up, type:
white_eye.polymsh.geom.startvangle
We have now
stated that the Iris's End V is equal to the white_eyes
Start V. Now when you move white eyes Start
V slider the iris should automatically follow. Link the
'inner_constant_colour' and 'cornea' sphere in the same way so that
it too changes shape at the same time as the other components.

Polygons have been hidden on the 'White_eye'
mesh
to make the animation clearer.
The only thing
to do now in terms of the eyes construction is to amend the Iris
mesh, so that when the Start V gets bigger, the Iris
is still bent inwards. At the moment is starts to straighten, which
will ruin the effect of depth once we apply shaders to the eye.
This can be done using a another blend shape, which bends further
inwards as V increases.
We could also create a custom parameter set to control the pupil
and iris size, rather than a Polymesh parameter, and we need the
eye components to be subdived at render time.
Continue
to Part 2 >>>>>>
|