PDA

View Full Version : Textured eye pupil: can't make it follow Null, help.


Tabby
07-06-2005, 03:53 PM
I need ur help people, I set a texture as a pupil of an eye, with a Null to control it's position. It's aligned and everything, but the texture moves in an opposite direction from the null! null moves left -> pupil moves right, etc.

I thought maybe it was the scale or position settings of the texture so i tried changing some values to negative. Still didn't work. Any ideas?

pooby
07-06-2005, 05:42 PM
If your null is positioned inside the eyeball and is used as a reference null in the surface editor on world coordinates, and on the z axis it should work. The XYZ position is usually set to 0 0 0 to make sure the image is centred exactly where the null is.

Tabby
07-07-2005, 11:45 AM
I'm not sure i understand what you mean Pooby. I tried checking "use world coordinates", it seems to work. But why should the nulls be inside the eyeballs? And what do you mean about the Z axis?

What i'm trying to do is this (i read this from a tutorial on rigging IK eyes), two nulls are controling the left & right eye textures of a character. The 2 nulls are parented to another null that controls them both. Is this the correct way?

If the character tilts his head to the side, how will the eye textures follow, unless the controller null is parented to the head? But if it's parented to the head, the eye textures move around with the head smoothly, which can't be done in real life unless your looking at a moving object. How can the eyes be animated to move jerkily like in real life when you're looking at different things?

pooby
07-07-2005, 01:50 PM
What I do is have an IK setup so the eyes always look at the null.

To do this you need a null (for the texture ref ) In the eyeball. that null is set to IK on heading and pitch.
It also has a child, which is moved outward on it's Z axis a little. This is set to point toward an IK goal called EYES or something.

When EYES is moved, the Nulls inside the eyeballs rotate to 'look' at it.
Thus, moving the texture around and making the pupils 'look' at it too.

Jerky eye movements are achieved simply by jerkily moving 'EYES' around.


note.. If you use this method. the parent of the eye nulls must be aligned to avoid gimbal lock.
Ie. If you parented them to a bone pointing UP and the eyes are meant to point forward, then you will encounter gimbal problems. To counter this, you could make a little bone that points in the direction of the eyes ie forward, and parent them to that instead.

Tabby
07-10-2005, 05:44 PM
Thanks Pooby i understand now! I had a few hit and misses though, coz i didn't read your instructions carefully, to the last word. Thanks for mentioning the gimbal lock thing too, i dunno if i'd have discovered that on my own.

It's perfect now, except for one thing, is there a workaround for the problem where... if i move the "eyes" controller far to the sides, the pupil texture starts to stretch and fills up the whole eyeball, instead of continue on to the sides? I thought that since it's following the local coordinates of the nulls, even if the mapping is set to planar, that it wouldn't stretch no matter what part of the eyeball it's on. ?

btw, how did u learn this rigging method? a tutorial? by yourself? or in school maybe?

pooby
07-10-2005, 06:27 PM
Glad it sort of works.

I have it on World rather than Local coordinates though.. that helps to eliminate stretching (if the eyeball is being stretched by bones)
Some stretching cannot be avoided on any sort of planar map. If it is projecting onto a parallel surface its fine, but will always stretch along a surface at an angle to the projection.

I guess you just have to fiddle about and be aware of why it's doing what it's doing. Most problems can be overcome with a bit of compromise.

As to where i found out about the method. I've been using it so long in various guises I cannot honestly remember whether I made it up or took it from somewhere or what.
It's certainly not unique to me, It's a pretty standard setup, although I don't see the IK part used so much. Quite often the eyes are manually keyed.

Tabby
07-11-2005, 02:37 AM
Thanks again. Yes i also have it on world coordinates. But i thought the null projects the pupil texture to the eyeball like a flashlight does when it's rotated inside the eyeball. So even if i moved the "eyes" controller to the side of the eyeball, it should still be a round pupil at the side of the eyeball. But what happenes is it stretches the texture all around the eyeball. Anyway... i would try to find a compromise, except that the character can hardly look up, down, or sideways, before the texture starts to stretch noticably.

pooby
07-11-2005, 05:10 PM
If you want to send it to me, I'll see if there's anything I can think of to help

SirReality
07-11-2005, 05:33 PM
I'm curious if there is a reason to move the texture over the eye instead of moving the entire eye?

When I set up eyes I simply apply a texture to it, then set up IK for the entire eyeball after parenting it to some bone in the head. I haven't had any problems with texture stretching this way. Granted, I have only worked with round eyes so far.

Tabby
07-13-2005, 04:23 PM
I'm curious if there is a reason to move the texture over the eye instead of moving the entire eye?

When I set up eyes I simply apply a texture to it, then set up IK for the entire eyeball after parenting it to some bone in the head. I haven't had any problems with texture stretching this way. Granted, I have only worked with round eyes so far.

Perhaps my mistake was that i didn't model the eyes as separate objects. BTW the eyes of my character are stretched vertically, like a cartoon character. Is there a way to stretch it, but still be able to rotate it like it was a spherical shape? i think in 3dsmax it can be done.

Anyway, i decided that the stretching isn't too much of a problem now. I'd hardly ever have to put the characters pupils "that" far to the sides anyway.

CGTalk Moderation
07-13-2005, 04:23 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.