Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiles misalignment in Multires panorama. #1251

Open
jpbolanod opened this issue Jan 22, 2025 · 0 comments
Open

Tiles misalignment in Multires panorama. #1251

jpbolanod opened this issue Jan 22, 2025 · 0 comments

Comments

@jpbolanod
Copy link

jpbolanod commented Jan 22, 2025

Hi, i have used the generator.py to create some tiles to display them using pannellum. I am getting a slight misalignment in the tiles when i turn to the whole screen and when i zoom it in the reduce screen. Look at the images.
Fallback tiles
Image

Misalignment in the image when zoom it .

Image

Misalignment in the image in the whole screen.

Image.

And this is my code
`import React, { useEffect, useRef, useState } from 'react';
import 'pannellum/build/pannellum.js';
import 'pannellum/build/pannellum.css'; // Import pannellum's default CSS

const PanoViewer = () => {
const panoContainerRef = useRef(null);

useEffect(() => {
  if (window.pannellum && panoContainerRef.current) {
    window.pannellum.viewer(panoContainerRef.current, {
      type: 'multires',
      autoLoad: true,
      // "multiRes" key is where you configure your tile paths
      multiRes: {
        // The base path to the directory containing your tile folders and fallback.jpg
        // basePath: 'https://binahlab.s3.us-east-1.amazonaws.com/BIM/360Tiles/output',
        basePath: 'https://binahlab.s3.us-east-1.amazonaws.com/BIM/360Tiles/output1',
        /*
         * "path" defines how to locate each tile file within basePath.
         * %l = level, %s = face (f, b, l, r, u, d), %x / %y = tile coordinates
         * Example: "/%l/%s%y_%x" => for level 0, face front, it might load "/0/f0_0.jpg"
         */
        path: '/%l/%s%y_%x',
        extension: 'jpg',

        // The fallback image for browsers that don't handle multires or are at a very low resolution
        fallbackPath: '/fallback/%s',

        /*
         * tileResolution = the width/height (in px) of each tile
         * cubeResolution = the "virtual" size (in px) of the full cubic image
         * maxLevel = the highest subfolder level you generated
         */
        tileResolution: 512,
        maxLevel: 4,
        cubeResolution: 4096,
      },
    });
  }
}, []);

return (
  <div
    ref={panoContainerRef}
    style={{ width: '600px', height: '400px' }}
  />
);

};

export default PanoViewer;
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant