Git Product home page Git Product logo

Comments (2)

Avnerus avatar Avnerus commented on May 30, 2024

Hi Eytan,
The loader was initially designed to be independent of geo coordinates so unfortunately there isn't currently an intuitive way to do this. It is, however, in the Roadmap and would appreciate a PR on the matter. Since the backend is loaders.gl, everything should be supported. For example adding a resetGeoTransformation: true/false option would be great. In the mean time, you could try this workaround which seems to work for me with Cesium tilesets:

      // The loaders.gl matrix type
      import { Matrix4 as MathGLMatrix4 } from '@math.gl/core';

      // The result from await Loader3DTiles.load()
      const {model, runtime} = result;

      // Get a reference to the loaders.gl tileset
      const tileset = runtime.getTileset();
    
      // Set the model and camera position to the cartesian center
      model.position.set(...tileset.cartesianCenter);
      camera.position.set(...tileset.cartesianCenter);
      camera.translateY(1000);
  
      // If using orbit controls
      controls.target.set(...tileset.cartesianCenter);
      controls.update();
    
      // Reset the loaders.gl model matrix, otherwise it is set by the loader to inverse the geo-transformation.
      tileset.modelMatrix = new MathGLMatrix4();

Let me know if that worked for you!
/Avner

from three-loader-3dtiles.

Avnerus avatar Avnerus commented on May 30, 2024

Closing due to inactivity.

from three-loader-3dtiles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.