Closed s-ol closed 2 years ago
This needs docs of course. Another annoyance is that the osc
package depends on serialport
, which adds a bunch of useless dependencies. I'm not sure if there's a way to blacklist that dependency-subtree? The other osc packages on npm didn't support all types.
It could also use better Error handling/precise checks, but it seems like the rest of the project does too :stuck_out_tongue:
demo:
https://user-images.githubusercontent.com/1731279/152680864-9817a952-687c-4af2-95e1-c921ef2ed9db.mp4
OSC.start("ws://localhost:9996")
mat1 = Material( 'phong', Vec3(.05), Vec3(.5), Vec3(1), 8, Vec3(1,4,1) )
march(
Repeat(
sph = Sphere( .25 ).material( mat1 ),
Vec3( .75)
)
)
.light(
Light( Vec3(2,2,3), Vec3(0, 0, 1) ),
Light( Vec3(-2,2,3), Vec3(1,0,0) ),
)
.background( Vec3(0) )
.render(8, true)
and the OSSIA Score file for sending OSC: osc-demo.zip
I noticed that scene.camera()
is missing, which is pretty important. It would also be nice to make things like obj/transform/translation/x
work.
This is awesome! The build you're using doesn't pull in the Serial stuff as far as I can tell, although I didn't look at it to closely. Anyways, it's a pretty small file regardless, happy to pull this in. Thank yoU!
This (very naively) maps OSC messages like
to JS calls like
(yes, all arrays are done as Vec4 right now).
It can be activated using
OSC.start("ws://localhost:9000")
(or wherever your WebSocket-OSC server is).