Hey Sven, the source is included with the zip if you want to check it out. The light positioning is done using simple transformation functions in ikeda_math.txt.
The only ones I use are RotateX and RotateY:
[RoutineDef, "RotateY",
[VarDef, tX][VarSet, tX, ( (sin(#angle) * #z) + (cos(#angle) * #x) )]
[VarDef, tZ][VarSet, tZ, ( (cos(#angle) * #z) - (sin(#angle) * #x) )]
[VarSet, x, tX]
[VarSet, z, tZ]
, x, y, z, angle]
This rotates a vector/point about the Y axis. The light positions are recorded into an array when the user hits Start and absolute rotations are performed based on the yaw setting. Front, Back, Left, and Right just affect yaw.
For top and bottom views, I just hardcoded the light positions to RotateX with 90 degrees and -90 degrees.
[RoutineDef, "RotateX",
[VarDef, tY][VarSet, tY, ( (cos(#angle) * #y) - (sin(#angle) * #z) )]
[VarDef, tZ][VarSet, tZ, ( (sin(#angle) * #y) + (cos(#angle) * #z) )]
[VarSet, y, tY]
[VarSet, z, tZ]
, x, y, z, angle]
I have yet to find a solution where the user can orient the model any way he/she likes and have the lights synchronize when baking. It has to do with the complex rotational angles that ZBrush provides. I can’t figure them out.