Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit 0728eed

Browse files
committed
Gesture demo: add walls arround to keep the items nearbye.
Removed flip camera is it doesnt work good.
1 parent a87c8de commit 0728eed

File tree

3 files changed

+75
-15
lines changed

3 files changed

+75
-15
lines changed

gesture/depth_and_segments.js

+11-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gesture/index.html

+63-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
bottom: 20px;
4040
right: 20px;
4141
color: black;
42+
visibility: hidden; /*it isn't that usable*/
4243
}
4344
</style>
4445
<body>
@@ -172,7 +173,7 @@
172173
const DEBUG_DRAW_BONES = false;
173174

174175
document.getElementById("rotate-toggle").addEventListener("change", function() {
175-
depthseg.setXFlip(this.checked);
176+
depthseg.setXZFlip(this.checked);
176177
});
177178

178179
var timer = app.createTimer();
@@ -268,7 +269,67 @@
268269
mass: 0, // ground
269270
visible: true,
270271
ground: 1,
271-
opacity: 0.8
272+
opacity: 0.7
273+
},
274+
{ // wall
275+
translate: [0, 0, -0.4],
276+
quat: [-0.1, 0, 0, 1],
277+
scale: [3, 1, 0.05],
278+
mvpMatrix: mat4.create(),
279+
modelMatrix: mat4.create(),
280+
lightMvpMatrix: mat4.create(),
281+
mainDrawCall: null,
282+
shadowDrawCall: null,
283+
array: planeArray,
284+
mass: 0, // ground
285+
visible: true,
286+
ground: 1,
287+
opacity: 1
288+
},
289+
{ // nearest wall
290+
translate: [0, 0, 0.4],
291+
quat: [0, 0, 0, 1],
292+
scale: [3, 1, 0.05],
293+
mvpMatrix: mat4.create(),
294+
modelMatrix: mat4.create(),
295+
lightMvpMatrix: mat4.create(),
296+
mainDrawCall: null,
297+
shadowDrawCall: null,
298+
array: planeArray,
299+
mass: 0, // ground
300+
visible: true,
301+
ground: 1,
302+
opacity: 0.2
303+
},
304+
{ // wall to the right, not visible to let the light in.
305+
translate: [0.5, 0, 0],
306+
quat: [0, -0.2, 0, 1],
307+
scale: [0.05, 1, 3],
308+
mvpMatrix: mat4.create(),
309+
modelMatrix: mat4.create(),
310+
lightMvpMatrix: mat4.create(),
311+
mainDrawCall: null,
312+
shadowDrawCall: null,
313+
array: planeArray,
314+
mass: 0, // ground
315+
visible: false,
316+
ground: 1,
317+
opacity: 0.2
318+
},
319+
{ // wall on the left.
320+
translate: [-0.5, 0, 0],
321+
quat: [0, 0.2, 0, 1],
322+
scale: [0.05, 1, 3],
323+
mvpMatrix: mat4.create(),
324+
modelMatrix: mat4.create(),
325+
lightMvpMatrix: mat4.create(),
326+
mainDrawCall: null,
327+
shadowDrawCall: null,
328+
array: planeArray,
329+
mass: 0, // ground
330+
visible: true,
331+
ground: 1,
332+
opacity: 1
272333
},
273334
{
274335
translate: [0.1, 0.075, 0],

gesture/indexaframe.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090

9191

9292
document.getElementById("rotate-toggle").addEventListener("change", function() {
93-
depthseg.setXFlip(this.checked);
93+
depthseg.setXZFlip(this.checked);
9494
});
9595

9696
const depth_to_world_transform = mat4.create();

0 commit comments

Comments
 (0)