Skip to content

Commit 8ed9e99

Browse files
committed
Editing ballshooter example
1 parent 1fd893a commit 8ed9e99

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

examples/calibration_editor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</script>
2222

2323
<script type="module">
24-
import { CalibrationInput } from './calibration-editor/calibration-editor.js'
24+
import { CalibrationInput } from './calibration-editor/calibration-editor.js';
2525

2626
function onCalibrationInput(editor, calibration) {
2727
editor.parentNode.removeChild(editor);

examples/webxr_vr_ballshooter.html

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import * as THREE from 'three';
2626
import * as MRC from 'reality-mixer';
27+
import { CalibrationInput } from './calibration-editor/calibration-editor.js';
2728

2829
import { BoxLineGeometry } from '../node_modules/three/examples/jsm/geometries/BoxLineGeometry.js';
2930
import { VRButton } from '../node_modules/three/examples/jsm/webxr/VRButton.js';
@@ -44,10 +45,23 @@
4445

4546
const clock = new THREE.Clock();
4647

47-
init();
48-
animate();
48+
// Mixed Reality Calibration Input
4949

50-
function init() {
50+
function onCalibrationInput(editor, calibration) {
51+
editor.parentNode.removeChild(editor);
52+
console.log(calibration);
53+
54+
init(calibration);
55+
animate();
56+
}
57+
58+
const calibrationInput = CalibrationInput(onCalibrationInput);
59+
60+
document.body.appendChild(calibrationInput);
61+
62+
//
63+
64+
function init(calibration) {
5165

5266
scene = new THREE.Scene();
5367
scene.background = new THREE.Color( 0x505050 );
@@ -89,11 +103,6 @@
89103

90104
// Mixed Reality Capture
91105

92-
const cameraCalibration = new MRC.CameraCalibration();
93-
const chromaKey = new MRC.ChromaKey();
94-
const delayInFrames = 5;
95-
const calibration = new MRC.Calibration( cameraCalibration, chromaKey, delayInFrames );
96-
97106
mixedRealityCapture = new MRC.MixedRealityCapture( calibration );
98107

99108
//

0 commit comments

Comments
 (0)