aframe-oscsend-component

0.1.3 • Public • Published

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.

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

Package Sidebar

Install

npm i aframe-oscsend-component

Weekly Downloads

3

Version

0.1.3

License

MIT

Last publish

Collaborators

  • rm8x