Giter Site home page Giter Site logo

Comments (20)

mmeeks avatar mmeeks commented on July 27, 2024

Sure - go for it; should be easy to fix ;-) We try to rotate and then translate to preserve the bbox IIRC, but read the code :-) As for updating the view port post rotation, that needs some work too I guess, patches most welcome.

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

Was this the fix that went in with the patch for issue #48?

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

no, if you zoom out, the rotation center is somewhere before the objects' plane, it would be better to have it at the center of the objects

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

I guess I don't know what you mean then. If I grab the 3D view and spin it around, it seems to behave the way I expect.

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

ok, you have to (somehow) zoom out with the right mouse button. then the objects are far away. but the rotation center stays near and does not move away with the objects. effect is that the objects run out of the window if you rotate

from repsnapper.

mmeeks avatar mmeeks commented on July 27, 2024

Annoying isn't it ;-) patch appreciated ...

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

I think I see the problem. Right mouse button and drag isn't zooming out, it's panning up and down. If you zoom out with the scroll wheel, things work exactly as they should.

I think the problem here is that the panning behaviour (both left/right and up/down) is a bit weird and non-intuitive.

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

I think one should not expect everybody to have a mouse wheel.
So that's the reason why I can't zoom properly, as right mouse button only kind of zooms when dragging left-right
How about middle button drag for zoom?

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

People still have mice with no scrollwheel? ;)

Middle button is not mapped to anything, so it's a viable candidate. I plan to add a tool palette when I get time, which will
let people work mostly with the left button - switching between the selection, zoom, pan, move object, rotation etc tools

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

Some people have laptops that are not broken after a year ;-)

Patch for middle button coming soon ....

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

I would suggest that the "pan" function should just move the 2d screen, it would be more intuitive

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

I'm not sure what 'just move the 2d screen' means, but feel free to try out something different.

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

I think I fixed it.

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

Excellent, that's quite a bit better. The only problem I see with it is that we should reset the translation to 0,0 when automatically moving the view, otherwise it ends up pointing to the wrong place (as in CalcBoundingBoxAndCenter() after loading a new file)

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

I don't really understand what you mean, and also what the Center-change meant that was in there before, but I think the rotation center should move as well, I didn't find out how this works ...
(I see no problem when I load new files)

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

The code that was in there before (adjusting the Center) moves the platform/model and hence moves the rotation center when you pan, but it "feels" weird because it moves it a fixed amount, and not a distance related to the zoom - so the further out you are, the less it feels like it's moving.

The new way is better, but now it offsets the camera which never happened before, so when CalcBoundingBoxAndCenter is called, it doesn't adjust that. Here's the symptom I'm talking about:

  1. Start repsnapper
  2. Use the right mouse button to pan right until the platform is not on the screen
  3. load an STL file.

old behaviour: When the STL file is loaded, the camera zoom and center is changed so the new STL file is in view
new behaviour: The camera zoom and center change, but the camera pan isn't, so the platform is all still off the left side of the screen.

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

commit ee867af fixes that last bug for me. I think we can close this issue now (reopen if not)

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

looks very good.

only probably remaining that the rotation center should be moved when panning so that it stays at the screen center ... if that is doable ...

from repsnapper.

thaytan avatar thaytan commented on July 27, 2024

To move the rotation center, you'd need it to change the Center var, as the old code was doing, but probably to scale the size of the adjustment using the zoom in some way, and possibly the perspective transform as well. I'm not sure how it would work in practice, and it would probably result in making the 'pan and spin' behaviour feel like it did with the original code: a bit incomprehensible, and hard to locate the platform again once you spin it around to behind the camera.

from repsnapper.

hurzl avatar hurzl commented on July 27, 2024

yes I tried this and the result was indeed the old behaviour. One would probably have to change the way the Center is handled altogether ... too much for now I think so I agree we can close this ...

from repsnapper.

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.