aframe

How do a place the camera first position

拟墨画扇 提交于 2019-12-12 04:12:30
问题 I am searching . I can a set the first position of my camera in A-Frame. I am looking for how to set the first view of the camera. 回答1: If by "view" you mean the angle the camera is pointed, you can do this by setting the rotation attribute on the parent of the <a-camera> entity. Example: <a-entity position="0 0 5" rotation="0 90 0"> <a-camera></a-camera> </a-entity> By rotating 90 degrees on the y-axis, the camera is pointed to the left of the scene (0 degrees would be facing front). 来源:

How do I add image assets at runtime?

我与影子孤独终老i 提交于 2019-12-12 03:06:02
问题 I've got an entity like this: <a-entity id="entity1" position="0 0 -1" geometry="primitive: plane; width: 1" material="src: #myTexture; opacity:0.9; transparent:true;"> I'm attempting to assign a new Base64 image string like this: myTexture.setAttribute('src','data:image/png;base64,xxx'); This seems to work in that myTexture appears to contain the new image. However, entity1 is not updated with that new material. Does anybody know how to fix it? 回答1: Modify the entity rather than the stuff in

A-Frame IOS Inline video Phonegap

夙愿已清 提交于 2019-12-12 02:39:25
问题 Does anyone know if its possible to play inline video via A Frame in a Phonegap app? I can get inline video working on my IPhone if the webpage is pinned to the home screen and I access the web page that way. (How people are using it here: https://github.com/aframevr/aframe/issues/316) When I try and run the page via phone gap, the video opens up in full screen. I have pinned the server address to my homepage. I don't know much about phone gap (its the first time i have used it) but have

A-sphere show text on mouse over or attach a text to a-sphere

穿精又带淫゛_ 提交于 2019-12-12 02:26:16
问题 Is it possible to add text to a-sphere or a-box ? or may be show a text box on mouse over on a-sphere? I've seen the example in A-frame, but it is not exactly what I want. My idea is to tag a sphere or a box with a text or text box. 回答1: <script> AFRAME.registerComponent('hover-text', { schema: { value: {default: ''} }, init: function () { var data = this.data; var el = this.el; el.addEventListener('mouseenter', function () { el.setAttribute('text', {content: data.content}); }); } }); <

AFrame: how to add a touch event listener to an entity

谁说我不能喝 提交于 2019-12-12 02:22:22
问题 In mobile browser, I want to do something when user touches an image, but I don't know how to use touch listeners. Is there some components that I can use? Or give me some idea how to do it on my own. 回答1: A-Frame supports DOM events very similarly to web normal pages. Example: <a-scene> <!-- Target --> <a-box id="target" material="color: green"></a-box> <!-- Camera + Cursor --> <a-entity camera> <a-entity cursor="fuse: true; fuseTimeout: 500" position="0 0 -1" geometry="primitive: ring;

A-Frame: rotate entity on mouse down using laser-controls

徘徊边缘 提交于 2019-12-11 18:45:38
问题 I have a component which is set on the entity which should be rotated on a mousedown event: AFRAME.registerComponent('spin', { init: function () { var self = this; this.mouse_down = false; // assuming only one controller for now this.laser = document.querySelectorAll('.laser-controls')[0]; this.el.addEventListener('mousedown', function (e) { self.mouse_down = true; }); this.el.addEventListener('mouseup', function (e) { self.mouse_down = false; }); }, tick: function() { if (this.mouse_down) {

Need web-based AR solutions for Plane detection

大城市里の小女人 提交于 2019-12-11 18:01:32
问题 I am searching for solutions for web-based solutions for AR using marker-less detection i.e using plane detection or object detection. Tried using a-frame framework and three.js but they are only marker-based detection technique to render 3d object. 回答1: I’ve been searching for the same and found 8th Wall https://8thwall.com It works well, and have a few different pricing tiers including a free one. 来源: https://stackoverflow.com/questions/54306700/need-web-based-ar-solutions-for-plane

AFRAME text-geometry component rotation from center?

五迷三道 提交于 2019-12-11 17:57:46
问题 Is there a way to setup the pivot point to be in the center? I am using text-geometry component and it rotates from a corner. i would like to make the text spin from the center. <a-entity animation="property: rotation; dur: 5000;to: 0 360 0;loop:true;easing:linear" position="0 4 -3" scale="0.6 1.2 1" text-geometry="value: MultiMedia; font: #dawningFont; bevelEnabled: true; bevelSize: 0.1; bevelThickness: 0.1; curveSegments: 1; size: 1.5; height: 0.5;" material="color:yellow; metalness:0.9;

how can i add entity on cursor position using aFrame

五迷三道 提交于 2019-12-11 17:53:30
问题 i need to know how i can add entity on position cursor using aFrame on click i want to add entity far from camera 2 meter away or something like that or i need to know how can i get position on click event (x,y,z) but the problem here i what to add entity on 360 photo and i using a-sky tag and i tried to get position using js but i Failed it's working on entity only this.el.addEventListener('click', function (evt) { console.log('I was clicked at: ', evt.detail.intersection.point); for Example

Aframe Ray caster Intersection

房东的猫 提交于 2019-12-11 17:43:53
问题 After Switching to Master build of Aframe The raycaster intersection event seems to become null although i kept the exact same code : <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@efcc8a0a919811fe5bd4ab6fd60bfbb8e85a98a1/dist/aframe-master.min.js"></script> with the Registered Component : AFRAME.registerComponent('collider-check', { dependencies: ['raycaster'], init: function () { this.el.addEventListener('raycaster-intersected', function (evt) { console.log(evt.detail.intersection