aframe

Control HTML Objects with A-Frame Entity

戏子无情 提交于 2019-12-25 19:02:07
问题 Is it possible to control regular html objects outside of a-scene using A-Frame entities? For example, I would like to toggle a modal object when selecting a plane, sphere, etc. within an embedded scene. I know about the UI Modal that can be displayed within the scene, but the ability to operate between the scene and "exterior" elements would be very powerful. I'm sure this is possible, but I do not have the VR developer skills yet to figure this one out! Thanks in advance for your help! 回答1:

how to set “objects” property in aframe raycaster component

浪尽此生 提交于 2019-12-25 08:23:18
问题 I want to use raycaster component in <a-cursor> entity to intersect some cubes. I set the objects property like '#box' (my cube's id), but the cursor still intersects all element. I step into the raycaster source code, and the data.objects is '' . So, I wonder if I set the property in a wrong way? 回答1: There was a bug in A-Frame with dependency components. It's been fixed in the Dev Builds: https://github.com/aframevr/aframe/tree/master/dist#dev-builds and will be released with 0.4.0. A

A-Frame cursor listener on sky element not firing

旧时模样 提交于 2019-12-25 08:16:54
问题 I am trying to attach a cursor listener to a sky element (equirectangular image as texture mapped to sphere) in A-Frame. The ultimate goal is to get the 2D coordinates of the texture at the point the cursor intersects with the sphere on click. However, I currently can't get the click event to fire at all. Any thoughts? <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Hello, World! - A-Frame</title> <meta name="description" content="Hello, World! - A-Frame"> <script src="aframe.js">

Aframe Android Chrome Camera looks always backward [closed]

删除回忆录丶 提交于 2019-12-25 04:11:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Hidiho Community, I have this issue that when I open an aframe-webpage with my Android phone that the camera (or the scene) turns 180 degrees. I use the normal Aframe example https://aframe.io/examples/showcase/helloworld/ but it still happens some ideas how to fix that? I already tried setting the camera rotation

How is properly to make pool with 10 <a-sphere>s A-frame

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 00:14:10
问题 Have a task: create 10 sphere objects, put them in pool; on each click got each sphere from pool and show to user at cursor intersection point. Problem: can't figure how to properly create and after this, put it to pool. Please check code below. Currently each sphere create dynamicly like this: (in a-scene on click event) let {x, y, z} = event.detail.intersection.point sceneEl.insertAdjacentHTML('beforeend', `<a-sphere data-coords="[${x}, ${y}, ${z}]" data-clickable position="${x} ${y} ${z}"

Aframe: How do I link entities, so the user can link/unlink entities, and so entities will animate together, and interact together

不打扰是莪最后的温柔 提交于 2019-12-24 23:56:42
问题 How would I link and unlink multiple entities together so that they can be animated together. An example is that there is a small pile of entities. When I click on this pile it spreads apart and floats upwards towards the user, so it's not a pile any more but a series of discreet entities each separated by a small distance. The pile exists of 3 entities A, B, and C If I click on the entity with id A then they all scale/position/rotate back into a pile. If I click on entity id B then all

A-Frame “start experience” button

旧巷老猫 提交于 2019-12-24 22:56:34
问题 I want to create a start experience like button on my A-Frame design. My experience needs to hide until you press a button and then it appears 回答1: Two approaches: 1) Hide the a-frame scene until a html button is pressed This one is simple. Bring a white <div> up front (by setting up a high z-index ), and hide it ( display: none ) when a button is clicked. Fiddle here. 2) Hide the experience content "in-game" This one is a bit harder. Hide the a-camera within a white sphere with a button, and

AFRAME position far away from camera

依然范特西╮ 提交于 2019-12-24 20:30:21
问题 Following this question AFRAME screen to world position I can get the position of the vector, but it seems to be very close to camera, how do I get it around 100px further away from the camera? let mouse = new three.Vector2() let camera = AFRAME.scenes[0].camera let rect = document.querySelector('body').getBoundingClientRect() mouse.x = ( (e.clientX - rect.left) / rect.width ) * 2 - 1 mouse.y = - ( (e.clientY - rect.top) / rect.height ) * 2 + 1 let vector = new three.Vector3( mouse.x, mouse.y

How do I allow a browser on IOS 13 to access my iPhone 6s' Gyroscope?

荒凉一梦 提交于 2019-12-24 19:22:51
问题 Original Question I am attempting to run a webVR program using A-Frame on my iPhone 6s, and these three browsers I have tested do not have access to my gyroscope. Safari Chrome Firefox I believe this could be fixed if the apps had the permission to, but there is not an easy way to do this switch that I have found. If anyone can give me a way to do this (without jailbreaking) it would be appreciated. Currently when I enter https://vrfinal.glitch.me and switch to google cardboard view on chrome

Video Playback in Augmented Reality On Detecting Marker Using A Frames

孤人 提交于 2019-12-24 18:53:00
问题 I want to Play A video when the marker(HIRO) is detected using the webcam. When I remove it should be paused and when the marker is detected the video should play using A-Frame. I had written the code but it's not working. Can anyone help me? I tried all possible way but it's not working so, Can Anyone post the code or send an example. When you see the marker - play the video. Once you lose the marker - pause the video Eg : Video Augmentation AFRAME.registerComponent('vidhandler', { init: