forked from qoh/projection
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cs
More file actions
25 lines (20 loc) · 649 Bytes
/
test.cs
File metadata and controls
25 lines (20 loc) · 649 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if (!isObject(MarkerTest)) {
new GuiSwatchCtrl(MarkerTest);
PlayGui.add(MarkerTest);
MarkerTest.resize(0, 0, 4, 4);
MarkerTest.setColor("1 0 1 1");
}
function test(%what) {
cancel($test);
%res = getRes();
%centerX = getWord(%res, 0) / 2;
%centerY = getWord(%res, 1) / 2;
%world = %what.getPosition() SPC "1";
%screen = projectWorldToScreen(%world);
%w = getWord(%screen, 3);
%x = getWord(%screen, 0)/%w;
%y = getWord(%screen, 1)/%w;
%z = getWord(%screen, 2)/%w;
MarkerTest.resize(%x * %centerX + %centerX, -%y * %centerY + %centerY, 4, 4);
$test = schedule(16, 0, test, %what);
}