Virtual Capsule Endoscopy

This asset allows to use SOFA capsule simulate inside the small intestin and the colon. This is part of the VR-Caps project

To use the capsule navigation system, a single rigid degree of freedom is simulated on the SOFA side. This is what is done in the “SofaNode – Capsule” Node. The SofaMesh is composed of a single position without mesh and a sphere collision.

On the Unity side, a 3D object is used such as a capsule, but any 3D mesh could be used. The SofaCapsuleController script is used on that object to link the position of the SOFA rigid object with this Unity GameObject Transform.


Speed parameters can be set using the UI and keyboards arrow are used to move the capsule in Unity. The motion is propagated to SOFA and if collision are computed the collision response is sent back to the capsule.

4 different scenes are present in the folder: SofaUnity/Scenes/Demos/Endoscopy/Virtual Capsule Endoscopy/

  1. Capsule_simulation_constraint:  The capsule simulation inside the colon using Lagrangian constraints.
  2. Capsule_simulation_final: Same simulation but with projective constraints
  3. Capsule_simulation_narrow_path: A specific scenario with a narrow path where the capsule will deform the colon.
  4. Capsule_simulation_narrow_path_constraint:  Same but with Lagragian constraints.
To control the capsule, use the keypad:
  • Keypad 5 & 0: move forward/backward
  • Keypad 4 & 6: move sideways to the left/right
  • Keypad 2 & 8: move up/down
  • Ctrl + mouse: rotate view and direction of the capsule
Capsule navigation menu



This asset is available in normal Rendering Pipeline 

This asset is also available in High Definition Rendering Pipeline 

Full demo movie of the endoscopic navigation simulation.