I´m working in CS5 AE and let´s say that I´ve made a solid square and that I whant this square to rotate 180 degrees horizontilly so that it flips from one side the other side.
I make the square layer 3D and I insert a camera so that I can rotate in 3D space. It looks ok when I do my animation (the flip from one side to the other) but when I then drag my timeline back and forth the problem appears.
My square makes the flip 180 degrees but at the same time moves towards me and back. So it actually moves towards me, does the flip and the moves back to its real place again.
Is there anyone out there that knows whar the problem might be? I have been searching on the internet but have not found any answers!
First- it seems that you are rotating the camera around the square layer. If that is the case and you are using the camera controls, you will get that kind of movement. If you just want to rotate the square layer, just use the rotation controls of the layer itself, you do not need an animated camera for that.
Second- if you want to rotate the camera around an object/layer in AE 180 and keep the object in the center of the image at the same distance, all you need to do is to create a 3d Null, position it at the center of the object/layer and link the camera to it. Then animate the rotation on the Y axis and you are set.
Search the Cow for camera rigs in AE or look up Maltaannon- he has some great tutorials on this matter.