aframe

A-Frame & ar.js: Multiple markers & boxes

爷,独闯天下 提交于 2019-12-01 00:57:33
问题 Is there any proof of concept of how to implement multiple AR markers w/ A-Frame? Ex. Something like this: https://www.youtube.com/watch?v=Y8WEGGbLWlA The first video in this post from Alexandra Etienne is the effect I’m aiming for (multiple distinct AR "markers" with distinct content): https://medium.com/arjs/area-learning-with-multi-markers-in-ar-js-1ff03a2f9fbe I’m a bit unclear if when using multiple markers they need to be close to each-other/exist in the same camera view This example

gltf cursor-listener click event in A-frame

删除回忆录丶 提交于 2019-12-01 00:26:03
I am unable to figure out why cursor-listener works fine for all the entities except for my gltf model. Here is my html <div id="myEmbeddedScene"> <a-scene embedded=""> <a-assets> <a-asset-item id="ducks" src="../images/test.glb"></a-asset-item> </a-assets> <a-box cursor-listener color="#CCC" width="3" depth="3" height="0.1" position="0 0 -2"></a-box> <a-entity cursor-listener id="duck" gltf-model="#ducks" position="0 0.1 -2" rotation="0 -90 0"></a-entity> <a-camera> <a-cursor></a-cursor> </a-camera> </a-scene> </div> and here goes the cursor-listener component from a-frame AFRAME

How do I rotate a box in A-Frame by moving or dragging the mouse?

核能气质少年 提交于 2019-11-30 20:39:26
问题 How do I rotate a box in A-Frame by moving or dragging the mouse? I trying to do something like this: http://codepen.io/jordizle/pen/haIdo/ https://jsfiddle.net/MadLittleMods/n6u6asza/ Here is my code. <html> <head> <title>Rotation</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://aframe.io/releases/0.4.0/aframe.min.js"></script> </head> <body> <a-scene> <a-assets> <a-image id="a" src="Background.jpg"> </a-assets> <a-box id=

How to detect Desktop vs. Mobile vs. GearVR vs. Oculus Rift vs. Vive in A-Frame?

与世无争的帅哥 提交于 2019-11-30 09:14:55
In A-Frame, I want to detect if the user has a VR headset connected and to tell which device they are using. How can I do this? Desktop (no VR display) Mobile (e.g., webvr-polyfilled Google Cardboard, iPhone, Android) Samsung GearVR Oculus Rift HTC Vive There are several utility functions in A-Frame we can use to detect compatibility: https://aframe.io/docs/master/core/utils.html The mobile-related utils look at navigator.userAgent . The VR-related utils check to see if the pose data returned from the headset/polyfill is not 0,0,0. Given the current API: Desktop: !AFRAME.utils

aframe - Set camera position at runtime

三世轮回 提交于 2019-11-30 07:39:33
问题 In a a-scene, I try to change my camera position at runtime. The DOM property changes but the camera does not move. What could have I missed ? my js code: document.querySelector('#myCameraPosition').setAttribute('position', '0 0 0'); My a-scene: <a-entity id="myCameraPosition" position="0 0 50"> <a-entity id="myCamera" camera look-controls keyboard-controls> </a-entity> </a-entity> 回答1: Create a wrapper entity around the camera: <a-entity id='cameraWrapper' position="0 0 0"> <a-camera></a

Disable A-Frame inspector (for production)

蹲街弑〆低调 提交于 2019-11-29 16:56:27
Hello fellow AFrame developers, I would like to disable the inspector (Ctrl+Alt+I), for my production environment so the user can't open it and see the whole backstage of my game. Moreover, I'm sure that the size of my app will be significantly lower without this. I can see that the inspector is never disabled in all the examples I found online, so I'm wondering if this is even possible... This piece of documentation mentions this : "Not only can we open our local scenes inside the Inspector, we can open any A-Frame scene in the wild using the Inspector (as long as the author has not

Aframe, VR website, unable to turn left right using android phone

懵懂的女人 提交于 2019-11-29 16:26:45
I have been working on this VR website for my project for sometime. It used to be able to allow user to view left/right side of the virtual world by moving your phone to the left/right. However, just recently, it suddenly did not work for android phone. I have tested on iphone/ipad, still works as per normal. But for some reason, i tried using note8 , s7 it doesnt work anymore. Would really appreciate if you can identify whats the problem, and how can I fix it? Thank you very much. Try using firefox on android, or the built-in samsung internet app. If everything works as expected, it means you

Play sound on click in A-Frame

允我心安 提交于 2019-11-29 16:19:21
So I'm struggling to find a solution to play/stop/pause sound on "click" i.e. when focusing with a black dot with A-Frame sound entity... What I would like to have is a plain, shape or whatever with a play/pause image on it, which would trigger audio when focused. Did anyone encounter something similar perhaps? <audio id="sound" crossorigin="anonymous" preload="auto" src="some-audio-file.mp3"></audio> ... would trigger something like sound="on: click; src: #sound" try making a custom component AFRAME.registerComponent('audiohandler', { init:function() { let playing = false; let audio =

Can't import A-frame into component - Angular2

这一生的挚爱 提交于 2019-11-29 15:38:09
I have a project created with angular-cli where I have installed aframe via npm install aframe --save , and when I try to import it in the component via import 'aframe'; it causes the following error: Failed to execute registerElement on Document : Registration failed for type a-node . A type with that name is already registered. In this case, the only way to make it work is by importing the library in the <head> tag of the index.html file. Instead I would like to access aframe object3D to modify objects entities, as shown here: AFRAME.registerComponent('foo', { init: function () { // Do

How to detect when a scene is loaded in A-Frame?

强颜欢笑 提交于 2019-11-29 14:36:05
Is there some event that is triggered when A-Frame is fully loaded? Right now I’ve managed to get my document.querySelector(".a-enter-vr-button") working, but only after placing it inside a setTimeout function, which seems a bit of a makeshift solution. So if anyone has any way of making a js script fire after A-Frame has fully loaded please let me know! You can use the loaded event: document.querySelector('a-scene').addEventListener('loaded', function () {...}) But we recommend using components so you don't have to handle waiting on events for things to get set up: https://aframe.io/docs/0.4