Jsroot custom html projection setting

Hi ,
I am creating custom a custom event display in which I would like to have three views : in addition to a perspective also top and side view. Unfortunately, I cannot set the view. Part of my code is below.

Cheers, Rok

     gDivList= ["viewxyz","viewx","viewy"]
     let geom_file = "belle2_geom.json";
     async function draw_geometry_and_tracks( divlist ) {
        let obj    = await JSROOT.httpRequest(geom_file, "object");
        let tracks = await getTracks(0);
        divlist.forEach(function( view, index) {
          JSROOT.draw(view, obj).then( (painter)=>{
            switch ( view ) {
              case 'viewxyz' :  painter.ctrl.highlight=0;             break;
              case 'viewx'   :  painter.setCameraPosition(0,0,0)     ;break;
              case 'viewy'   :  painter.ctrl.ortho_camera=true;       break;
            painter.drawExtras(tracks, "tracks");



Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Hi Rok,

To specify camera position or change highlight setting, one should use draw option - third parameter
in JSROOT.draw function. Please see available draw options in JSROOT examples. Like this one:


Different kind of projections are drawn using draw options like “projz” or “projx”.
There is also possibility to specify camera direction using URL parameters:


Such parameters you can get via context menu command “Get camera position”

Some available draw options for geometry can be seen in documentation


P.S. I edit post to reformat links

It works now.
Regards, Rok

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.