I have a graphical object which is moving along a trajectory. How can I make the camera follow the object?
相关问题
- Puzzled by Function body evaluation
- how to overload Times and Plus for matrix multipli
- Animate a WPF Window left and right with a shake e
- AOSP Build TARGET_PRODUCT fails
- jQuery, how to make synchronous animations?
相关文章
- Keep constant number of visible circles in 3D anim
- Animate opacity on hover (jQuery)
- histogram without vertical lines in Mathematica
- How to set the image resolution for animations?
- Animate height of groupbox from 0 to auto
- Custom transition animation unknown delay between
- Animation with animationSet() in android
- How to make React Native Animated.View clickable?
Let's draw a planet and its satellite, with the camera following the moon from a view directed toward the Earth. For example:
Where myEarth is another 3D Graphics (for reference).
Static vertical view:
The trick is SphericalRegion -> True, without it the image perspective "moves" from frame to frame.
Edit
With two static objects:
Since the question asks about 2D, here's how you can emulate a camera in 2D Graphics.
First, let's get the stackoverflow favicon.ico:
Well put this on top of some overlapping circles and make the "camera" follow the icon around by adjusting the
PlotRange
To show how it works (with out putting the above into Mathematica), we need to animate it. Originally I chose a variable step random walk
drunk = Accumulate[RandomReal[{-.1, .1}, {200, 2}]]
but it was a unpredictable! So instead, we'll make the icon follow the ABC logo