It looks like you tried to implement it just as Klaus did with one exception...
where Klaus has...
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
|
<action name="onviewchange">
sub(plugin[compass_pointer].rotate, view.hlookat, heading);
sub(plugin[compass2_plate].rotate, heading, view.hlookat);
div(tiltpos, view.vlookat, -180);
mul(tiltmax, plugin[tiltmeter].height, 0.45);
mul(plugin[tiltmeter].oy, tiltpos, tiltmax);
</action>
|
... you have for the "div(tiltpos... " line
|
Source code
|
1
|
div(tiltpos, view.vlookat, -40)
|
so, maybe the difference between using -40 and -180 would cause it.
I haven't walked myself through how to use the mask or laid out the math on this example... just pointing out some differences that might be an area to look at.