Skip to content

Commit

Permalink
small changes, still not works
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwalt committed Nov 6, 2024
1 parent 4dea691 commit 771a085
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 41 deletions.
32 changes: 4 additions & 28 deletions examples/css/nft-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ html {
}

#loading img {
height: 5em;
height: 5em;
}

#loading span{
#loading span {
color: black;
font-weight: bold;
}
Expand All @@ -35,7 +35,7 @@ html {

margin: 0.5rem;

background-color: rgba( 255,255,255,0.6 );
background-color: rgba(255, 255, 255, 0.6);
border-radius: 6px;
}

Expand All @@ -49,7 +49,6 @@ html {

.stats-item {
margin: 0 0 0.5rem;

}

.stats-item-title {
Expand Down Expand Up @@ -106,29 +105,6 @@ html {
object-fit: cover;
}

#canvas_process {
position: absolute;
left: 0;
top: 0;
z-index: 80;

display: block;
width: 1280px;;
height: 720px;
object-fit: cover;
}

#arvideo {
display: none;
}

#status {
position: absolute;
left:10px;
top: 180px;
background: lightslategrey;
border-radius: 6px;
color: #fff;
padding: 4px;
user-select: none;
}
}
4 changes: 2 additions & 2 deletions examples/threejs_ES6_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<div id="loading" >
<!--<img src="Data/JsartoolkitNFT-logo.gif"/>-->
<img src="data/aframe-k.png"/>
<span class="loading-text">Loading, please wait</span>
</div>
<!--
Expand Down Expand Up @@ -41,7 +41,7 @@
<canvas id="canvas"></canvas>
<!--<canvas width="1280" height="720" id="canvas_process"></canvas>-->
</div>
<img id="refIm" src="./data/pinball.jpg" width="1637" height="2048" style="display:none;">
<!--<img id="refIm" src="./data/pinball.jpg" width="1637" height="2048" style="display:none;">-->
<script src="js/stats.min.js"></script>
<script src="js/three.min.js"></script>
<script>
Expand Down
10 changes: 6 additions & 4 deletions examples/threejs_worker_ES6.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function start(markerUrl, video, input_width, input_height, render_update, track

worker = new Worker('./worker_threejs.js')

const refIm = document.getElementById("refIm");
//const refIm = document.getElementById("refIm");

const type = setTrackerType();
const loadImage = (URL) => {
Expand All @@ -102,8 +102,10 @@ function start(markerUrl, video, input_width, input_height, render_update, track
type: "initTracker",
trackerType: type,
imageData: buffer,
imgWidth: refIm.width,
imgHeight: refIm.height,
//imgWidth: refIm.width,
imgWidth: 1637,
//imgHeight: refIm.height,
imgHeight: 2048,
//videoWidth: oWidth,
//videoHeight: oHeight,
videoWidth: vw,
Expand Down Expand Up @@ -204,7 +206,7 @@ function start(markerUrl, video, input_width, input_height, render_update, track
context_process.drawImage(video, 0, 0, vw, vh, ox, oy, w, h);

const imageData = context_process.getImageData(0, 0, pw, ph);
worker.postMessage({ type: 'process', data: imageData }, [imageData.data.buffer]);
worker.postMessage({ type: 'process', imagedata: imageData }, [imageData.data.buffer]);
}

const tick = function () {
Expand Down
14 changes: 7 additions & 7 deletions examples/worker_threejs.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
importScripts("../dist/WebARKit.js");

var ar;
var next = null;
var markerResult = null;
let next = null;
let markerResult = null;

self.onmessage = (e) => {
var msg = e.data;
const msg = e.data;
switch (msg.type) {
case "initTracker": {
initTracker(msg);
return;
}
case "process": {
next = msg.data;
next = msg.imagedata;
processFrame();
return;
}
}
};

function initTracker(msg) {
var trackerType = msg.trackerType;
const trackerType = msg.trackerType;
//console.log("msg from initTracker: ", msg);

var onLoad = function (wark) {
const onLoad = function (wark) {
ar = wark;
//console.log("wark: ", wark)
wark.setLogLevel(WebARKit.WebARKitController.WEBARKIT_LOG_LEVEL_DEBUG);
wark.loadTrackerGrayImage(msg.imageData, msg.imgWidth, msg.imgHeight, WebARKit.WebARKitController.RGBA);

var cameraProjMat = wark.getCameraProjectionMatrix();
const cameraProjMat = wark.getCameraProjectionMatrix();
console.log("camera proj Mat: ", cameraProjMat);

postMessage({
Expand Down

0 comments on commit 771a085

Please sign in to comment.