3dct / open_iA

A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
GNU General Public License v3.0
41 stars 16 forks source link

Updated WebSocket Protocol with smaller Details #66

Closed mdalpiaz closed 5 months ago

mdalpiaz commented 5 months ago

I added some implementation details (the packets are unchanged!) to handle possible inconsistencies and race conditions while connecting and disconnecting clients, and some open questions.

2 further things we probably need to discuss (sent via E-Mail): 1) Slice Plane Axis Slicing on Unitys side is currently implemented by using two slice planes. One which is controlled by the server and one which is tracked by the tablet. The plan is, when creating a snapshot, to set the server slice plane to the current tablet position and send a create command. The "main axis" will be the one from the server and Unity will translate between the axis orientations (right vs. left handedness). OpenGL should be right-handed and Unity left-handed.

2) Object manipulation Currently we only send messages to add to translation, rotation and scale values. What could happen is, that packets are dropped and the state is no longer consistent. Should we change it to set absolute values instead?

codeling commented 5 months ago

Currently we only send messages to add to translation, rotation and scale values. What could happen is, that packets are dropped and the state is no longer consistent. Should we change it to set absolute values instead?

Probably a good idea to send absolute values; as websockets is TCP-based, message loss is probably not a large issue, but it would also mean a little less computation on the receiving end, it would be the same amount of data to transmit, and a very low-end client overwhelmed with object manipulation messages could drop all but the last one received, and still get a consistent state.

mdalpiaz commented 5 months ago

What could also happen is drifting if many small floating point values are sent. Which means sending absolute values is objectively the better idea.