indus / kubi

a fast and flexible cubemap generator
MIT License
53 stars 15 forks source link

Tiles generated by kubi is not supported in marzipano viewer #11

Closed jack-solutions closed 1 year ago

jack-solutions commented 1 year ago

tiles generated by kubi is not supported in marzipano viewer. the reason behind this is, z index starts from 0 in the tiling of kubi, however marzipano requires from 1.

Arvrairobo commented 1 year ago

yeah same, any update on that?

Arvrairobo commented 1 year ago

@indus

indus commented 1 year ago

I think the easiest solution is to fix this is by slightly adjusting the ImageUrlSource in Marzipano. Something like this should work (the code is from an old project of mine and my not work as is with newer versions of Marzipano):

    var tileUrl = function (f, z, x, y) {
      return "tiles/" + data.id + `/dstfile_${f}/${z}/${x}/${y}.jpg`;
    };
    var source = new Marzipano.ImageUrlSource(function (tile) {
        return { url: tileUrl(tile.face, tile.z-1, tile.x, tile.y) };
    });
    var scene = viewer.createScene({
      source: source,
      geometry: geometry,
      view: view,
      pinFirstLevel: true
    });

Changing the output of kubi is not so easy. The dz function of VIPS that generates the tiles has no option to change the z-index. So either kubi or the user would have to rename all the folders in some postprocessing. Because I find it a bit odd to to start an index with 1 (as Marzipano decided to do) I don't plan to change the behavior of kubi.

jack-solutions commented 1 year ago

yes thanks, we have sorted the problem the other ways and it is working fine.

marzipano also needs preview image in the viewer, kubi is not generating any such preview image, do you have any readymade solution for that? @indus

indus commented 1 year ago

The preview images are just low- or mid resolution images of the 6 faces, right? Running kubi without tiling should do that? Or is there something special to the preview images?Am 17.08.2023 13:52 schrieb ipangram @.***>: yes thanks, we have sorted the problem the other ways and it is working fine. marzipano also needs preview image in the viewer, kubi is not generating any such preview image, do you have any readymade solution for that? @indus

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

jack-solutions commented 1 year ago

never mind, i have got it, thanks