Skip to content

Commit f6eb0b7

Browse files
committed
Extend kangaroo example with context model
Loads 3dm as "context" which persists between solves
1 parent 70d80ff commit f6eb0b7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/examples/bendy/context.3dm

33.9 KB
Binary file not shown.

src/examples/bendy/index.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
rhino = m
8080

8181
init()
82+
loadContext()
8283
compute()
8384
})
8485

@@ -160,6 +161,15 @@
160161
animate()
161162
}
162163

164+
function loadContext() {
165+
loader.load('context.3dm', function (object) {
166+
object.traverse(child => {
167+
child.name = 'context'
168+
})
169+
scene.add(object)
170+
})
171+
}
172+
163173
/**
164174
* Call appserver
165175
*/
@@ -241,7 +251,7 @@
241251

242252
// clear objects from scene. do this here to avoid blink
243253
scene.traverse(child => {
244-
if (!child.isLight) {
254+
if (!child.isLight && child.name !== 'context') {
245255
scene.remove(child)
246256
}
247257
})

0 commit comments

Comments
 (0)