To better understand NodePaths, let's go ahead and use the print statement to take a closer look at what's going on.

Locked within NodePaths are the most common tools we'll use to manipulate the virtual world inside Panda3D. It is through these tools that we will make our game dance and twirl. They are the tools that change the position, rotation, and scale of the node the NodePath handles. Each of these tools is made up of several methods, one to control changing all three axes at once, and three more methods to control each axis individually.

First we have the methods that control the position within the 3D world:

Panda3D uses a z-up coordinate system. That means that in the world of Panda3D, the x and y axis control horizontal positioning, and the z axis controls height. This is contrary to many modeling packages and can take some getting used to. Try to keep it in mind as we continue through the tutorials in this book.

Next are the methods that control the rotation of the node:

hpr stands for heading, pitch, and roll. If you imagine the node as a jet, facing down the positive y axis, heading will turn left and right, pitch will climb and dive, and roll will spin the jet and make you throw up. To put it in technical terms, heading rotates the model around its z axis, pitch rotates it around its x axis, and roll rotates it around its y axis.

Lastly we have the scalar methods:

The scale methods work relative to the original scale of the node, so setting a scale to 2 will double the size along that axis and setting it to 0.5 will halve the scale along that axis. We can also call setScale with only a single argument:

This will change the scale of the node uniformly along all axis.