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

the Problem of resetTransform in Loadoptions #163

Open
AHSss opened this issue Apr 24, 2024 · 4 comments
Open

the Problem of resetTransform in Loadoptions #163

AHSss opened this issue Apr 24, 2024 · 4 comments

Comments

@AHSss
Copy link

AHSss commented Apr 24, 2024

when I used the version1.1.17, the loadoptions had a parameter-geoTransform. I set this parameter to 1, my tileset model can be in 0,0,0. but now I use the version1.2.3 the parameter-geoTransform can't be find,and there is a new parameter-resetTransform. I set this parameter to true,my tileset model can't be find. but when I use the example's model(https://int.nyt.com/data/3dscenes/ONA360/TILESET/0731_FREEMAN_ALLEY_10M_A_36x8K__10K-PN_50P_DB/tileset_tileset.json),it's can also be find in 0,0,0.
I can't find the problem.I need u help! @wanyanyan @Avnerus
this is my code:

    async loadTileset() {
      const result = await Loader3DTiles.load({
        url: './models/terra_b3dms/tileset.json',
        renderer: this.renderer,
        options: {
          dracoDecoderPath: './draco',
          basisTranscoderPath: './basis',
          maximumMemoryUsage: 4096,
          maximumScreenSpaceError: 1, 
          viewDistanceScale: 1,  
          geoTransform: 1, 	
          // resetTransform: true,
        },
      }
      )
      const { model, runtime } = result;
      model.rotation.set(-Math.PI / 2, 0, Math.PI / 2);
      this.tilesRuntime = runtime;
      this.scene.add(model);
    }
@Avnerus
Copy link
Collaborator

Avnerus commented Apr 24, 2024

Hi @AHSss!
The library hasn't been tested lately with DJI Terra exports, so it might be there is a bug in the new resetTransform functionality. If you would like, you could share your scan so I can test it. You could also try calling the Runtime.orientToGeocoord() method with the lat/long of your scan. If the tileset is in WGS84 coordinates, it should transform it so that the scanned location is at (0, 0, 0).

@AHSss
Copy link
Author

AHSss commented Apr 24, 2024

Tnank you for answering my question.I had try to use runtime.orientToGeocoord(),but it dosen't work. Am I using it wrong?There is my code:

async function loadTileset() {
    const result = await Loader3DTiles.load({
        url: '/models/51jixiao_terra_b3dms/tileset.json',
        renderer: renderer,
        options: {
            dracoDecoderPath: '/draco',
            basisTranscoderPath: '/basis',
            maximumMemoryUsage: 4096,
            maximumScreenSpaceError: 1,  
            viewDistanceScale: 1,  
            resetTransform: true,
        },
    }
    )
    const { model, runtime } = result;
    model.rotation.set(-Math.PI / 2, 0, Math.PI / 2);
    runtime.orientToGeocoord({ height: 0, lat: 0, long: 0 })
    tilesRuntime.value = runtime;
    scene.add(model);
    console.log(model);
}

And this it my scan.It's so large,I compressed the files.And you should change the file's name *.z01.zip to *.z01 for zip.You can test it for me if you want. Thanks! @Avnerus
test_terra_b3dms.zip
test_terra_b3dms.z01.zip
Uploading test_terra_b3dms.z02.zip…
Uploading test_terra_b3dms.z03.zip…

@Avnerus
Copy link
Collaborator

Avnerus commented Apr 24, 2024

in orientToGeocoord you should input the cartographic location of your model.
From your tileset.json, I think it might be around {lat: 29.3637161, long: 106.53427913}

@AHSss
Copy link
Author

AHSss commented Apr 25, 2024

Do you mean like this?

    const { model, runtime } = result;
    model.rotation.set(-Math.PI / 2, 0, Math.PI / 2);
    runtime.orientToGeocoord({ height: 0, lat: 29.3637161, long: 106.53427913 })
    tilesRuntime.value = runtime;

I do this, but still can't see the model. Is there something wrong in my code? And I have tried other versions, only 1.1.17 can see the model with geoTransform set 1. @Avnerus

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

2 participants