Javascript TCP Client

What is this?

Below is an example of implementation of a javascript TCP client for a SOFA server. It displays a SOFA simulation scene which is running in a SOFA server located in our facilities.

Several clients can be connected on the same time. In that case, they will all see the same scene. The console windows located under the buttons monitors the event received by the server from other clients.

In this version, the visual mappings are computed by the javascript client, as it saves a lot of bandwidth for most scenes.


How can I interact with the simulation?

You can change the simulated scene by pressing the “Previous Scene” and “Next Scene” buttons.

The console displays some information regarding how you can interact with each scene. The caduceus scene can be tickled with the mouse (shift + left click). For the other scenes, you can use the keyboard to change on  the fly some constants of the simulation.

You can also move the camera by using the mouse (in case you have one in your device).

Warning. Depending on your connection, you might observe a lag in the interactions with the scene.


 What are the applications?

This can be of interest to you if you want to promote an algorithm but do not wan to disclose its code. The user will be able to test it in real time, potentially with its own geometry, to modify the parameters, and event to benchmark it. You also might want to easily monitor a complex simulation which is running in a computer without 3D display.


How to include it in my website?

The client is available in form of a javascript file, we have also created a simple WordPress plugin that should ease its usage (in case you use WordPress). You will also need to set-up a dedicated SOFA server to host the simulation. Please contact us if you are interested or if you want more information.