JSFiddle - React, Tailwind, and code Playground

by p0rter

HTML

<script type="text/javascript" src="http://get.goXTK.com/xtk_edge.js"></script>

CSS

html, body { 
  background-color:#fff;
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden !important;  
}

JavaScript

window.onload = function() {

    var r = new X.renderer3D();
    r.init();

    var volume = new X.volume();
    volume.file = 'http://x.babymri.org/?avf.nrrd';

    r.add(volume);

    r.onShowtime = function() {

        volume.children[0].visible = false; // X
        volume.children[1].visible = false; // Y
        
        // apply one texture to all slices -> nothing happens
        for (i = 0; i < volume.children[2].children.length; i++) {
            volume.children[2].children[i].texture.file = 'http://x.babymri.org/?xtk.png';
            volume.children[2].children[i].modified();
        }


    };

    r.render();
};