aframe

How do you change the mouse pointer style in A-Frame

家住魔仙堡 提交于 2020-05-28 04:55:24
问题 I don't want the default drag hand. I just want the normal mouse pointer and CSS isn't doing it. 回答1: You have to override CSS: .a-canvas.a-grab-cursor:hover{cursor:default !important}.a-canvas.a-grab-cursor:active,.a-grabbing{cursor:default !important} 来源: https://stackoverflow.com/questions/39817522/how-do-you-change-the-mouse-pointer-style-in-a-frame

aframe register componet add onclick attribute

不想你离开。 提交于 2020-05-17 08:49:58
问题 I want to create dynamic componet using aframe But I cannot add onclick on my component this my code AFRAME.registerComponent('cylinders', { init: function(){ let el = this.el; let sceneEl = document.getElementById('scene1'); let cyl = document.createElement('a-cylinder'); cyl.setAttribute('position', '0 0 0'); cyl.setAttribute('rotation', '0 0 0'); cyl.setAttribute('scale', '0 0 0'); cyl.setAttribute('radius', 1); cyl.setAttribute('height', 0.1); cyl.setAttribute('color', '#39BB82'); cyl

A-Frame Kinematic-body camera height problem

久未见 提交于 2020-03-25 16:06:26
问题 I have a problem where I need my camera to be a Kinematic-body and collide with wall elements however I cannot get it to stay at a fixed y-axis height of 1.6. I need a way to keep the camer a this height while maintaining its kinematic-body attribute because I need wall collisions to work. I have attached the code which I have been stuck on so far. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http

A-frame move forward in camera direction

為{幸葍}努か 提交于 2020-02-23 04:36:05
问题 I'm trying to make a component in A-frame that will move the player/camera in the direction the camera is facing. It should not move anywhere on the y plane, only in the x/y plane. The current setup in the dom is: <a-entity> <a-camera></a-camera> </a-entity> I want to move the entity element position to x units in the current camera direction but it should not move anything on the y-plane. I have tried various solutions but they seem to introduce some weird shift in the camera. 回答1: You could

A-frame mouse-tracking changes when scene is embedded

痴心易碎 提交于 2020-02-07 23:05:06
问题 I am creating a desktop/mobile/VR game using A-frame, involving finding a number of hidden items in an image. The image is used as the source for an entity, creating a 360-dgree image. In the desktop version, the user can use the mouse to pan around the image, and then click on the hidden items to reveal them. The reveal is done by positioning an entity, with an image as it's texture, in front of the hidden item, and then animating the to become visible when clicked on. The game works

How do you properly load a GTLF file in A-Frame (Specifically in glitch?)

淺唱寂寞╮ 提交于 2020-01-26 04:03:29
问题 I downloaded a 3d model in .gltf from a website like sketchfab. If I drag the compressed .zip file into my assets folder and get a link that a-frame can use for it, it does not work. 回答1: The easiest way to do this is to 1 Extract your zip file. Extract your zip file by right clicking on it in file explorer and pressing "extract all" 2 Open the new folder Now that you have extracted your .gltf file, you should automatically be brought either 2 or 3 files. They may be textures scene and scene

Use camera as background, while display objects in A-frame

断了今生、忘了曾经 提交于 2020-01-16 18:54:35
问题 I want to use camera video feed as background in a-frame, while overlaying objects on it. I know it is possible but I don't know how exactly to do it. so I am here to ask for help! 回答1: You can have a simple overlay by adding an element before the scene: <img src='overlay.jpg' /> <a-scene></a-scene> fiddle here. Here is a nice article about using a camera stream, I'll just use a basic version of it: html <video autoplay></video> <a-scene></a-scene> js // grab the video element const video =

aframe: how does look-controls set its initial values

此生再无相见时 提交于 2020-01-15 19:16:49
问题 When an AFrame <scene> gets loaded and a camera component has been set with look-controls enabled, how does the current orientation of the device (mobile) set the values of rotation and position of the camera? Since a scene will have a certain point of origin. I have found that when open the scene from different positions the initial view is different, while I would like it to be the "look ahead" view. The code is simple: <a-entity camera="userHeight:1.6" look-controls></a-entity> 回答1: look

A-Frame / THREE.js, Simplify modifier on gltf[glb] models

六月ゝ 毕业季﹏ 提交于 2020-01-15 10:34:30
问题 One of the examples in three simplify modifier found here https://github.com/mrdoob/three.js/blob/dev/examples/js/modifiers/SimplifyModifier.js I understand it takes in a geometry, and simplifies it. is there a way to do this with a gltf model? 回答1: Yes — refer to the simplifier example for full code, but the gist is that you can use SimplifyModifier as usual, except that you need to traverse the model in case it contains multiple meshes: var loader = new THREE.GLTFLoader(); loader.load( 'foo

Aframe Entity is seen

£可爱£侵袭症+ 提交于 2020-01-13 20:37:31
问题 I wanted to know how to have a Aframe Component for any entity that define if the entity is seen by the camera, like a bool attribute. "isSeen"= true || false I tried with trigonometry (knowing the rotation of the camera, and the Entities' positions), but I failed. 回答1: How about frustums: checking out if a point(x, y ,z) is within the camera's field of view . The code is quite simple. To use it within a-frame, You could create a component, which will check if the point is seen on each render