O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - explaining relative coordinate systems

It's also possible to use the coordinate system of other NodePaths when calling any of the position, rotation, or scale methods. Let's take a look at how.

  1. Change line 13 back to:
    self.track.reparentTo(render)
    
  2. Change line 11 to:
    self.cycle1.setPos(self.track,2,15,0)
    
  3. Save the file as "chp02_09.py" and run it.
Time for action - explaining relative coordinate systems

What just happened?

The cycle on the right is much lower now. That's because we set it to (2,15,0) in the coordinate system of self.track, and self.track has been lowered 5 units. Lowering self.track also lowers the coordinate system of self.track. This is another very useful concept to remember. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required