Sends OSC messages over a websocket connection.
Property | Description | Default Value |
---|---|---|
serverURL | Path to a websocket server | localhost |
serverPort | Port of websocket server | 8080 |
messagePath | Send OSC messages with this address | '' |
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.
https://rm8x.github.io/aframe-oscsend-component/
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>
Install via npm:
npm install aframe-oscsend-component
Then require and use.
require('aframe');
require('aframe-oscsend-component');
- Allow users to specify which attributes to send
- Reconnect behavior
- Care deeply about performance
- Demos