Tutorials Books Videos Forums

Change the theme! Search!
Rambo ftw!

Customize Theme


Color

Background


Done

Scripting 3D in Flash: Panning the Camera

by senocular   | filed under 3D in Flash

This is an archived tutorial from the kirupa.com legacy collection. It covers software that may no longer be available, but it is kept online because the ideas still hold up.

Trigonometry can no be applied in Flash 3D to do some camera panning. This will involve trig to rotate the camera view or to determine in what direction the camera is pointing. Because the camera is looking straight back in z, in panning the camera, it would mean spinning the z axis around until you'd be looking at x, and from there, back to z again. The y axis remains up the whole time, so this rotation is based in the x and z axis space.

[ rotating around y axis ]

Basically, what this entails in terms of the camera is not really rotating the camera so much as rotating everything else in the 3D scene around the camera, just as with before when moving the camera, it wasn't so much moving the camera as it was moving everything in reference to it. The same thing applies in rotation as with movement. The application of that change, however, is a little different. It requires the use of trig.

[ panning camera vs panning items around camera ]

Now, in an overhead view the x, z plane, where the camera is being rotated within, the plane looks much like the x, y plane would normally. And technically, it pretty much is the same thing in almost every respect aside from the axis names. That means applying the sine and cosine methods there should be no problem. It's just a matter of replacing what was y with what will now be z - form x, y to x, z. With the rotation affecting that z axis you will get rotation around the camera view in 3D space as if the camera is panning left and right - exactly what we're after here. Now it's just a matter of putting what we know about trig to work for us in this way.

You may feel that you have learned everything there is to know about 3D in Flash, but there is still a bit more left.

That wraps up this tutorial. A huge thank you to all of you who buy kirupa's books, became a paid subscriber, watch the videos, and/or interact on the forums. Your support is what keeps writing like this online! 😇

senocular

This tutorial was written by senocular, also known as Trevor McCauley. He has been one of this community's most generous teachers since the early Flash days, and he is still around: find him on senocular.com and on the forums.

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright KIRUPA 2026 //--