I have a Visual3D object loaded from a file and displaying on screen. That works fine. I am trying to rotate it from data received in a SerialDataReceivedEventHandler - which also works fine.
When I try to rotate the model, it throws an InvalidOperationException because the thread doesn't own the object. Here's what I have:
QuaternionRotation3D rotation = new QuaternionRotation3D(q);
model.Dispatcher.BeginInvoke(new Action(() =>
model.Transform = new RotateTransform3D(rotation)));
I know I need to use the dispatcher, but I can't figure out how.