Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D/3D camera behavior is too magical (or not magical enough?) #39

Closed
ssfrr opened this issue Jan 1, 2018 · 1 comment
Closed

2D/3D camera behavior is too magical (or not magical enough?) #39

ssfrr opened this issue Jan 1, 2018 · 1 comment

Comments

@ssfrr
Copy link
Contributor

ssfrr commented Jan 1, 2018

From what I can tell the camera is 2D if the first thing plotted is flat, e.g. lines(1:20, rand(20), zeros(20) will use a 2D camera, (as will lines(1:20, rand(20), ones(20)) but lines(1:20, rand(20), rand(20)) will create a 3D camera. Adding a 3D plot after first adding a 2D plot doesn't seem to upgrade the camera to 3D.

I had expected the camera to be a property of the Scene, and would exist before you'd actually added any objects to the scene (it just wouldn't have anything to look at), and could be set with something like scene = Scene(camera=:perspective). Currently it seems like the camera is a property of the object being plotted (e.g. lines(1:20, rand(20), zeros(20), camera=:perspective), but I don't understand the use-case for per-object cameras.

For context, I hit this when trying to do a plot like this:

image

using a bunch of lines calls. Each one is flat so the scene ends up using the 2D camera.

@SimonDanisch
Copy link
Member

I agree, this is bad! I haven't considered upgrading the camera yet, but maybe that's a good way to go, although a bit finicky! But it might be a clean path forward to just have one camera per window. I'm also thinking about separating plots from scenes, which would make it more obvious that a scene can have it's own camera, but not a plot.

For this particular use case you might just want to plot the axis first as a work around ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants