Armed with that information, you can look up NodePath in the class reference and find:
And you can follow the link on LPoint3f to discover that it inherits from LVecBase3f, which is where getX() is defined.
Or, you can use Python’s built-in help utility:
>>> help(base.camera.getPos())
Help on Point3 object:
class Point3(VBase3)
| // Filename: lpoint3_src.h
| // Created by: drose (25Sep99)
| //
| ////////////////////////////////////////////////////////////////////
| //
| // PANDA 3D SOFTWARE
| // Copyright (c) Carnegie Mellon University. All rights reserved.
| //
| // All use of this software is subject to the terms of the revised BSD
| // license. You should have received a copy of this license along
| // with this source code in a file named "LICENSE."
| //
| ////////////////////////////////////////////////////////////////////
| ////////////////////////////////////////////////////////////////////
| // Class : LPoint3
(pages and pages of text snipped)
this describes all of the interfaces on LPoint3, including the inherited interfaces from the base class.
One point that is helpful to know a priori is that the vector classes are renamed from C++ to Python in a way contrary to the rest of the class renaming convention: the C++ classes LPoint3f, LVector3f, and LVecBase3f are called Point3, Vec3, and VBase3 in Python, respectively.
“base” is a global that is defined when you import DirectStart (or otherwise construct a ShowBase object).
The biggest advantage of a language like Python is that you can run it interactively: load up your Panda application in an IDE, and then type the above commands at the Python prompt after your application is loaded. “base” will exist in that context.
Or, if you’re not ready to embrace an IDE yet, you could run your application with “python -i myapp.py”. Press control-C to break to a Python prompt after it’s loaded. (If that interrupts the application instead, then you’ll have to omit the run() call in your myapp.py, and type it yourself when you want to start the app running. And there won’t be a way to break to a prompt, so that’s a strong reason to switch to an IDE.)
Or, you could simply start Python as you are above, and type “from direct.directbase.DirectStart” at the python prompt before you query these values. But that’s not really taking advantage of the power of Python.