Comments (2)
Hi great people
I found a solution.
It is based on the following link: https://codepen.io/evces/pen/vYrwQXW
In essence I made a custom interactable Three.js scene, so I have complete control over my objects.
const THREE = window.MINDAR.IMAGE.THREE;
window["mindarThree"] = new window.MINDAR.IMAGE.MindARThree({
container: document.querySelector("#container"),
imageTargetSrc: "static/assets/lady/targets.mind"
});
const {renderer, scene, camera} = window["mindarThree"] ;
const anchor = window["mindarThree"] .addAnchor(0);
const geometry = new THREE.BoxGeometry(1, 1,1);
const material = new THREE.MeshBasicMaterial( {color: 0x00ffff, transparent: true, opacity: 0.5} );
window["plane"] = new THREE.Mesh( geometry, material );
anchor.group.add( window["plane"]);
const start = async() => {
await window["mindarThree"].start();initMarkCheck();
renderer.setAnimationLoop(() => {
window["planepos"] = window["plane"].getWorldPosition(new THREE.Vector3());
window["planescale"] = window["plane"].getWorldScale(new THREE.Vector3());
var quaternion = new THREE.Quaternion();//REF/ https://stackoverflow.com/questions/55192521/what-to-do-now-three-getworldrotation-has-gone
window["planerot"] = window["plane"].getWorldQuaternion( quaternion )
let campos = camera.getWorldPosition(new THREE.Vector3());
//console.log(`Camera: ${campos.x},${campos.y},${campos.z}`);
//console.log(`Plane: ${window["planepos"].x},${window["planepos"].y},${window["planepos"].z}`);
window["plane"].lookAt(new THREE.Vector3());
renderer.render(scene, camera);
});
}
I hope someone will be able to use this information (was a looooong search).
I wish you all a great day.
Kind regards
JN
from mind-ar-js.
Hey, man. I think this is related to my issue as well.
It was mentioned on the docs that the AR engine only changes the position and the rotation of the entity in A-Frame but somehow, var rotationDegrees = this.videoPlane.getAttribute('rotation') doesn't work.
Tried getting the rotation property of both the a-entity and the a-plane, but the values don't change.
I'm planning to create a photocard that when rotated 180 degrees, plays another video and goes back to the original video when rotated back in real life.
how do I implement this? Do you know if we can do this using the A-Frame version or this solution only works with the Three JS version?
from mind-ar-js.
Related Issues (20)
- How to import custom 3d model HOT 3
- Three-facemesh in A-Frame
- *IMPORTANT* Target Compiler BROKEN HOT 1
- Ocluder does not transform HOT 1
- Is this repo abandonware? Should I switch to ar.js? HOT 2
- Can track multiple faces on face-tracking?
- Anyone has added body tracking?
- Device Orientation issues
- Image tracking: video shows is distorted
- How to Estimate Real Environment Light and Project Dynamic Fake Light in a Marker-Based AR Project?
- Selecting a gltf animation
- Uncaught runtime error: Undefined is not an object (evaluating 'this.tracker dummyRun') HOT 1
- Render the rest of the A-Frame Scene outside the MindAR Target HOT 1
- Ionic cordova iOS camera preview with MindAR HOT 1
- Front camera image tracking
- .mind file not genrated
- How to get the rotation values of the current scanned target
- Video playback is not smooth , frame stuck
- Multiple image targets with same content
- arSystem.pause(true) -> targetLost not calling HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mind-ar-js.