Author Topic: Oscillating Camera  (Read 2867 times)

Offline PeanutMocha

  • Member
  • *
  • Posts: 119
Oscillating Camera
« on: June 14, 2011, 07:16:32 AM »
I'm trying to make a mostly-linear camera movement across a scene, but the camera oscillates fairly wildly getting from A to B.

For example, there's a keyframe 60 frames into the animation just a few meters away from the start keyframe, but the camera first moves BACKWARD before moving forward again to the second keyframe.  The same thing happens en route to my third keyframe.  Eventually the camera shows up at the 4th and final keyframe.

TGD attached, keyframes are at:

1, 60, 256, 480

Offline Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6183
    • CGScenery.com - Terragen Tutorials!
Re: Oscillating Camera
« Reply #1 on: June 14, 2011, 07:27:32 AM »
This is because of the "ease-in" and "ease-out" interpolation of the keyframes, which happens by default now in TG2.
Also, the interpolation method can result in values becoming "negative". For instance, if you animate a camera going up until 10m and then going down to 1m then at some point it will go >10m up as TG2 tries to smooth out the keyframes.
At the moment Matt is working on different interpolation types and other methodes for keyframing.

The solution at this moment is to add another keyframe after each keyframe to "force" the interpolation to go in the right direction.
Another solution is to animate your camera inside another 3D package and import it as .chan file, as this gives per key frame data.

Cheers,
Martin
« Last Edit: June 14, 2011, 07:29:20 AM by Tangled-Universe »

Offline Henry Blewer

  • Member
  • *
  • Posts: 6333
  • The cooler weather is great!
    • flickr.com/photos/njeneb/
Re: Oscillating Camera
« Reply #2 on: June 14, 2011, 12:21:08 PM »
I have always set animation paths with the first and last frames as the first two keyframes I set. Normally the midpoint keyframe is the next one set. More keys are added after that if they are needed. Three keyframes often work vary well.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Offline Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6183
    • CGScenery.com - Terragen Tutorials!
Re: Oscillating Camera
« Reply #3 on: June 14, 2011, 01:08:14 PM »
I have always set animation paths with the first and last frames as the first two keyframes I set. Normally the midpoint keyframe is the next one set. More keys are added after that if they are needed. Three keyframes often work vary well.

No they don't. Just "mirror" the values against the mid-point or create/check frames beyond the last keyframe or before the first keyframe.
That's exactly what Peanut was pointing to.


Offline Henry Blewer

  • Member
  • *
  • Posts: 6333
  • The cooler weather is great!
    • flickr.com/photos/njeneb/
Re: Oscillating Camera
« Reply #4 on: June 15, 2011, 02:04:02 AM »
I set the first camera keyframe, then move the camera to it's last location. A new keyframe is made there. The third camera keyframe if made for the midpoint of the camera path.

I should add this only works well if you don't have objects or terrain which the camera has to 'fly' through.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Offline PeanutMocha

  • Member
  • *
  • Posts: 119
Re: Oscillating Camera
« Reply #5 on: June 16, 2011, 06:34:25 AM »
I tried setting a first, last and middle keyframe first but get the oscillating behavior.

Based on suggestions here, I tried adding an extra keyframe surrounding the current ones to give more points of reference, but still end up with the camera oscillating back and forth.

I uploaded a video clip of the 3D preview window showing the behavior: