-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dee3cb
commit 5a263dd
Showing
34 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
body { padding: 0; margin: 0 } | ||
#unity-container { position: absolute } | ||
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) } | ||
#unity-container.unity-mobile { width: 100%; height: 100% } | ||
#unity-canvas { background: #231F20 } | ||
.unity-mobile #unity-canvas { width: 100%; height: 100% } | ||
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none } | ||
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-light.png') no-repeat center } | ||
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-light.png') no-repeat center } | ||
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-light.png') no-repeat center } | ||
#unity-footer { position: relative } | ||
.unity-mobile #unity-footer { display: none } | ||
#unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center } | ||
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px } | ||
#unity-fullscreen-button { float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center } | ||
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content='width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes'> | ||
<title>Unity WebGL Player | ar_final</title> | ||
<link rel="stylesheet" href="TemplateData/style.css"> | ||
<style> | ||
html{ | ||
height: -webkit-fill-available; | ||
} | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
min-height: 100vh; | ||
min-height: -webkit-fill-available; | ||
width: 100vw; | ||
overflow: hidden; | ||
} | ||
.ctaDiv { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
top: 0; | ||
bottom: 0; | ||
background: #fffa; | ||
z-index: 99; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<script src="app.js" type="text/javascript"></script> | ||
<!--IMAGETARGETS--> | ||
<imagetarget id='bfly' src='targets/bfly.png'></imagetarget> | ||
<imagetarget id='flower' src='targets/flower.png'></imagetarget> | ||
<imagetarget id='lady' src='targets/lady.png'></imagetarget> | ||
<imagetarget id='reel' src='targets/reel.png'></imagetarget> | ||
<imagetarget id='rmn' src='targets/rmn.png'></imagetarget> | ||
<imagetarget id='bear' src='targets/bear.png'></imagetarget> | ||
<imagetarget id='1-1' src='targets/1-1.png'></imagetarget> | ||
<imagetarget id='1-2' src='targets/1-2.png'></imagetarget> | ||
<imagetarget id='2-1' src='targets/2-1.png'></imagetarget> | ||
<imagetarget id='2-2' src='targets/2-2.png'></imagetarget> | ||
<imagetarget id='3-1' src='targets/3-1.png'></imagetarget> | ||
<imagetarget id='3-2' src='targets/3-2.png'></imagetarget> | ||
<imagetarget id='5-1' src='targets/5-1.png'></imagetarget> | ||
<imagetarget id='5-2' src='targets/5-2.png'></imagetarget> | ||
<imagetarget id='6-1' src='targets/6-1.png'></imagetarget> | ||
<imagetarget id='6-2' src='targets/6-2.png'></imagetarget> | ||
<imagetarget id='FINAL-41' src='targets/FINAL-41.png'></imagetarget> | ||
|
||
<div id="startWebcamDiv" class="ctaDiv"> | ||
<p style="text-align: center; width:60vw">This augmented reality experience requires access to your device's camera</p> | ||
<button id="startCameraBtn" onclick="StartCamera()" style="display:none">ALLOW ACCESS</button> | ||
</div> | ||
<div id="startWebcamManuallyDiv" style="display: none" class="ctaDiv"> | ||
<button onclick="StartCameraManually()" style="width:180px; height:40px; border:1px solid gray; border-radius:8px">START WEBCAM</button> | ||
</div> | ||
<div id="unity-container" class="unity-desktop"> | ||
<canvas id="unity-canvas" style="width: 100%; height: 100%; background: #0000; z-index: -99"></canvas> | ||
<div id="unity-loading-bar"> | ||
<div id="unity-logo"></div> | ||
<div id="unity-progress-bar-empty"> | ||
<div id="unity-progress-bar-full"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<script src="Build/rew.loader.js"></script> | ||
<script> | ||
var container = document.querySelector("#unity-container"); | ||
var canvas = document.querySelector("#unity-canvas"); | ||
var loadingBar = document.querySelector("#unity-loading-bar"); | ||
var progressBarFull = document.querySelector("#unity-progress-bar-full"); | ||
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) { | ||
container.className = "unity-mobile"; | ||
} | ||
function StartCamera() { | ||
canvas.style.width = window.innerWidth + "px"; | ||
canvas.style.height = window.innerHeight + "px"; | ||
|
||
document.getElementById("startWebcamDiv").style.display = "none"; | ||
createUnityInstance(document.querySelector("#unity-canvas"), { | ||
dataUrl: "Build/rew.data", | ||
frameworkUrl: "Build/rew.framework.js", | ||
codeUrl: "Build/rew.wasm", | ||
streamingAssetsUrl: "StreamingAssets", | ||
companyName: "DefaultCompany", | ||
productName: "ar_final", | ||
productVersion: "0.1", | ||
//webglContextAttributes: { "preserveDrawingBuffer": true }, | ||
// matchWebGLToCanvasSize: false, // Uncomment this to separately control WebGL canvas render size and DOM element size. | ||
// devicePixelRatio: 1, // Uncomment this to override low DPI rendering on high DPI displays. | ||
}, | ||
(progress) => { | ||
progressBarFull.style.width = 100 * progress + "%"; | ||
} | ||
).then((unityInstance) => { | ||
window.gameInstance = unityInstance; | ||
window.unityInstance = unityInstance; | ||
window.iTracker.startWebcam(); | ||
//[FIX]: some browsers (such as Wechat) does not allow webcam autoplay so we need to start the webcam manually via new button press | ||
window.waitForVideo = () => { | ||
setTimeout(() => { | ||
if (!window.iTracker.VIDEO) { | ||
window.waitForVideo(); | ||
} | ||
else if (window.iTracker.VIDEO.currentTime <= 0) { | ||
document.getElementById("startWebcamManuallyDiv").style.display = "flex"; | ||
} | ||
}, 2500) | ||
}; | ||
window.waitForVideo(); | ||
loadingBar.style.display = "none"; | ||
}); | ||
loadingBar.style.display = "block"; | ||
} | ||
function StartCameraManually() { | ||
document.getElementById("startWebcamManuallyDiv").style.display = "none"; | ||
iTracker.VIDEO.play() | ||
} | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.