Coder Social home page Coder Social logo

Comments (5)

j-devel avatar j-devel commented on May 10, 2024

That [x, y, z] is the result of applying "mouse picking" against the visible terrain mesh objects with:

_doRaycast(mx, my) {
return Viewer._applyWithMeshesVisible(
this.objsInteractive, (meshes) =>
this.threelet.raycastFromMouse(mx, my, meshes));
}

For the underlying raycasting function raycastFromMouse(), please follow its implementation.

from three-geo.

Spope avatar Spope commented on May 10, 2024

Hi,

First thanks for your library, it rocks !
This ticket is named exactly as I would have named mine, so I put my question here.

I looked at your example "projection" and I saw that your are setting the elevation of the point by hand.
I tried to use the _resovleElevation by passing the meshes to the proj function (and it works) but I guess there is some debug code which try to access window._scene to display the result of the function.

I guess I should not be using this as it is mentionned WIP, but there is currently not any other way to retrieve the height of a given point right ?

Thanks again for your work.

from three-geo.

eserrose avatar eserrose commented on May 10, 2024

I found out that you can obtain the height of any coordinate using Mapbox rgb terrain tiles (you can find a library for this). The rest is easy as shown in the projection example.

from three-geo.

j-devel avatar j-devel commented on May 10, 2024

I tried to use the _resovleElevation by passing the meshes to the proj function (and it works)
...
I guess I should not be using this as it is mentionned WIP, but there is currently not any other way to retrieve the height of a given point right ?

Hi @Spope ! Resolving elevation by proj() with the meshes argument (i.e. [x, y, z] = proj(latlng, meshes)) is WIP and the internal _resolveElevation() would not be robust enough (hence not yet documented in API). Yes, this is the only approach tried thus far.

you can obtain the height of any coordinate using Mapbox rgb terrain tiles (you can find a library for this)

@eserrose Curious, what's the name of the library?

from three-geo.

Spope avatar Spope commented on May 10, 2024

Thanks for the answers, will look for other way of doing this.

from three-geo.

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.