-
Notifications
You must be signed in to change notification settings - Fork 2
/
of.gridplane.pd
40 lines (40 loc) · 1.83 KB
/
of.gridplane.pd
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#N canvas 402 43 878 735 12;
#X obj 31 24 inlet;
#X obj 32 622 outlet;
#X obj 90 22 inlet;
#X obj 170 22 inlet;
#X text 815 617 RI;
#X text 803 713 R.I;
#X obj 276 18 inlet;
#X msg 276 44 labels \$1;
#X msg 90 48 stepsize \$1;
#X msg 170 48 size \$1;
#X obj 32 75 ofelia d sphere-\$0 \; local c = ofCanvas(this) \; local
outlet = ofOutlet(this) \; local args = c:getArgs() \; local node\$0
= ofNode() \; local stepsize \, size \, labels = args[1] \, args[2]
\, args[3] \; local position \, orientation \, scale \, lookat = ofVec3f()
\, ofVec3f() \, ofVec3f(1 \, 1 \, 1) \, ofVec3f() \; \; function M.new()
\; ofWindow.addListener("setup" \, this) \; if args[1] == nil then
stepsize = 50 end \; if args[2] == nil then size = 5 end \; if args[3]
== nil then labels = 1 end \; M.setup() end \; \; function M.setup()
\; end \; \; function M.free() \; ofWindow.removeListener("setup" \,
this) end \; \; function M.list(l) M.stepsize(l[1]) M.size(l[2]) M.labels(l[3])
end \; function M.size(f) size = f end \; function M.stepsize(f) stepsize
= f end \; function M.labels(f) labels = f end \; function M.debug(f)
debug = f end \; function M.position(l) position:set (table.unpack(l))
node\$0:setPosition(position:vec3()) end \; function M.orientation(l)
orientation:set (table.unpack(l)) node\$0:setOrientation(orientation:vec3())
end \; function M.scale(l) scale:set (table.unpack(l)) node\$0:setScale(scale:vec3())
end \; function M.lookat(l) lookat:set (table.unpack(l)) node\$0:lookAt(lookat:vec3())
end \; \; function M.bang() \; node\$0:transformGL() \; ofRotateDeg(90
\, 0 \, 1 \, 0) \; ofDrawGridPlane(stepsize \, math.abs(size) \, labels>0)
\; node\$0:restoreTransformGL() \; return(a) \; end \;;
#X f 116;
#X connect 0 0 10 0;
#X connect 2 0 8 0;
#X connect 3 0 9 0;
#X connect 6 0 7 0;
#X connect 7 0 10 0;
#X connect 8 0 10 0;
#X connect 9 0 10 0;
#X connect 10 0 1 0;