View Full Version : Connecting a 9 DOF motion capture sensor with USB to Lightwave

02-26-2014, 02:44 PM

I would like to connect a 9 DOF motion sensor with USB to Lightwave. With the Device Manager in Virtual Studio I would read the data coming from the 9 DOF Sensor.
H, P and B are integer numbers that present themselves proportionally with the direction of the sensor. So this data can easily be connected to the "rotation" in the Nodal Motion Editor. So if I rotate the sensor it will rotate a Null with the same, H, P and B angle.

The issue is the data coming from the Accelerometer, this data only represents the acceleration of the sensor. So if the sensor goes up, it will present a positive integer ( = the upwards acceleration ) in time. And if the sensor goes down it will present a negative integer ( = the downwards acceleration ) in time.

But as soon as the sensor stops, this acceleration data drops back to zero, because there is no acceleration anymore.
So if we connect the acceleration data to the "Position" in the Nodal Motion Editor ( that is connected to a Null ). This will make the Null jump back to the origin ( 0,0,0 ) as soon as the sensor stopped moving.

So I would need a "Acceleration to Position Node". A node that adds or subtracts the acceleration data and translates this to a fixed position. It needs to remember the last position even when the input data went back to zero. With an input option to reset the position back to the origin or with a given vector. And an input option to stabilize the motion data.

Does anybody knows how the make a Node like this in Lightwave?

" If you would like to simulate the behavior of an Accelerometer you could use an optical mouse and drag the mouse. The Misc Data from the Device ( of the optical mouse ) in the Nodal Editor will give you the speed of it's movement and drop to zero when it stops. So it acts like a accelerometer. "

Thanks for reading this,
Carlo Jongen

Freelance Lightwave Animation at www.c3d.be

Ryan Roye
02-26-2014, 05:10 PM
You should be able to do something like this, or use this setup as a baseline:


The red titled nodes are "Item Info". One idea could be to have the sensor constantly add/subtract to a "pool" value that stores an integer, which could be done via 2 nulls that represent the desired position behavior. Granted, it isn't easy to give proper examples without the device handy, otherwise I'd go into more detail.

The data doesn't exactly need to be "remembered"... just added to the final result. Keep in mind that this won't prevent drift-errors as accelerometers kind of act blindly so... it knows how fast something is rotating or moving, but it can't tell you how far it actually moved.

IMPORTANT NOTE: You cannot mix and match graph editor constraints with motion modifiers that are applied elsewhere. If you do this, virtual studio will not give you live feedback. I have fogged the bug report and hopefully it'll get looked into at some point.

02-27-2014, 10:31 AM
Somehow it is always returning to zero... How can you store an integer by using two Nulls? What ever is driving these Nulls, the result is driven by an integer that returns to zero and therefore the Nulls don't remember there previous position.

Ryan Roye
02-27-2014, 10:57 AM
How can you store an integer by using two Nulls? What ever is driving these Nulls, the result is driven by an integer that returns to zero and therefore the Nulls don't remember there previous position.

You can use time as the point of reference. Another approach is relativity. I've attached a slightly modified example scene which may be useful to you. The only issue with the relativity/time approach is that the more frames that the playhead passes, the more sluggish it will become (usually noticable after about 800 frames). A way to get around this is to bake out your clips every ~800 frames, save a motion file, and start over at frame 0 with the second take... also, working at a lower frames per second while doing the relativity/time recording will greatly reduce the computational burden per second.

Sample scene attached. Check it out.


03-03-2014, 09:52 AM
Hi Chazriker,

Thanks for the test scene. :thumbsup: It is almost what I was looking for. I didn't want to work with the timeline moving. I wanted more a live feedback. Today I received the 9 DOF so I took the time to do some test. But apparently the device doesn't get recognized by the HID Manager.

I've posted a separate Thread for this:

I wanted to get this to work first before I move on the the position issue in this thread.
So any tip is welcome...


Freelance Lightwave Animation at www.c3d.be