# Live Demos for VTK Cxx examples

**URL:** https://discourse.vtk.org/t/live-demos-for-vtk-cxx-examples/6960
**Category:** Development
**Tags:** proposal
**Created:** [October 25, 2021, 11:22am UTC](https://discourse.vtk.org/t/live-demos-for-vtk-cxx-examples/6960 "2021-10-25T11:22:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [October 25, 2021, 11:22am UTC](https://discourse.vtk.org/t/live-demos-for-vtk-cxx-examples/6960/1 "2021-10-25T11:22:06Z")

</div>

Since the VTK Cxx → Emscripten → (WebAssembly + JS) workflow is almost working, I am interested in getting feedback from the devs and users here, if this is a good idea… @amaclean Lets forget about the size of wasm binaries for the sake of this discussion 🙂

As all of the examples are hosted along with source code, it would be nice and helpful to understand what the code does with a live interactive demo in the browser itself… See [magnum-octree](https://magnum.graphics/showcase/octree/) for example.

Let me elaborate a bit more on why this might help besides the (just for the sake of web) reason…  
All VTK examples have an image and that itself helps a lot, but for most interactive examples, it would be cool if the site offered a live experience prior to downloading the tarball and building it…

The concerned examples are:

1. Cxx/Interaction
2. Cxx/Picking
3. Cxx/Visulization
4. Cxx/Widgets

I identified a couple of setbacks and tried to fix with MRs wherever possible. Any help on where I could begin to resolve the rest will be appreciated. @ken-martin, @ben.boeckel, @Sebastien_Jourdain

1. VTK + Emscripten build failures (Issue [18263](https://gitlab.kitware.com/vtk/vtk/-/issues/18263)): Attempted a fix in [MR 8512](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8512). I am no CMake ninja, it would help if a more knowledgeable dev could improve that.

2. A couple of OpenGL features are unimplemented (?) for GLES 3.0. Some discussions at [discourse.vtk.org](https://discourse.vtk.org/t/building-vtk-9-with-emscripten-gles-for-rendering/3038/5)

3. The examples that require/demonstrate file based IO can be ignored.

So, 2.2, 2.3, 2.4 and 2.5 seem trivial, but 2.1 and 2.2 are a bit obscure and I’ve no clue where to begin. If Kitware brings in Dawn’s auto generated code for VTK with webgpu, I can probably forget about 2.1 and 2.2 since emscripten supports dawn’s auto generated wgpu code, so I’d call it wishful thinking 😉

I’ve had a minimal emscripten + vtk live site running at [https://code.thepanchu.in/vtkDearImGUIInjector/](https://code.thepanchu.in/vtkDearImGUIInjector/) for a while now. Keyboard handling is ~~unimplemented~~ fully implemented. (It uses [vtk-wasm-target](https://github.com/jspanchu/vtk-wasm-target) docker image based on my pending MR8561 branch)
