Skip to content

Commit

Permalink
various testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwalt committed Feb 5, 2025
1 parent 7bfc66c commit a1c8e84
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
6 changes: 2 additions & 4 deletions aframe/src/component-anchor-nft.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import * as AFRAME from 'aframe';
//import Anchor from '../../three.js/src/new-api/arjs-anchor';
//import {Anchor} from '@ar-js-org/arjs-core';
import ARjsCore from '@ar-js-org/arjs-core';
const { Anchor, AnchorDebugUI, Context} = ARjsCore;
console.log(Anchor)
const {Anchor, AnchorDebugUI, Context} = ARjsCore;
//console.log(Anchor)
////////////////////////////////////////////////////////////////////////////////
// arjs-anchor
//////////////////////////////////////////////////////////////////////////////
Expand Down
15 changes: 4 additions & 11 deletions aframe/src/component-anchor.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import * as AFRAME from 'aframe';
//import {ARjsCore} from '@ar-js-org/arjs-core';
import ARjsCore from '@ar-js-org/arjs-core';
import { log } from 'aframe';
const {Anchor, AnchorDebugUI, Context} = ARjsCore;
//import { AnchorDebugUI } from '@ar-js-org/arjs-core';
//import {ArToolkitContext} from '@ar-js-org/arjs-core';



//console.log(Anchor)

Expand Down Expand Up @@ -66,9 +60,6 @@ AFRAME.registerComponent('arjs-anchor', {
init: function () {
var _this = this

console.log(this.el.sceneEl.systems.arjs);


// get arjsSystem
var arjsSystem = this.el.sceneEl.systems.arjs || this.el.sceneEl.systems.artoolkit

Expand Down Expand Up @@ -107,11 +98,11 @@ AFRAME.registerComponent('arjs-anchor', {

if (_this.data.preset === 'hiro') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = Context.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.patternUrl = Context.baseURL + 'three.js/examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'kanji') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = Context.baseURL + 'examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.patternUrl = Context.baseURL + 'three.js/examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'area') {
markerParameters.type = 'barcode'
Expand Down Expand Up @@ -183,6 +174,8 @@ AFRAME.registerComponent('arjs-anchor', {
// honor pose
//////////////////////////////////////////////////////////////////////////////
var arWorldRoot = this._arAnchor.object3d
//console.log(arWorldRoot);

arWorldRoot.updateMatrixWorld(true)
//arWorldRoot.matrixWorld.decompose(this.el.object3D.position, this.el.object3D.quaternion, this.el.object3D.scale)

Expand Down
6 changes: 3 additions & 3 deletions aframe/src/index-nft.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Components
import "./component-anchor-nft";
import "./component-hit-testing";
//import "./component-hit-testing";

// Location-based components
import "./location-based/arjs-look-controls";
/*import "./location-based/arjs-look-controls";
import "./location-based/arjs-webcam-texture";
import "./location-based/ArjsDeviceOrientationControls";
import "./location-based/gps-camera";
Expand All @@ -12,7 +12,7 @@ import "./location-based/gps-projected-camera";
import "./location-based/gps-projected-entity-place";
import "./new-location-based/gps-new-camera";
import "./new-location-based/gps-new-entity-place";
import "./new-location-based/arjs-device-orientation-controls";
import "./new-location-based/arjs-device-orientation-controls";*/

// System
import "./system-arjs-nft";
2 changes: 1 addition & 1 deletion aframe/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Components
//import "./component-anchor";
import "./component-anchor";
//import "./component-hit-testing";

// Location-based components
Expand Down
5 changes: 2 additions & 3 deletions aframe/src/system-arjs-nft.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as AFRAME from 'aframe';
import {Profile} from '@ar-js-org/arjs-core';
import {Session} from '@ar-js-org/arjs-core';
import { SessionDebugUI } from '@ar-js-org/arjs-core';
import ARjsCore from '@ar-js-org/arjs-core';
const {Profile, Session, SessionDebugUI} = ARjsCore;

AFRAME.registerSystem('arjs', {
schema: {
Expand Down
14 changes: 9 additions & 5 deletions aframe/src/system-arjs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import * as AFRAME from 'aframe';
import ARjsCore from '@ar-js-org/arjs-core';
const {Profile, Session, SessionDebugUI} = ARjsCore;
/*import {Profile} from '@ar-js-org/arjs-core';
import {Session} from '@ar-js-org/arjs-core';
import { SessionDebugUI } from '@ar-js-org/arjs-core';*/

console.log(Profile)

AFRAME.registerSystem('arjs', {
schema: {
Expand Down Expand Up @@ -126,6 +121,9 @@ AFRAME.registerSystem('arjs', {
.performance(this.data.performanceProfile)
.defaultMarker()

// console.log(arProfile);


//////////////////////////////////////////////////////////////////////////////
// honor this.data and setup arProfile with it
//////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -165,6 +163,8 @@ AFRAME.registerSystem('arjs', {
var scene = _this.el.sceneEl.object3D
var camera = _this.el.sceneEl.camera
var renderer = _this.el.sceneEl.renderer
//console.log(renderer);


//////////////////////////////////////////////////////////////////////////////
// build ARjs.Session
Expand All @@ -176,6 +176,8 @@ AFRAME.registerSystem('arjs', {
sourceParameters: arProfile.sourceParameters,
contextParameters: arProfile.contextParameters
})
//console.log(arSession);


//////////////////////////////////////////////////////////////////////////////
// Code Separator
Expand All @@ -190,6 +192,8 @@ AFRAME.registerSystem('arjs', {
window.addEventListener('resize', onResize)
function onResize() {
var arSource = _this._arSession.arSource
//console.log(arSource);


// ugly kludge to get resize on aframe... not even sure it works
if (arProfile.contextParameters.trackingBackend !== 'tango') {
Expand Down

0 comments on commit a1c8e84

Please sign in to comment.