webvr

CORS error when I load image from another server inside a-sky tag

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 04:34:51
I am trying to to use a texture from my own hosted webserver but putting it into the asset-item tag I get the following error. > Access to Image at 'http://192.168.137.1:3000/cat2.jpg' from origin > 'http://localhost' has been blocked by CORS policy: No > 'Access-Control-Allow-Origin' header is present on the requested > resource. Origin 'http://localhost' is therefore not allowed access. The picture is accessible, since I can see it in the webinspector. It works perfectly in a simple image tag. Does anyone know what to do here? Thanks! Update: My code you could find below: <script src="https:

How to load a new scene in A-Frame?

穿精又带淫゛_ 提交于 2019-12-01 12:20:30
I am using A-Frame (JavaScript library). I would like to load a new scene when user clicks into a certain component in the current scene. How can I achieve this? ngokevin Check out the A-Frame Template Component . Notably the Swapping Example . You can either define your separate scenes within script tags or within separate files. Here is an example with script tag templating: <a-scene> <!-- Templates. --> <a-assets> <script id="scene1" type="text/html"> <a-box></a-box> </script> <script id="scene2" type="text/html"> <a-sphere></a-sphere> </script> </a-assets> <a-entity template="src: #box"><

How to load a new scene in A-Frame?

对着背影说爱祢 提交于 2019-12-01 11:33:54
问题 I am using A-Frame (JavaScript library). I would like to load a new scene when user clicks into a certain component in the current scene. How can I achieve this? 回答1: Check out the A-Frame Template Component. Notably the Swapping Example. You can either define your separate scenes within script tags or within separate files. Here is an example with script tag templating: <a-scene> <!-- Templates. --> <a-assets> <script id="scene1" type="text/html"> <a-box></a-box> </script> <script id="scene2

Preventing camera from going 'through' aframe object

别说谁变了你拦得住时间么 提交于 2019-12-01 09:21:24
问题 Lets say I have a cylinder model that I load into my webvr scene. How can I make the object solid? I.e. the user (camera view) cannot take any position within the object or move 'through' the object. How can I achieve this? <a-scene> <a-assets> <a-asset-item id="cube-obj" src="cube.obj"></a-asset-item> </a-assets> <a-entity id="cameraWrapper" position="0 2 10" rotation="0 0 0"> <a-camera near="0.1" user-height="0" id="camera" listener></a-camera> </a-entity> <a-entity obj-model="obj: #cube

Three.js - VRControls integration - How to move in the scene?

你。 提交于 2019-12-01 00:36:06
I use Three.js to render and move (my orbitControl changes camera.position) in a small scene. Now I have an oculus rift. So I added VRControls and VREffect. There is no problem to move the head. But I can no more move in the scene because VRControls override the camera parameters : object.quaternion.copy( state.orientation ); // object is the camera I thought that it was easy to correct : I have only to update the camera instead of overriding it : object.quaternion.copy(stateOrientationQuat.multiply(currentCameraQuat)); But it does not work : it renders a moving flicking scene. VRControls and

How do I rotate a box in A-Frame by moving or dragging the mouse?

核能气质少年 提交于 2019-11-30 20:39:26
问题 How do I rotate a box in A-Frame by moving or dragging the mouse? I trying to do something like this: http://codepen.io/jordizle/pen/haIdo/ https://jsfiddle.net/MadLittleMods/n6u6asza/ Here is my code. <html> <head> <title>Rotation</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://aframe.io/releases/0.4.0/aframe.min.js"></script> </head> <body> <a-scene> <a-assets> <a-image id="a" src="Background.jpg"> </a-assets> <a-box id=

three.js - THREE.StereoEffect / webVR-boilerplate + THREE.Mirror

隐身守侯 提交于 2019-11-30 19:02:46
问题 I'm trying to get a mirror effect working correctly in a project that is using webvr-boilerplate when VREffect is active. I tried (using r72dev and r72) to use THREE.Mirror: //webVR-boilerplate + Mirror.js verticalMirror = new THREE.Mirror( renderer, camera, { clipBias: 0.03, textureWidth: 256, textureHeight: 256, color:0x889999 } ); verticalMirrorMesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 10, 10 ), verticalMirror.material ); verticalMirrorMesh.add( verticalMirror ); scene.add(

aframe - Set camera position at runtime

三世轮回 提交于 2019-11-30 07:39:33
问题 In a a-scene, I try to change my camera position at runtime. The DOM property changes but the camera does not move. What could have I missed ? my js code: document.querySelector('#myCameraPosition').setAttribute('position', '0 0 0'); My a-scene: <a-entity id="myCameraPosition" position="0 0 50"> <a-entity id="myCamera" camera look-controls keyboard-controls> </a-entity> </a-entity> 回答1: Create a wrapper entity around the camera: <a-entity id='cameraWrapper' position="0 0 0"> <a-camera></a

Aframe, VR website, unable to turn left right using android phone

懵懂的女人 提交于 2019-11-29 16:26:45
I have been working on this VR website for my project for sometime. It used to be able to allow user to view left/right side of the virtual world by moving your phone to the left/right. However, just recently, it suddenly did not work for android phone. I have tested on iphone/ipad, still works as per normal. But for some reason, i tried using note8 , s7 it doesnt work anymore. Would really appreciate if you can identify whats the problem, and how can I fix it? Thank you very much. Try using firefox on android, or the built-in samsung internet app. If everything works as expected, it means you

Why is my video or videosphere not playing on mobile in A-Frame VR?

白昼怎懂夜的黑 提交于 2019-11-29 08:16:13
I have an A-Frame scene with a video or videosphere: <a-scene> <a-assets> <video id="video" src="anothervideo.mp4></video> </a-assets> <a-video src="myvideo.mp4></a-video> <a-videosphere src="#video></a-videosphere> </a-scene> When I test in iOS or Android, I just see a black screen. It works on desktop. Speaking of leveraging Enter VR button, try: <a-scene> <a-assets> <video id="video" src="anothervideo.mp4"></video> </a-assets> <a-video class="video" src="myvideo.mp4"></a-video> <a-videosphere class="video" src="#video></a-videosphere> </a-scene> <script> function playVideo () { var els =