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

Support animating the camera along a path #981

Closed
mourner opened this issue Feb 9, 2015 · 8 comments
Closed

Support animating the camera along a path #981

mourner opened this issue Feb 9, 2015 · 8 comments

Comments

@mourner
Copy link
Member

mourner commented Feb 9, 2015

With the perspective view in place, we'd want to easily make flight animation that follows a particular set of points, e.g. like Cesium does: http://www.doarama.com/view/160847

@lucaswoj
Copy link
Contributor

ref #2801

@lucaswoj lucaswoj changed the title Camera flight algorithm Support animating the camera along a path Jul 28, 2016
@stevage
Copy link
Contributor

stevage commented Feb 2, 2017

Cool. Implementing this would probably be beyond me (maths and 3D are definitely not my strong suits), but I'm happy to help workshop what the interface might look like.

For instance, a couple of options:

1: map.setCamera([pos1, pos2, pos3...])

Issues:

  • how to indicate whether the path should loop
  • a lot of the behaviour of the animation options will behave differently when they're interpolated across a number of points. For instance, an easing function from A to B then from B to C doesn't make sense - probably it would have to ease from A to C. Or maybe easing doesn't have a use case here, and linear interpolation is the only thing that makes sense.

2: map.setCameraPath(path)

Issues

  • What format is path?
  • Does this relatively niche use case justify a top level method?

3: map.setCamera({ ... }); map.addCameraDestination( { ... } ); ...

Issues:

  • probably just not good.

Also, there is a bigger issue here in that currently you can't explicitly set a camera's 3D position (in X, Y, Z terms - you can only express it in polar coordinates from a given target destination).

@lucaswoj
Copy link
Contributor

In the pursuit of making GL JS the smallest & sharpest tool possible, we're going to punt on this feature and encourage it to be written as a plugin.

@stevage
Copy link
Contributor

stevage commented Feb 21, 2017

Yeah, probably a good idea. I'm not sure it's actually doable yet though, with the existing API. Currently, you can only animate a path along a straight line, or a curve (with very few parameters). So you can't really create an arbitrarily curving line, I don't think (could be wrong!). Maybe you'd have to make a looot of flyTo calls :)

@lucaswoj
Copy link
Contributor

you'd have to make a looot of flyTo calls :)

Yes! Or Map#setCamera calls #2801 😄. This is how any implementation would need to work on some level.

@stevage
Copy link
Contributor

stevage commented Feb 22, 2017

Yeah, I'm looking forward to that API simplification.

Btw, and just FYI: "to punt on" is really ambiguous. In British/Australian/NZ/... English, it means "to take a gamble on". I gather in American English it means something like "to take the safe option". :) (Even though both derive from exactly the same metaphor, of kicking a football a long distance instead of running with it...)

@lucaswoj
Copy link
Contributor

My apologies! I didn't realize how regional that idiom was. The definition I was shooting for was "If you punt on something, you decide not to do or include it"

@stevage
Copy link
Contributor

stevage commented Feb 23, 2017

Ha, no apology necessary. (Punting on the River Cam is something else entirely...)

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

No branches or pull requests

3 participants