home *** CD-ROM | disk | FTP | other *** search
- proc drawEyeWithLids {} {
-
- global sphere eyes eye pupil eyeLid
-
-
- ##########
- startShape Eye
- # each eye should rotate the opposite of the eyes(xRotate) so that they always start off staring straight ahead
- #EveCmd {Rotate -$eye(xRotate) 1 0 0}
- EveCmd {Rotate $eyes(xRotate) 1 0 0}
- EveCmd {Rotate $eyes(yRotate) 0 1 0}
- ##########
- startShape UpperEyeLid
- EveCmd {Translate 0 \
- [expr {$sphere(radius)*sin(radians($eyes(xRotate)))}] \
- [expr {-$eyes(protrusion)*$sphere(radius)*cos(radians($eyes(xRotate)))}]}
- # make sure this scale happens inside each eye, as it needs to be about the eye's origin
- EveCmd {Scale $eyeLid(xScale) $eyeLid(yScale) $eyeLid(zScale)}
- EveCmd {Rotate $eye(xRotate) 1 0 0}
- EveCmd {Rotate $eye(yRotate) 0 1 0}
- # need to twist the eye lid so that manipulating theta max will do what I want
- Rotate -90 0 1 0
- EveCmd {Color $eyeLid(color)}
- EveCmd {Surface $eyeLid(surface)}
- EveCmd {Sphere [expr {$eye(radius)*$eyeLid(sizeFactor)}]\
- [expr {-$eye(radius)*$eyeLid(sizeFactor)}] \
- [expr {$eye(radius)*$eyeLid(sizeFactor)}] $eyeLid(upperTheta)}
- endShape ;# UpperEyeLid
- ##########
- startShape EyeBall
- EveCmd {Translate 0 \
- [expr {$sphere(radius)*sin(radians($eyes(xRotate)))}] \
- [expr {-$eyes(protrusion)*$sphere(radius)*cos(radians($eyes(xRotate)))}]}
- # make sure this scale happens inside each eye, as it needs to be about the eye's origin
- EveCmd {Scale $eye(xScale) $eye(yScale) $eye(zScale)}
- EveCmd {Rotate $eye(xRotate) 1 0 0}
- EveCmd {Rotate $eye(yRotate) 0 1 0}
- # each eye should rotate the opposite of the eyes(xRotate) so that they always start off staring straight ahead
- EveCmd {Rotate [expr {-1*$eyes(yRotate)}] 0 1 0}
- EveCmd {Sphere $eye(radius) [expr {-$eye(radius)}] $eye(radius) 360}
- ##########
- startShape Pupil
- set xTrans 0.0
- set yTrans 0.0
- set zTrans [expr {-$eye(radius)*.65}]
- ApplyToCTM {Translate $xTrans $yTrans $zTrans}
- EveCmd {Scale $pupil(scale) $pupil(scale) $pupil(scale)}
- EveCmd {Color $pupil(color)}
- Sphere $pupil(radius) -$pupil(radius) $pupil(radius) 360
- endShape ;#Pupil
- endShape ;#EyeBall
- ##########
- startShape LowerEyeLid
- EveCmd {Translate 0 \
- [expr {$sphere(radius)*sin(radians($eyes(xRotate)))}] \
- [expr {-$eyes(protrusion)*$sphere(radius)*cos(radians($eyes(xRotate)))}]}
- # make sure this scale happens inside each eye, as it needs to be about the eye's origin
- EveCmd {Scale $eyeLid(xScale) $eyeLid(yScale) $eyeLid(zScale)}
- EveCmd {Rotate $eye(xRotate) 1 0 0}
- EveCmd {Rotate $eye(yRotate) 0 1 0}
- # need to twist the eye lid so that manipulating theta max will do what I want
- Rotate -90 0 1 0
- Rotate 180 1 0 0
- EveCmd {Color $eyeLid(color)}
- EveCmd {Surface $eyeLid(surface)}
- EveCmd {Sphere [expr {$eye(radius)*$eyeLid(sizeFactor)}]\
- [expr {-$eye(radius)*$eyeLid(sizeFactor)}] \
- [expr {$eye(radius)*$eyeLid(sizeFactor)}] $eyeLid(lowerTheta)}
- endShape ;# LowerEyeLid
- endShape ;#LeftEye
-
- ##########
- startShape LeftEye
- # each eye should rotate the opposite of the eyes(xRotate) so that they always start off staring straight ahead
- EveCmd {Rotate $eyes(xRotate) 1 0 0}
- EveCmd {Rotate -$eyes(yRotate) 0 1 0}
- ##########
- startShape UpperEyeLid
- EveCmd {Translate 0 \
- [expr {$sphere(radius)*sin(radians($eyes(xRotate)))}] \
- [expr {-$eyes(protrusion)*$sphere(radius)*cos(radians($eyes(xRotate)))}]}
- # make sure this scale happens inside each eye, as it needs to be about the eye's origin
- EveCmd {Scale $eyeLid(xScale) $eyeLid(yScale) $eyeLid(zScale)}
- EveCmd {Rotate $eye(xRotate) 1 0 0}
- EveCmd {Rotate $eye(yRotate) 0 1 0}
- # need to twist the eye lid so that manipulating theta max will do what I want
- Rotate -90 0 1 0
- EveCmd {Color $eyeLid(color)}
- EveCmd {Surface $eyeLid(surface)}
- EveCmd {Sphere [expr {$eye(radius)*$eyeLid(sizeFactor)}]\
- [expr {-$eye(radius)*$eyeLid(sizeFactor)}] \
- [expr {$eye(radius)*$eyeLid(sizeFactor)}] $eyeLid(upperTheta)}
- endShape ;# UpperEyeLid
- ##########
- startShape EyeBall
- EveCmd {Translate 0 \
- [expr {$sphere(radius)*sin(radians($eyes(xRotate)))}] \
- [expr {-$eyes(protrusion)*$sphere(radius)*cos(radians($eyes(xRotate)))}]}
- # make sure this scale happens inside each eye, as it needs to be about the eye's origin
- EveCmd {Scale $eye(xScale) $eye(yScale) $eye(zScale)}
- EveCmd {Rotate $eye(xRotate) 1 0 0}
- EveCmd {Rotate $eye(yRotate) 0 1 0}
- EveCmd {Rotate $eyes(yRotate) 0 1 0}
- EveCmd {Sphere $eye(radius) [expr {-$eye(radius)}] $eye(radius) 360}
- ##########
- startShape Pupil
- set xTrans 0.0
- set yTrans 0.0
- set zTrans [expr {-$eye(radius)*.65}]
- ApplyToCTM {Translate $xTrans $yTrans $zTrans}
- EveCmd {Scale $pupil(scale) $pupil(scale) $pupil(scale)}
- EveCmd {Color $pupil(color)}
- Sphere $pupil(radius) -$pupil(radius) $pupil(radius) 360
- endShape ;#Pupil
- endShape ;#EyeBall
- ############
- startShape LowerEyeLid
- EveCmd {Translate 0 \
- [expr {$sphere(radius)*sin(radians($eyes(xRotate)))}] \
- [expr {-$eyes(protrusion)*$sphere(radius)*cos(radians($eyes(xRotate)))}]}
- # make sure this scale happens inside each eye, as it needs to be about the eye's origin
- EveCmd {Scale $eyeLid(xScale) $eyeLid(yScale) $eyeLid(zScale)}
- EveCmd {Rotate $eye(xRotate) 1 0 0}
- EveCmd {Rotate $eye(yRotate) 0 1 0}
- # need to twist the eye lid so that manipulating theta max will do what I want
- Rotate -90 0 1 0
- Rotate 180 1 0 0
- EveCmd {Color $eyeLid(color)}
- EveCmd {Surface $eyeLid(surface)}
- EveCmd {Sphere [expr {$eye(radius)*$eyeLid(sizeFactor)}]\
- [expr {-$eye(radius)*$eyeLid(sizeFactor)}] \
- [expr {$eye(radius)*$eyeLid(sizeFactor)}] $eyeLid(lowerTheta)}
- endShape ;# LowerEyeLid
- endShape ;#RightEye
- }
-
-