GithubHelp home page GithubHelp logo

imclab / oculus-unity-max Goto Github PK

View Code? Open in Web Editor NEW

This project forked from asouth/oculus-unity-max

0.0 2.0 0.0 324 KB

The contents of this repository provides a bridge to send head movement data between the Oculus Rift, Unity and MAX/MSP.

Max 100.00%

oculus-unity-max's Introduction

Oculus-Unity-MAX

The contents of this repository provides a bridge to send head movement data between the Oculus Rift, Unity and MAX/MSP. These tools have been created as product of a Royal Society Industry Research Fellowship Scheme between AECOM Ltd and AudioLab, Department of Electronics, University of York, UK.

Disclaimer and License

This patch/package may not be error free, fully functional, accurate or reliable. In no event will we be liable for any loss or damage of any kind arising out of or in connection with your use of this patch/package.

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License which can be found at http://creativecommons.org/licenses/by-nc-sa/4.0/

Overview

There are two parts to this repository:

  1. Unity Package - A simple Unity package that interfaces with the Oculus Rift DK1/DK2 and, at game run-time, forwards the head movement data from the Oculus Rift and the global position of the virtual character using the UDP protocol as an OSC message. The OSC messaging is perfromed using the jorgegarcia/UnityOSC v1.2 C# classes interface for the Unity3d game engine which can be found at (https://github.com/jorgegarcia/UnityOSC) and is licensed under the The MIT License (MIT) http://opensource.org/licenses/mit-license.php

  2. A MAX/MSP patch (authored using MAX 6.1) - This receives the OSC head movement messages and displays the head movement as a 3D visualisation. The patch is intended to be used as a bpatcher object around which new patches can be created.

Documention

Start a New Unity Project

Import 2 Custom Packages by selecting Assets -> Import Package -> Custom Package

The first package is the OculusUnity Integration package (filename: OculusUnityIntegration.unitypackage) which is available from the developers pages on the Oculus website.

The second is the OVR_MovementManager.unitypackage.

Next you need to create a character controller.

In the Project Heirarchy select Assets -> OVR -> Prefabs and the drag the OVRPlayerController onto the object Hierarchy window.

Now create an Empty game Object, GameObject-> Create Empty and rename it to something useful like MovementExporter.

Next, to export the OCulus HMD movement and the character movement using UDP, in the project hierarchy navigate to Assets -> Scripts and drag the ExportRotations.cs onto the MovementExporter object.

Then expand the OVRPlayerController but keep the MovementExporter highlighted in the Object Hierarchy and drag the OVRPlayerController object onto the OVRPC attribute in the object inspector. Repeat the process but placing the OVRCameraRig into the OVRCR attribute.

Now build your virtual environment as you wish, when you run the game your headmovments and WASD key press movements will be exported over UDP and can read using the corresponding MAX/MSP patch.

Note that the ExportRate can be used to reduce the rate at which the positional messages are sent over UDP. By default the Export is 1 and corresponds to 1 message every time Update() is called. However if, for example, ExportRate was 4 then the positional message would only be sent every 4th time update is called. The ExportRate can be changed at run-time by holding Ctrl and pressing Up or Down. The unity2max.maxpat patch will display the current UDP frame rate, if it is receiving messages when the keys are pressed.

The IP Address and Port number can now be changed without the need to Build the project again. Simply place a file name ipconfigfile.txt in the same folder as the executable ensure the first line reads i.e. "127.0.0.1 8000" but omitting the quotation marks.

oculus-unity-max's People

Contributors

asouth avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.