Stefan HabelVisual Effects Software Developer |
Home | ||
Frog In The Throat (2008)3D-animated short film -- Trailer for the 2008 Stuttgart Festival of Animated Film (ITFS) |
Last updated: 30 December 2021 | ||
Directed by Wolfram Kampffmeyer
My role: Scripting
Wolfram needed an expression in XSI to calculate the intensity
of a point light over a surface based on the position of the main
point light source to create a fake caustics effect for the pearl
necklace of his main character.
youtube.com/watch?v=HiWTJEi7v1I
The ExpressionThe expression could have been given as:
l = Hauptlicht - Caustics_Fake0
intensity = ( 90 - acos( ( ( Hauptlicht.kine.global.posx - Caustics_Fake0.kine.global.posx ) * ( ( grid0CornerB.kine.global.posy - grid0Origin.kine.global.posy ) * ( grid0CornerA.kine.global.posz - grid0Origin.kine.global.posz ) - ( grid0CornerB.kine.global.posz - grid0Origin.kine.global.posz ) * ( grid0CornerA.kine.global.posy - grid0Origin.kine.global.posy ) ) + ( Hauptlicht.kine.global.posy - Caustics_Fake0.kine.global.posy ) * ( ( grid0CornerB.kine.global.posz - grid0Origin.kine.global.posz ) * ( grid0CornerA.kine.global.posx - grid0Origin.kine.global.posx ) - ( grid0CornerB.kine.global.posx - grid0Origin.kine.global.posx ) * ( grid0CornerA.kine.global.posz - grid0Origin.kine.global.posz ) ) + ( Hauptlicht.kine.global.posz - Caustics_Fake0.kine.global.posz ) * ( ( grid0CornerB.kine.global.posx - grid0Origin.kine.global.posx ) * ( grid0CornerA.kine.global.posy - grid0Origin.kine.global.posy ) - ( grid0CornerB.kine.global.posy - grid0Origin.kine.global.posy ) * ( grid0CornerA.kine.global.posx - grid0Origin.kine.global.posx ) ) ) / ( sqrt( ( Hauptlicht.kine.global.posx - Caustics_Fake0.kine.global.posx ) * ( Hauptlicht.kine.global.posx - Caustics_Fake0.kine.global.posx ) + ( Hauptlicht.kine.global.posy - Caustics_Fake0.kine.global.posy ) * ( Hauptlicht.kine.global.posy - Caustics_Fake0.kine.global.posy ) + ( Hauptlicht.kine.global.posz - Caustics_Fake0.kine.global.posz ) * ( Hauptlicht.kine.global.posz - Caustics_Fake0.kine.global.posz ) ) * sqrt( ( ( grid0CornerB.kine.global.posy - grid0Origin.kine.global.posy ) * ( grid0CornerA.kine.global.posz - grid0Origin.kine.global.posz ) - ( grid0CornerB.kine.global.posz - grid0Origin.kine.global.posz ) * ( grid0CornerA.kine.global.posy - grid0Origin.kine.global.posy ) ) * ( ( grid0CornerB.kine.global.posy - grid0Origin.kine.global.posy ) * ( grid0CornerA.kine.global.posz - grid0Origin.kine.global.posz ) - ( grid0CornerB.kine.global.posz - grid0Origin.kine.global.posz ) * ( grid0CornerA.kine.global.posy - grid0Origin.kine.global.posy ) ) + ( ( grid0CornerB.kine.global.posz - grid0Origin.kine.global.posz ) * ( grid0CornerA.kine.global.posx - grid0Origin.kine.global.posx ) - ( grid0CornerB.kine.global.posx - grid0Origin.kine.global.posx ) * ( grid0CornerA.kine.global.posz - grid0Origin.kine.global.posz ) ) * ( ( grid0CornerB.kine.global.posz - grid0Origin.kine.global.posz ) * ( grid0CornerA.kine.global.posx - grid0Origin.kine.global.posx ) - ( grid0CornerB.kine.global.posx - grid0Origin.kine.global.posx ) * ( grid0CornerA.kine.global.posz - grid0Origin.kine.global.posz ) ) + ( ( grid0CornerB.kine.global.posx - grid0Origin.kine.global.posx ) * ( grid0CornerA.kine.global.posy - grid0Origin.kine.global.posy ) - ( grid0CornerB.kine.global.posy - grid0Origin.kine.global.posy ) * ( grid0CornerA.kine.global.posx - grid0Origin.kine.global.posx ) ) * ( ( grid0CornerB.kine.global.posx - grid0Origin.kine.global.posx ) * ( grid0CornerA.kine.global.posy - grid0Origin.kine.global.posy ) - ( grid0CornerB.kine.global.posy - grid0Origin.kine.global.posy ) * ( grid0CornerA.kine.global.posx - grid0Origin.kine.global.posx ) ) ) ) ) ) / 90 * 2
There were a number of pearls in the necklace that needed the fake caustics effect, so a lot of copying and pasting were done, but in the end, everything worked out just fine. |
|