Skip to content

Commit

Permalink
testing AR.js-core
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwalt committed Dec 19, 2024
1 parent 363c4e8 commit 35b10af
Show file tree
Hide file tree
Showing 13 changed files with 563 additions and 362 deletions.
3 changes: 2 additions & 1 deletion aframe/build/aframe-ar-new-location-only.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar-new-location-only.module.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion aframe/build/aframe-ar-nft.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar-nft.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aframe/build/aframe-ar.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions aframe/build/aframe-ar.module.js

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions aframe/src/component-anchor-nft.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as AFRAME from 'aframe';
import Anchor from '../../three.js/src/new-api/arjs-anchor';
import { AnchorDebugUI } from '../../three.js/src/new-api/arjs-debugui';
import ArToolkitContext from '../../three.js/src/threex/arjs-context';

//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)
////////////////////////////////////////////////////////////////////////////////
// arjs-anchor
//////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -100,11 +101,11 @@ AFRAME.registerComponent('arjs-anchor', {

if (_this.data.preset === 'hiro') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.patternUrl = Context.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'kanji') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.patternUrl = Context.baseURL + 'examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'area') {
markerParameters.type = 'barcode'
Expand Down
22 changes: 16 additions & 6 deletions aframe/src/component-anchor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import * as AFRAME from 'aframe';
import Anchor from '../../three.js/src/new-api/arjs-anchor';
import { AnchorDebugUI } from '../../three.js/src/new-api/arjs-debugui';
import ArToolkitContext from '../../three.js/src/threex/arjs-context';
//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)

////////////////////////////////////////////////////////////////////////////////
// arjs-anchor
Expand Down Expand Up @@ -59,6 +66,9 @@ 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 @@ -97,11 +107,11 @@ AFRAME.registerComponent('arjs-anchor', {

if (_this.data.preset === 'hiro') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.patternUrl = Context.baseURL + 'examples/marker-training/examples/pattern-files/pattern-hiro.patt'
markerParameters.markersAreaEnabled = false
} else if (_this.data.preset === 'kanji') {
markerParameters.type = 'pattern'
markerParameters.patternUrl = ArToolkitContext.baseURL + 'examples/marker-training/examples/pattern-files/pattern-kanji.patt'
markerParameters.patternUrl = Context.baseURL + '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 @@ -174,7 +184,7 @@ AFRAME.registerComponent('arjs-anchor', {
//////////////////////////////////////////////////////////////////////////////
var arWorldRoot = this._arAnchor.object3d
arWorldRoot.updateMatrixWorld(true)
arWorldRoot.matrixWorld.decompose(this.el.object3D.position, this.el.object3D.quaternion, this.el.object3D.scale)
//arWorldRoot.matrixWorld.decompose(this.el.object3D.position, this.el.object3D.quaternion, this.el.object3D.scale)

//////////////////////////////////////////////////////////////////////////////
// honor visibility
Expand Down
9 changes: 5 additions & 4 deletions aframe/src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Components
import "./component-anchor";
import "./component-hit-testing";
//import "./component-anchor";
//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,8 @@ 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 "./test";
import "./system-arjs";
6 changes: 3 additions & 3 deletions aframe/src/system-arjs-nft.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as AFRAME from 'aframe';
import Profile from '../../three.js/src/threex/arjs-profile';
import Session from '../../three.js/src/new-api/arjs-session-nft';
import { SessionDebugUI } from '../../three.js/src/new-api/arjs-debugui';
import {Profile} from '@ar-js-org/arjs-core';
import {Session} from '@ar-js-org/arjs-core';
import { SessionDebugUI } from '@ar-js-org/arjs-core';

AFRAME.registerSystem('arjs', {
schema: {
Expand Down
11 changes: 8 additions & 3 deletions aframe/src/system-arjs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as AFRAME from 'aframe';
import Profile from '../../three.js/src/threex/arjs-profile';
import Session from '../../three.js/src/new-api/arjs-session';
import { SessionDebugUI } from '../../three.js/src/new-api/arjs-debugui';
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 @@ -103,6 +107,7 @@ AFRAME.registerSystem('arjs', {

init: function () {
var _this = this
console.info("init")

// If videoTexture is set, skip the remainder of the setup entirely and just use the arjs-webcam-texture component
if(this.data.videoTexture === true && this.data.sourceType === 'webcam') {
Expand Down
Loading

0 comments on commit 35b10af

Please sign in to comment.