Why are my model's eyes so strangely distorted?

I’m working with a guy on some stuff and have hit a highly confusing snag.

So I’m importing some Wii models and have reached the point of doing eyes (something I’m new to). I have successfully gotten eyes to render and “follow” the viewtarget in SFM. The problem is this:

(I hid the entire head but the eyes so I could see what was going on better.)

See how the irises are ridiculously distorted no matter what direction they’re looking in? I’m at a loss at to what the problem could be. This is the relevant .qc fragment:



	eyeball righteye "Head" -1.25 -2.65 61.0 "EyeR" 1.1 -4 "IrisR" 1.0
	eyeball lefteye "Head" 1.25 -2.65 61.0 "EyeL" 1.1 4 "IrisL" 1.0

I’ve tried changing pretty much every value here (as well as the UVs of the mesh) and haven’t been able to find improvement (only even-stranger results). So basically I’m looking for some ideas as to what the problem could be. I’ve found no help in searching for “Source engine distorted eyes” and the like.

Well it seems the source of my problem was twofold.

Problem number uno: I didn’t post this part of the .qc because I didn’t think it was relevant. Oops.


$attachment "eyes" "Head" 0.0 0.0 3.25 rotate -0 90 90
$attachment "righteye" "Head" -1.1 0.0 3.25 rotate -0 90 90
$attachment "lefteye" "Head" 1.1 0.0 3.25 rotate -0 90 90

I always knew that having at least one $attachment was necessary, and I had confirmed multiple times that they were in the expected locations, but apparently I had them pointing the wrong way. They were all pointing X up, Y forwards, and Z left. Messing with them started producing better results, as did discovering that using absolute positioning automatically rotates the attachments so that X is forward, Y is left, and Z is up (which doesn’t make sense to me but it seems to work the best of all the orientations).

Problem numbero two: Apparently I’ve been misunderstanding how the eyeball renderer is supposed to work this whole time. While I was experimenting with the attachment angles I discovered that I had the eyes’ Y position way too far forward. Like, I changed it from -2.65 to -2.0 and suddenly things looked far more reasonable, and I kept going quite a ways to -1.5 or something. It seems that I had only moved it up to -2.65 because that was the point where it started rendering in its broken, attachments-are-pointing-the-wrong-way state (which I guess is what confused me about the eyeball renderer). Ugh.

So yeah that’s basically problem solved for now. Resulting .qc code:


$attachment "eyes" "Head" 0.0 -2.65 61.0 absolute
$attachment "righteye" "Head" -1.25 -2.65 61.0 absolute
$attachment "lefteye" "Head" 1.25 -2.65 61.0 absolute

$model "thingus.dmx" {
	eyeball righteye "Head" -1.25 -1.5 61.0 "EyeR" 1.1 4 "IrisR" 1.0
	eyeball lefteye "Head" 1.25 -1.5 61.0 "EyeL" 1.1 -4 "IrisL" 1.0
	[other stuff]
}
...