aframe

How to include script to head in angular.json

佐手、 提交于 2021-02-20 09:06:50
问题 I would like to import aframe in the <head> tag using the angular.json config as a separate bundle. Inside angular.json I have the script to import from my node_modules: "scripts": [ "node_modules/aframe/dist/aframe-v1.0.0.min.js" ] This is bundled and imported at the bottom on the html body. <body> <app-root></app-root> ... <script src="scripts.js" ...> </body> This is not desirable as the library specifically requests that I import in the <head> . Additionally, I would like to import it as

drop and drag object in A-Frame

放肆的年华 提交于 2021-02-20 05:20:07
问题 I want to drop and drag object in A-Frame. I used <script src="https://unpkg.com/aframe-click-drag-component"></script> I also saw this problem has been answered in this post. However it is not working in my case. here is sample code between <a-scene> tag: <a-entity click-drag position="-2 -1 -1"> <a-obj-model checked="off" visible="false" id="deer1" src="#deer11" mtl="#deer11-material" scale="0.1 0.1 0.1" rotation=" 0 -40 0"> <a-animation attribute="scale" begin="mouseenter" to="0.2 0.2 0.2"

A-frame js camera rotation with look-controls [closed]

谁说胖子不能爱 提交于 2021-02-20 03:41:07
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Improve this question I am trying to rotate camera with look-controls.Camera is rotating fine without look-controls.Can somebody tell me how can i rotate camera with look-controls? 回答1: You'll need to remove or disable look-controls if you're overriding camera rotation manually. You can remove the

Chrome on android: touchevent not work on a-entity click

删除回忆录丶 提交于 2021-02-11 14:02:39
问题 The problem of question is: click event via touch click on mobile from VR mode not work from android Chrome 79+. Otherwords touchstart event does not fired on entity from VR mode. Google Vr services are installed and enabled. The goal a-entity should be clickable in Chrome latest 79+ on user click (VR mode touch click from mobile) Links to whole code: here 2 config simple app: https://4dkly.csb.app/ (config: fuse 3.6sec; but click on entity does Not work from chrome vr) https://codesandbox.io

gltf2.0 not showing in ar.js project

夙愿已清 提交于 2021-02-11 12:42:52
问题 I have created an ar.js tryout page like this: <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script> <script src="https://rawgit.com/donmccurdy/aframe-extras/master/dist/aframe-extras.loaders.min.js"></script> <script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script> <body style='margin : 0px; overflow: hidden;'> <a-scene embedded arjs='sourceType: webcam;'> <!-- handle marker with hiro preset --> <a-marker preset='hiro'> <a-entity gltf-model

Maintain aspect on Three.js texture

社会主义新天地 提交于 2021-02-10 15:57:16
问题 I'm trying to keep a texture centered when it's shown in a different sized box. I've seen this answer Three.js: Make image texture fit object without distorting or repeating But it's not quite doing it for me. this.texture = new THREE.Texture(this.image) const vec = new THREE.Vector3() new THREE.Box3().setFromObject( this.rounded ).getSize(vec) const imageAspect = this.image.width/this.image.height const boxAspect = vec.x/vec.y this.texture.wrapT = THREE.RepeatWrapping; this.texture.offset.y

Maintain aspect on Three.js texture

廉价感情. 提交于 2021-02-10 15:56:48
问题 I'm trying to keep a texture centered when it's shown in a different sized box. I've seen this answer Three.js: Make image texture fit object without distorting or repeating But it's not quite doing it for me. this.texture = new THREE.Texture(this.image) const vec = new THREE.Vector3() new THREE.Box3().setFromObject( this.rounded ).getSize(vec) const imageAspect = this.image.width/this.image.height const boxAspect = vec.x/vec.y this.texture.wrapT = THREE.RepeatWrapping; this.texture.offset.y

Maintain aspect on Three.js texture

Deadly 提交于 2021-02-10 15:56:13
问题 I'm trying to keep a texture centered when it's shown in a different sized box. I've seen this answer Three.js: Make image texture fit object without distorting or repeating But it's not quite doing it for me. this.texture = new THREE.Texture(this.image) const vec = new THREE.Vector3() new THREE.Box3().setFromObject( this.rounded ).getSize(vec) const imageAspect = this.image.width/this.image.height const boxAspect = vec.x/vec.y this.texture.wrapT = THREE.RepeatWrapping; this.texture.offset.y

Problems with changing color of gltf object

 ̄綄美尐妖づ 提交于 2021-02-08 23:43:23
问题 With this answer as a reference, I have succeeded in changing the color of the gltf model. (Change the color of an object (.dae or gltf) in "AR.JS") However, the model texture will disappear. why? <!-- A FRAME --> <script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script> <script src="https://unpkg.com/aframe-orbit-controls@1.2.0/dist/aframe-orbit-controls.min.js"></script> <script> AFRAME.registerComponent('carman', { init: function(){ let el = this.el; let self = this; self.cars

Multiple aframe animations

百般思念 提交于 2021-02-08 08:55:28
问题 I have built a scripted animation from point A to B to C and so on. Animations are triggered via JS (e.g document.getElementById('camera').emit('animazione_zero_avanti')). I am creating animations like this: i would like to add a Z-Axis rotation as well to the first animation. Can an animation have multiple attributes? Thanks in advance. 回答1: You can add multiple elements. Though note that rotating the camera or taking control of it is heavily not recommended for VR due to sickness. And you