Skip to content

Aframe component that sends OSC messages over a WebSocket connection

License

Notifications You must be signed in to change notification settings

rm8x/aframe-oscsend-component

Repository files navigation

aframe-oscsend-component

Version License

Sends OSC messages over a websocket connection.

For A-Frame. Using osc-js.

API

Property Description Default Value
serverURL Path to a websocket server localhost
serverPort Port of websocket server 8080
messagePath Send OSC messages with this address ''

Installation and Usage

In order to send messages over UDP you need to connect via WebSocket to a bridge server that will forward forward the messages it recieves. Follow this example using osc-js.

Example on ghpages

https://rm8x.github.io/aframe-oscsend-component/

Browser

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
  <script src="https://rawgit.com/adzialocha/osc-js/master/dist/osc.min.js"></script>        
  <script src="https://unpkg.com/aframe-oscsend-component/dist/aframe-oscsend-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity geometry="box" position="0 1 -2"
        oscsend="
        serverURL: localhost;
        serverPort: 8080;
        messagePath: aframe;
        ">
      <a-animation attribute="rotation"
        dur="05000"
        direction="alternate-reverse"        
        fill="forwards"
        to="0 360 0"
        repeat="indefinite">
      </a-animation>
      <a-animation attribute="position"
        dur="10000"
        direction="alternate-reverse"
        to="0 3 -3"
        repeat="indefinite">
      </a-animation>
    </a-entity>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-oscsend-component

Then require and use.

require('aframe');
require('aframe-oscsend-component');

TODO

  • Allow users to specify which attributes to send
  • Reconnect behavior
  • Care deeply about performance
  • Demos

About

Aframe component that sends OSC messages over a WebSocket connection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published