Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
usernoobguy authored Jan 2, 2024
1 parent 1dee3cb commit 5a263dd
Show file tree
Hide file tree
Showing 34 changed files with 200 additions and 0 deletions.
Binary file added Build/rew.data
Binary file not shown.
5 changes: 5 additions & 0 deletions Build/rew.framework.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Build/rew.loader.js

Large diffs are not rendered by default.

Binary file added Build/rew.wasm
Binary file not shown.
Binary file added TemplateData/favicon.ico
Binary file not shown.
Binary file added TemplateData/fullscreen-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TemplateData/progress-bar-empty-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TemplateData/progress-bar-empty-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TemplateData/progress-bar-full-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TemplateData/progress-bar-full-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions TemplateData/style.css
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 }
Binary file added TemplateData/unity-logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TemplateData/unity-logo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TemplateData/webgl-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app.js

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions index.html
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>
49 changes: 49 additions & 0 deletions opencv.js

Large diffs are not rendered by default.

Binary file added targets/1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/2-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/3-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/5-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/6-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/FINAL-41.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/bear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/bfly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/flower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/lady.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/reel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added targets/rmn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5a263dd

Please sign in to comment.