GithubHelp home page GithubHelp logo

Comments (9)

RodrigoHamuy avatar RodrigoHamuy commented on July 19, 2024 2

Hi, @forerunrun, thanks! Do you have maybe a sandbox to replicate the issue? R3M (react-three-map) doesn't alter geometries or the scene object matrices, only the camera matrices.

from react-three-map.

RodrigoHamuy avatar RodrigoHamuy commented on July 19, 2024 1

@forerunrun maybe this version helps?

from react-three-map.

RodrigoHamuy avatar RodrigoHamuy commented on July 19, 2024 1

@forerunrun, in coordsTovector3 change from - angle to + angle to flip the interpretation. Then you can have your mesh facing Z-up (sandbox) ✌️

image

from react-three-map.

forerunrun avatar forerunrun commented on July 19, 2024

As an update, the <Coordinates> component works perfectly for individual meshes, I'm wondering if there's a way to simply expose the underlying function behind the <Coordinates> component so an array of vectors (3 or 2) could be set from the same function and passed to Shape and or BufferGeometry respectively, this way geometries could be absolutely positioned on the map derivative of their vertex positions...

from react-three-map.

forerunrun avatar forerunrun commented on July 19, 2024

Hi @RodrigoHamuy, thanks for the response, yes i've put together a quick repro of the issue here it's difficult to see the extrude geometry because it's not being evaluated correctly but it's the little thin green line... please let me know if you see anything out of the ordinary with the setup, maybe i've used something wrong but the way it is I'd have imagined each point of the shape to have been in it's correct location

from react-three-map.

RodrigoHamuy avatar RodrigoHamuy commented on July 19, 2024

@forerunrun the issue is that you are using coordinate points to define a ThreeJS mesh, but as soon as you are in ThreeJS, evertyhing is in meters units. So you need to convert your coordinates to meters. I wrote an example of how to do that here.

from react-three-map.

forerunrun avatar forerunrun commented on July 19, 2024

I wrote an example of how to do that here.

oh @RodrigoHamuy that's amazing, thank you! I completely overlooked that! one thing is that there seems to be an odd rotation to the shape, the back of the shape, based on the coordinates, should be parralel to the blue line in the following image...
image

would you have an idea why that rotation is off? I'm going to have a proper look into the coordsTovector3 method you've written to try to look into it now...

EDIT: it looks like it's around 22 degrees ( euler.set(0, (22 - angle) * MathUtils.DEG2RAD, 0); ) off but cant quite tell what side is what with the shape in question or why the rotation is off, I'll have a play with a less regular shape

EDIT2: _euler.set(0, (90 + angle) * MathUtils.DEG2RAD, 0); seems to give the correct orientation to the regular shape too but will double check with an irregular one and confirm

from react-three-map.

forerunrun avatar forerunrun commented on July 19, 2024

@RodrigoHamuy that's great thank you so much for looking into this, yes that definitely helps, i still can't tell why the extrude geometry is off, it should be right, if for instance on the extrude geometry mesh we use <mesh rotation={[90 * MathUtils.DEG2RAD, 0, 0]}> rather than -90 the orientation looks correct but the mesh is effectively upside down, both lines and extrusions are really useful in different cases so i'll try getting to the bottom of this! thanks again for your help!

from react-three-map.

forerunrun avatar forerunrun commented on July 19, 2024

in coordsTovector3 change from - angle to + angle to flip the interpretation.

Hey @RodrigoHamuy the problem with that is it then changes the orientation of the <Line/> in the same way... i ended up just using <mesh rotation={[90 * MathUtils.DEG2RAD, 0, 0]}> and changing the scale of the up axis to -1 for the extrude geometry mesh which seems to work...

one other thing i've noticed is the raycasting accuracy is strangely off when the map is zoomed out and an object appears small... for instance in one of your official examples here...

image

in the above image the mouse is currently over the lowest left cube (although you can't see it, it is ) but the onPointerOver event is not being detected for some reason, i'm thinking it's possibly a raycaster misprojection maybe?

Let me know if you'd want me to open this in another issue (unless you know of this already) I've marked the original issue as closed for now as it was user controlled behaviour.

from react-three-map.

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.