Eye Position Setup: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Modeling]]
I have a problem. I searched all over the net without result:(
Before compiling your run-time character, you need to set up the proper eye position data. If you modify a model later, but leave the eyes in pretty much the same position, you won't need to change any of the eye settings.
When u open hammer u got 4 screens. 1 in 3D and 3 in 2D. First it was normal but now it looks like this.[[http://users.telenet.be/downloadarea/hammer.jpg]] plz help
 
send reply here or to vancaeneghempieter@hotmail.com
This is what the eye data looks like for one of our female models:
thx
 
<pre>
//start eye/face data
$eyeposition 0 0 70
 
// head controllers
$attachment "eyes" "ValveBiped.Bip01_Head1" 0.002 -3.6165 65.0652 absolute
$attachment "mouth" "ValveBiped.Bip01_Head1" 0.10 -5.70 0.00 rotate 0 -80 -90
$attachment "chest" "ValveBiped.Bip01_Spine2" 4.00 4.00 0.00 rotate 0 95 90
 
$model female_06 "female_06_reference.smd"{
    eyeball righteye "ValveBiped.Bip01_Head1" -1.2783 -3.6165 65.0663 "eyeball_r" 1 4 "pupil_r" 0.63
    eyeball lefteye "ValveBiped.Bip01_Head1" 1.2823 -3.6165 65.0642 "eyeball_l" 1 -4 "pupil_l" 0.63
 
    eyelid  upper_right "female_06_expressions" lowerer 1 -0.2275 neutral 0 0.1475 raiser 2 0.2559 split 0.1 eyeball righteye
    eyelid  lower_right "female_06_expressions" lowerer 3 -0.2879 neutral 0 -0.2046 raiser 4 -0.0462 split 0.1 eyeball righteye
    eyelid  upper_left "female_06_expressions" lowerer 1 -0.2275 neutral 0 0.1475 raiser 2 0.2559 split -0.1 eyeball lefteye
    eyelid  lower_left "female_06_expressions" lowerer 3 -0.2879 neutral 0 -0.2046 raiser 4 -0.0462 split -0.1 eyeball lefteye
 
    mouth 0 "mouth" "ValveBiped.Bip01_Head1" 0 1 0    // mouth illumination
 
    flexfile "Female_06_expressions" {
          $include "../../standardflex_xsi.qci"
    }
 
    $include "../../facerules_xsi.qci"
    $include "../../bodyrules_xsi.qci"
}
//end eye/face data
</pre>
 
You can use the applet QCEyes to format your eye data, or do it manually as described below.
 
'''Note:''' Before you start, you'll want to move the eye spheres to the appropriate location for your model and make sure to '''Freeze All Transforms'''.
 
To get the eye position data from the model, do the
 
1. Get the position of the center point on each eye in all 3 axes (be sure to "Freeze All Transforms" on the eye reference spheres first.)
 
{|
|Righteye_center_X<br>Righteye_center_Y || [[Image:eye_XY_R.jpg]]
|-           
|Righteye_center_Z || [[Image:eye_Z_R.jpg]]
|-
|Lefteye_center_X<br>Lefteye_center_Y || [[Image:eye_XY_L.jpg]]
|-
|Lefteye_center_Z || [[Image:eye_Z_L.jpg]]
|}           
 
2. Get the position on the Y axis for the center point of each eyelid in its default position, raised position and lowered position (if the character is relatively symmetrical, you can use the positions from one eye for both eyes).
 
{|
|Right_upper_def (upper eyelid, frame 0) || [[Image:eye_upper_mid.jpg]]
|-
| Right_upper_lo (upper eyelid, frame 1) || [[Image:eye_upper_lo.jpg]]
|-
|Right_upper_hi (upper eyelid, frame 2) || [[Image:eye_upper_hi.jpg]]
|-
|Right_lower_def (lower eyelid, frame 0) || [[Image:eye_lower_mid.jpg]]
|-           
| Right_lower_lo (lower eyelid, frame 3) || [[Image:eye_lower_lo.jpg]]
|-
|Right_lower_hi (lower eyelid, frame 4) || [[Image:eye_lower_hi.jpg]]
|-
|Left_upper_def (upper eyelid, frame 0) || [[Image:eye_upper_mid.jpg]]
|-
|Left_upper_lo (upper eyelid, frame 1) || [[Image:eye_upper_lo.jpg]]
|-
|Left_upper_hi (upper eyelid, frame 2) || [[Image:eye_upper_hi.jpg]]
|-
|Left_lower_def (lower eyelid, frame 0) || [[Image:eye_lower_mid.jpg]]
|-
|Left_lower_lo (lower eyelid, frame 3) || [[Image:eye_lower_lo.jpg]]
|-
|Left_lower_hi (lower eyelid, frame 4) || [[Image:eye_lower_hi.jpg]]
|}
     
3. Once you've acquired the position data for the eyeballs and eyelids, as listed above, you'll need to do some simple arithmetic to get the following values:
 
{|
| <code>X_avg_pos</code> || The average of Righteye_center_X and Lefteye_center_X
|-
| <code>Y_avg_pos</code> || The average of Righteye_center_Y and Lefteye_center_Y
|-
| <code>Z_avg_pos</code> || The average of Righteye_center_Z and Lefteye_center_Z
|-
| <code>R_lid_up_hi</code> || Right_upper_hi - Righteye_center_Y
|-
| <code>R_lid_up_def</code> || Right_upper_def - Righteye_center_Y
|-
| <code>R_lid_up_lo</code> || Right_upper_lo - Righteye_center_Y
|-
| <code>R_lid_low_hi</code> || Right_upper_hi - Righteye_center_Y
|-
| <code>R_lid_low_def</code> || Right_upper_def - Righteye_center_Y
|-
| <code>R_lid_low_lo</code> || Right_upper_lo - Righteye_center_Y
|-
| <code>L_lid_up_hi</code> || Left_upper_hi - Lefteye_center_Y
|-
| <code>L_lid_up_def</code> || Left_upper_def - Lefteye_center_Y
|-
| <code>L_lid_up_lo</code> || Left_upper_lo - Lefteye_center_Y
|-
| <code>L_lid_low_hi</code> || Left_upper_hi - Lefteye_center_Y
|-
| <code>L_lid_low_def</code> || Left_upper_def - Lefteye_center_Y
|-
| <code>L_lid_low_lo</code> || Left_upper_lo - Lefteye_center_Y
|}
 
Note: The axes in XSI are rotated 90 degrees CCW about the X axis from the Source Engine axes.
A triplet ['''X''', '''Y''', '''Z'''] in XSI becomes ['''X''', '''-Z''', '''Y'''] in Source.
''N.B.'' the change in sign necessary for the '''Z''' value.
 
4. Now format the eye position data as shown below:
 
<pre>
//start eye/face data
$eyeposition 0 0 70
 
// head controllers
$attachment "eyes" "ValveBiped.Bip01_Head1" X_avg_pos -Z_avg_pos Y_avg_pos absolute
$attachment "mouth" "ValveBiped.Bip01_Head1" 0.10 -5.70 0.00 rotate 0 -80 -90
$attachment "chest" "ValveBiped.Bip01_Spine2" 4.00 4.00 0.00 rotate 0 95 90
 
$model female_06 "female_06_reference.smd" {
    eyeball righteye "ValveBiped.Bip01_Head1" Righteye_center_X -Righteye_center_Z Righteye_center_Y "eyeball_r" 1 4 "pupil_r" 0.63
    eyeball lefteye "ValveBiped.Bip01_Head1" Lefteye_center_X -Lefteye_center_Z Lefteye_center_Y "eyeball_l" 1 -4 "pupil_l" 0.63
   
    eyelid  upper_right "female_06_expressions" lowerer 1 R_lid_up_lo neutral 0 R_lid_up_def raiser 2 R_lid_up _hi split 0.1 eyeball righteye
    eyelid  lower_right "female_06_expressions" lowerer 3 R_lid_low_lo neutral 0 R_lid_low_def raiser 4 R_lid_low _hi split 0.1 eyeball righteye
    eyelid  upper_left "female_06_expressions" lowerer 1 L_lid_up_lo neutral 0 L_lid_up_def raiser 2 L_lid_up _hi split -0.1 eyeball lefteye
    eyelid  lower_left "female_06_expressions" lowerer 3 L_lid_low_lo neutral 0 L_lid_low_def raiser 4 L_lid_low split -0.1 eyeball lefteye
   
    mouth 0 "mouth" "ValveBiped.Bip01_Head1" 0 1 0    // mouth illumination
   
    flexfile "Female_06_expressions" {
          $include "../../standardflex_xsi.qci"
    }
   
    $include "../../facerules_xsi.qci"
    $include "../../bodyrules_xsi.qci"
}
//end eye/face data
</pre>
 
'''See also'''
* [[.QC Commands#New $model Option]] - eyeball, eyelid command details.
 
{{otherlang:en}} {{otherlang:en:jp|Eye Position Setup:jp}}

Revision as of 10:45, 8 February 2006

I have a problem. I searched all over the net without result:( When u open hammer u got 4 screens. 1 in 3D and 3 in 2D. First it was normal but now it looks like this.[[1]] plz help send reply here or to vancaeneghempieter@hotmail.com thx