virtual-reality

Sliders in Unity VR

柔情痞子 提交于 2019-12-01 04:26:35
问题 We're working on a video player app for the Go. We built a straightforward raycaster script to trigger onClick events when a user points at a UI Button element and pulls the trigger: bool triggerPulled = OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger); if (Physics.Raycast(transform.position, transform.forward, out hit, 1000)) { if ( triggerPulled ) { // if we hit a button Button button = hit.transform.gameObject.GetComponent<Button>(); if (button != null) { button.onClick.Invoke(); } }

Unity ui mask not working on google pixel device

余生长醉 提交于 2019-12-01 03:00:15
问题 I am making a scrolling ui panel and apply mask to ScrollRect component, which should hides parts outside panel area. I am using unity version 5.4.2f2-GVR. Mask work correctly on pc when i deploy it on google pixel device its not working. Is this bug of unity version or something else.... 回答1: I got around this issue by using RectMask2D Component instead of the regular Mask . 回答2: If somebody else got this problem and Bahman_Aries solution is not enough, try this: File > Build Settings >

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 to create VR Video player using Google Cardboard SDK for Unity

大城市里の小女人 提交于 2019-11-29 20:12:45
I just downloaded Google Cardboard SDK for unity. I am fine and able to create VR project. Setup is fine and everything is working fine. I am noob at VR Apps. Just stepped in VR Apps. I am planing to create my own VR Enabled Video Player for android, Just like the default Google Cardboard Youtube player. Can any one suggest me a link or can guide me in developing this app. Scott Driscoll's answer totally works. I had some initial problems getting the Easy Movie Texture Unity plug-in to work for me, but finally figured it out, and it works flawlessly. I now have 360-video running as a texture

How to access mobiles back button in unity for android applications

社会主义新天地 提交于 2019-11-29 16:55:38
I am building a VR application with a menu scene and many other scenes.. I would like to get back into the menu scene from any other scene when the user hits the mobiles back button (android).. What is the script for that and where should i place the script?? Programmer You use the Escape keycode to detect back button press on Android. using UnityEngine.SceneManagement; void Update() { if (Input.GetKey(KeyCode.Escape)) { SceneManager.LoadScene("Main Menu"); } } 来源: https://stackoverflow.com/questions/39939641/how-to-access-mobiles-back-button-in-unity-for-android-applications

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

Play sound on click in A-Frame

允我心安 提交于 2019-11-29 16:19:21
So I'm struggling to find a solution to play/stop/pause sound on "click" i.e. when focusing with a black dot with A-Frame sound entity... What I would like to have is a plain, shape or whatever with a play/pause image on it, which would trigger audio when focused. Did anyone encounter something similar perhaps? <audio id="sound" crossorigin="anonymous" preload="auto" src="some-audio-file.mp3"></audio> ... would trigger something like sound="on: click; src: #sound" try making a custom component AFRAME.registerComponent('audiohandler', { init:function() { let playing = false; let audio =

Play sound on click in A-Frame

一笑奈何 提交于 2019-11-28 10:05:51
问题 So I'm struggling to find a solution to play/stop/pause sound on "click" i.e. when focusing with a black dot with A-Frame sound entity... What I would like to have is a plain, shape or whatever with a play/pause image on it, which would trigger audio when focused. Did anyone encounter something similar perhaps? <audio id="sound" crossorigin="anonymous" preload="auto" src="some-audio-file.mp3"></audio> ... would trigger something like sound="on: click; src: #sound" 回答1: try making a custom

Play 360 Stereoscopic video with VideoPlayer

拟墨画扇 提交于 2019-11-27 09:37:21
I want to play a stereo 360 degree video in virtual reality in Unity on an Android. So far I have been doing some research and I have two cameras for the right and left eye with each a sphere around them. I also need a custom shader to make the image render on the inside of the sphere. I have the upper half of the image showing on one sphere by setting the y-tiling to 0.5 and the lower half shows on the other sphere with y-tiling 0.5 and y-offset 0.5. With this I can show a 3D 360 degree image already correct . The whole idea is from this tutorial . Now for video, I need control over the Video

Play 360 Stereoscopic video with VideoPlayer

半腔热情 提交于 2019-11-26 14:47:06
问题 I want to play a stereo 360 degree video in virtual reality in Unity on an Android. So far I have been doing some research and I have two cameras for the right and left eye with each a sphere around them. I also need a custom shader to make the image render on the inside of the sphere. I have the upper half of the image showing on one sphere by setting the y-tiling to 0.5 and the lower half shows on the other sphere with y-tiling 0.5 and y-offset 0.5. With this I can show a 3D 360 degree