Skip to content
Home » Panda3D Part 8 – Transformations in Blender

Panda3D Part 8 – Transformations in Blender

Spread the love

In the previous part of the Panda3D series we were panning, orbiting and zooming in the scene. We were changing the angle or distance from which we viewed the objects in the scene, but we were not changing the objects themselves. In this lecture we’ll see how to actually change the location, rotation or scale of an object. Moving, rotating and scaling are the three basic transformations in Blender.

Here’s the video version of this article:

Here’s a simple scene:

scene

The transformations work only on the object or objects that are currently selected. And now let’s have a look at them one by one.

Moving Objects

Let’s start by moving objects. Suppose we want to move the monkey from where it is to the right. First of all, we have to select it. Let’s use the menu first. Go to the Object menu, then to the Transform submenu and select Move:

move

Now you can move the monkey wherever you like by just dragging your mouse:

move

If you’re satisfied with the new location, just click the left mouse button.

You can also use a shortcut to move objects. The shortcut is G. This time let’s move two objects, the monkey and the ico sphere to the left. First select them both (hold down the Shift key to select more than one object), hit G on the keyboard and drag the selection to the left:

move

Rotating Objects

To rotate an object, you can select the Rotate option in the menu or use the R shortcut. Let’s rotate the monkey using the menu. First make sure only the monkey is selected. Here’s what we have to select:

rotate

 Now you can drag your mouse to rotate the object. Click the left mouse button when done:

rotate

If you select more than one object, they will be rotated around the point that is located in the geometrical center of the objects. Let’s select the monkey, the ico sphere and the plane and then rotate them using the R shortcut:

rotate

Your Panda3D Magazine

Make Awesome Games and Other 3D Apps

with Panda3D and Blender using Python.

Cool stuff, easy to follow articles.

Get the magazine here (PDF).

Scaling Objects

To scale an object you can use the Scale option from the menu or the S shortcut. Let’s scale the ico sphere up a bit. First we must select just the sphere and then select Scale in the menu:

scale

Now you can drag the mouse to change the size of the ico sphere. Click the left mouse button when you’re satisfied:

scale

You can also scale multiple objects at the same time. Just select them first and hit S (or use the menu). This time they’ll scale toward the geometrical center between the selected objects. I’ll demonstrate it on the example of the monkey and the torus. This time I’ll scale them down:

scale

Constraining to Axis

You’ve probably noticed the red and green lines in the 3D Viewport. These are the X and Y axes respectively. By default we don’t see the Z axis, which goes up and down in Blender:

constrain

You can transform objects in Blender in all three axes, as we’ve been doing so far or in just one or two axes. If you want to transform an object in just one axis, just hit the key with the name of the axis (X, Y or Z) just after you activate the transformation. If you want to transform in two axes, hold down the Shift key and then hit the key with the name of axis that you don’t want to use after activating the transformation.

So, suppose we want to move the monkey up, so along the Z axis. To do it, select the monkey and hit G Z. At this point you will see the blue Z axis and your ability to move will be constrained to this axis. You can only move up and down. So, move the monkey up so that it’s above the torus.

Here’s the blue Z axis visible before you left-click to confirm the transformation:

constrain

Next let’s scale. Suppose we want to scale the torus in two axes, X and Y, but not in Z. So, select the torus and hit S Shift+Z. This will constrain the transformation to the two remaining axes, so X and Y, just like we wanted. Now scale the torus up so that it’s approximately the same size order as the ico sphere. Don’t worry if it intersects the plane.

You should see the X and Y axes appear during the transformation:

constrain

Finally, let’s rotate the torus and the plane along the X axis only. With the torus still selected, hold down the Shift key and select the plane. Then hit R X to rotate the two objects along the X axis and rotate them about 90 degrees in clockwise direction along the axis.

You should get something like this:

constrain

Resetting Transformations

Look at the scene again. Such a mess. Moving, rotating and scaling objects a bit or slightly is often enough, but sometimes our transformations must be more precise. Before we move on, however, let’s reset the transformations, so let’s bring them to their default states. The default states are:

– the point (0, 0, 0), so the world origin for location,

– 0 degrees for rotation,

– the factor 1 for scale in all axes.

Python Jumpstart Course

Learn the basics of Python, including OOP.

with lots of exercises, easy to follow

The course is available on Udemy.

To reset a transformation, select an object, hold down the Alt key and hit the appropriate shortcut (G for moving, R for rotating and S for scaling), so:

Alt + G – to reset location

Alt + R – to reset rotation

Alt + S – to reset scale

You can also select multiple objects at once. Let’s select the ico sphere, the torus and the monkey and reset the transformations. First, with the three objects selected, let’s reset scale, so hit Alt + S:

reset scale

And now let’s reset the rotation of the three objects, so just hit Alt + R:

reset rotation

Finally, let’s reset location. With the three objects still selected hit Alt + G:

reset location

Blender Jumpstart Course

Learn the basics of 3D modeling in Blender.

step-by-step, easy to follow, visually rich

The course is available on Udemy and on Skillshare.

Precise Transformations

Sometimes you may want to move your object an exact number of units in a specific direction or maybe rotate it by a specific number of degrees, or, finally, scale it by a specific factor. In Blender it’s very easy. You just type in the exact number of units from your keyboard. So, suppose you want to move your object 4 units along the Y axis, you just type:

G Y 4

Let’s check it out. Select the ico sphere and hit G Z -3.5 to move it down (hence the minus sign) 3.5 units. Then hit Enter or left-click to confirm:

precise transformations

Now select the monkey. We want to rotate it 45 degrees around the Y axis. All we have to do is hit R Y 45:

precise rotation

And now select the torus and scale it in all axes by a factor of 3.2. To do it just hit S 3.2, without specifying the axis:

precise scale

You can play around with precise transformations to get used to them. In the next part of the series we’ll be talking about object mode and edit mode.


Spread the love
Tags:

Leave a Reply