-
Notifications
You must be signed in to change notification settings - Fork 65
Creating CAD style camera handling #147
Comments
Replacing Additionally I suggest removing line 174 ( If desired, I can open a PR for this. |
In general I think we should allow multiple different 3d camera variants to exist in AbstractPlotting.jl, as the old behavior is probably better for "just a plot"-style scenes. On the other end of the spectrum, I prefer a FPS/Spaceship-style camera movement (like in https://github.com/CarpeNecopinum/Shiny.jl/blob/master/src/movement.jl) for large, complex scenes. |
@CarpeNecopinum, that would be great! |
👏 @CarpeNecopinum please do |
Contains the changes suggested in issue JuliaPlots#147.
Can you specify what the mechanics is? Do I understand that this corresponds to picking a vector from the center ending on the plane of view and moving the arrow tip on the plane of view and taking the rotation of the corresponding vector? |
cameras are also just recipe like, and the camera argument already works with arbitrary functions, that add a camera to the scene ;) So the design is already ready for different cameras! |
@mschauer It essentially just translates mouse drags on the x-axis to rotation around some "upwards" axis and mouse drags on the y-axis to rotation around some "right" axis. The original cam3d! always used the global z-axis as "upwards", which gives you a turntable-style rotation where the up-axis of the camera and the z-axis of the world will always stay somewhat aligned (though you can flip the camera upside down). The CAD-style camera uses the up-axis of the camera as "upwards" for the rotation, which allows any rotation to be achieved. |
Ok, get it, thank you. That is equivalent or maybe actually the same as what I said. it would be worth to try to do it as I described and check if that gives a natural feel (if done right, then moving the mouse up and then right gets you to the same rotation as moving first right and then up). So the reference axes should perhaps not change while the mouse key is pressed. |
We could create a |
Since all the difference is in the event handlers anyways, we could probably do with just keeping the one |
A keyword argument in the constructor is always an option ( |
Should we make it part of the |
So something like |
Camera is already part of the theme:
I don't like if kw_args change behaviour drastically... Also, this way we can't pass it to the camera keyword argument. Although, that you can't pass kw_args to the camera is a bit lame and something we should fix. |
One thing we can do, is implement this suggestion:
and leave the default as it is, with the option to change the default at 1.0.0 release. |
Contains the changes suggested in issue #147.
One issue I just found is that You can still add a custom camera function by calling it explicitly, but it being able to be part of the theme would definitely be nicer. I thought about replacing the check by testing if the camera function can be called on |
We could leave the check to open this up ;) or add the new camera to the list! The question is, do we want to have cameras live in packages, or are we fine with adding all custom cameras to AbstractPlotting? |
I think it's perfectly fine for a package to define it's own camera style... |
Yeah it's fine, but I wonder if it wouldn't be better to enforce that people add it as a PR, so that different cameras are more visible! |
Sure, that makes sense...perhaps we should add a warning in the docs, along with any new camera page that's added - which I could get around to in a week or so. We could also print a request to upstream a new camera type if it's detected. |
This relates to:
JuliaGL/GLAbstraction.jl#96 (and also: MakieOrg/Makie.jl#38, JuliaGL/GLAbstraction.jl#76, JuliaGL/GLAbstraction.jl#80, MakieOrg/Makie.jl#329).
Moving discussion here as it is about AbstractPlotting's camera handling (in particular https://github.com/JuliaPlots/AbstractPlotting.jl/blob/master/src/camera/camera3d.jl)
The text was updated successfully, but these errors were encountered: