playMaker

Author Topic: Play animation based on position help please...  (Read 2235 times)

Digital Adam

  • Full Member
  • ***
  • Posts: 208
Play animation based on position help please...
« on: September 18, 2013, 02:32:15 PM »
I have an animation of an eye in which the iris goes from small to large. What I'd like to do is have the animation change based on the light position and brightness.  I have to take into consideration the direction of a direct light and the amount of brightness, as well as the transition from going outdoors to indoors in which there will be point lights, both location and direction. Any thoughts on how you would set this up will greatly be appreciated!

parallel

  • Full Member
  • ***
  • Posts: 155
Re: Play animation based on position help please...
« Reply #1 on: September 18, 2013, 06:20:35 PM »
Sounds like a pretty detailed gameplan you got there. I saw a smart setup on polycount (can't find it atm) with the iris border modeled so that it could be enlarged with a bone manipulation, I guess it could be done also with scaling a separate iris plane. Triggered by a raycast from the light, or trigger zones. 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Play animation based on position help please...
« Reply #2 on: September 20, 2013, 03:23:21 AM »
Hi,

 You need to check for the light direction against the eye direction, and the steeper the angle the more "in your eyes" :) then you also add in that equation the brightness of that light, and do a weighted average using all the lights you want to take in consideration.

you can use ArrayMaker to do this:

https://hutonggames.fogbugz.com/default.asp?W715

store in an array, the lights that you want to affect your eye ( either you register them in editor, per level or per triggers).

then your eyes can go trhough that list and compute the lighting ( angle to light and strengths).

the other solution is to have your light responsible for trigger to your eye system when it's actually affecting the iris ( you work the other way around).

 so when a light detected that your eyes is close enough  ( trigger), you start computing the angle and when you reach certain thresholds, you fire an event to the eye to express the amount of exposure. you animate the iris based on that exposure amount.

 Does that help?

bye,

 Jean