aframe

How to declare a “mask” material using A-Frame.js

你。 提交于 2019-12-11 04:25:29
问题 I'm trying to make a scene where there's a "hole in the wall". This requires a plane with square removed, and then a material applied to the plane with the following properties: Invisible to the camera Hides any other objects from being rendered that are behind it There's an example of this with three.js here, but how can I do it with the a-frame material syntax? 回答1: The "Mask". Looking at the box-hole example, to create the illusion, Lee creates two boxes. 1) The box which is "in the hole"

A-Frame not loading assets from Angular

梦想与她 提交于 2019-12-11 02:38:59
问题 im testing a-frame with ionic and angular. I get a-frame runs great with them, even tried on my device and looks awesome. The problem comes when i try to load an img on the a-sky from a property of the component. I got this working: <ion-content> <a-scene> <a-sky src="assets/puydesancy.jpg" rotation="0 -130 0"></a-sky> </a-scene> </ion-content> But if i try this: <a-scene> <a-assets> <img id="sky" [src]="myImgPath"> </a-assets> <a-sky src="#sky"></a-sky> </a-scene> Don't work and get this log

How to deallocate texture from memory in A-Frame?

点点圈 提交于 2019-12-11 01:13:52
问题 I’d like to know how to deallocate memory from assets that I no longer need in a particular scene. Currently, our assets textures are staying in memory after we unload the asset in a scene. <a-scene> <a-box src="texture.jpg"></a-box> </a-scene> 回答1: EDIT: The easiest way to dispose a texture is to grab an entity's material and call material.map.dispose() . For example, this.el.getObject3D('mesh').material.map.dispose() , until A-Frame can automatically handle it. You can get the texture

How to specify position of an aframe object using angular parameters?

隐身守侯 提交于 2019-12-10 23:13:09
问题 I am trying to specify the position of an aframe object using values set in the angular (version 4) component: <a-text value="Plane" position="{{billBoard.x}} {{billBoard.y}} {{billBoard.z}}" color="#806040" side="double"></a-text> Angular constructor: constructor() { this.billBoard['x'] = 1; this.billBoard['y'] = 3; this.billBoard['z'] = 6; } However, it ignores the values in the Angular component and just defaults to (0,0,0). What am I doing wrong? 回答1: You can't do string interpolation,

Hls video streaming on iOS/Safari

风流意气都作罢 提交于 2019-12-10 22:05:38
问题 I am trying to stream hls on safari iOS with Aframe that has three.js under the hood. But the video shows a black screen with just the audio playing. The video src is of type .m3u8. I tried to read through a lot of related posts but none seem to have a proper solution. Is it some kind of a wishful thinking getting HLS & WebGL to play on iOS? If not, can some one please help me with a solution. A couple of discussions on the issues that are available on github: HLS m3u8 video streaming HLS on

How to create a 180-degree/semisphere/segment/partial video sphere in A-Frame?

雨燕双飞 提交于 2019-12-10 15:23:48
问题 <a-videosphere src="myvideo.mp4"> displays a video on an entire 360-degree sphere, but I want to display a video or image, but only on a portion of a sphere like a hemisphere. Something like: (from MathWorld - A Wolfram Web Resource: wolfram.com) How would I do this in A-Frame? 回答1: You can use the sphere geometry ( <a-entity geometry="primitive: sphere"> or <a-sphere> ) and control the phiLength/thetaLength angles of the sphere to specify a segment. Theta length controls horizontal sweep

Aframe (how to?) Animate entity or entities with both simultaneous and sequential scaling/rotations/positions

牧云@^-^@ 提交于 2019-12-10 12:20:49
问题 This is the menu: How do I animate an entity, so that upon an event like a click, it does simultaneous scaling, rotation, positioning, and sequential scaling, rotation, positioning. <a-curve id="track1"> <a-curve-point position="4 2 -3"></a-curve-point> <a-curve-point position="6 5 -2"></a-curve-point> <a-curve-point scale="10 -3 -1"></a-curve-point> </a-curve> <a-cylinder position="5 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow> <a-animation alongpath="curve: #track1" begin=

How to embed an aframe scene into a div

风流意气都作罢 提交于 2019-12-10 10:28:29
问题 I am trying to embed a .OBJ model into an element so that it is confined to a specific width and height, instead of a full page canvas. I'm trying to replicate the "scene" embedded into the header of https://sketchfab.com/. I would like the camera in my scene to pan round the central axis of the model(just like in the example). I'm having trouble accomplishing this... so far, I am able to successful load the following afame scene into my browser: <a-scene> <a-box color="#6173F4" width="4"

Using Geo-coordintes Instead of Cartesian to Draw in Argon and A-Frame

[亡魂溺海] 提交于 2019-12-09 01:42:37
问题 I would like to create a GPS drawing program in Argon and A-Frame which draws lines based upon people's movements. Lines can be drawn in A-Frame with, for example, the meshline component which uses Cartesian points: <a-entity meshline="lineWidth: 20; path: -2 -1 0, 0 -2 0</a-entity> If I were to do this with a GPS device, I would take the GPS coordinates and map them directly to something like Google maps. Does Argon have any similar functionality such that I can use the GPS coordinates

Aframe asset unload

别等时光非礼了梦想. 提交于 2019-12-08 13:34:51
问题 I have created an aframe animation where lots of external png files are loaded in a sequence. Works like a charm on desktop, crashes smartphones with little RAM. Is there anything like an "asset unload" in aframe such as in three.js? Thanks for your answers. 回答1: In 0.2.0, you have to do: AFRAME.utils.texture.textureCache[yourimagesrc]['1 1'].then(function (texture) { texture.dispose(); }); In master (upcoming 0.3.0), you have to do: document.querySelector('a-scene').systems.material