How to know what to put for xyz coordinates

I need help I don’t know how to figure how what xyz coordinates to put. How do you figure out what numbers to put to put the model, or camera, in a specific place. Please Help! :confused:

the code is something like

  ...setPos(?, ?, ?)

The x, y, and z represent a three-dimensional position:
en.wikipedia.org/wiki/Three-dimensional_space

Oh yea! But how do you know what to put in the x y and z positions to get the model where you want it?

Try:

model.place()

to pop up a GUI that allows you to position the model graphically.

David

ill try it.
thank you drwr and pro-rsoft both!
:smiley: :smiley: :smiley: :smiley: :smiley:

hey david… i used panda for… 2 years now… why have i NEVER heared about this place() method and why isnt it in the reference??? i mean. its so usefull and yet hidden so well?
… i smell some kind of disney conspiracy theory…:wink:

whenever I put model.place() it says

Traceback (most recent call last):
File “test.py”, line 8, in
from direct.tkpanels.Placer import Placer
File “linuxroot/usr/share/panda3d/direct/src/tkpanels/Placer.py”, line 7, in
File “linuxroot/usr/share/panda3d/direct/src/showbase/TkGlobal.py”, line 5, in
File “/usr/lib/python2.5/lib-tk/Tkinter.py”, line 41, in
raise ImportError, str(msg) + ‘, please install the python-tk package’
ImportError: No module named _tkinter, please install the python-tk package

in the terminal

wait no it says

DirectStart: Starting the game.
Warning: DirectNotify: category ‘Interval’ already exists
Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
:util(warning): Adjusting global clock’s real time by 0.790748 seconds.
Traceback (most recent call last):
File “test.py”, line 39, in
w = World()
File “test.py”, line 26, in init
self.loadModels() #calls Class loadModels
File “test.py”, line 33, in loadModels
self.panda.place()
File “/usr/share/panda3d/pandac/libpandaModules.py”, line 1111, in place
base.startDirect(fWantTk = 1)
File “linuxroot/usr/share/panda3d/direct/src/showbase/ShowBase.py”, line 2238, in startDirect
File “linuxroot/usr/share/panda3d/direct/src/showbase/ShowBase.py”, line 2233, in startTk
File “linuxroot/usr/share/panda3d/direct/src/showbase/TkGlobal.py”, line 5, in
File “/usr/lib/python2.5/lib-tk/Tkinter.py”, line 41, in
raise ImportError, str(msg) + ‘, please install the python-tk package’
ImportError: No module named _tkinter, please install the python-tk package

:confused:

as it says. you need to install the python-tk package
thats all. see the last 2 lines of the error :slight_smile:

oh lol…
sorry I had a noob moment. :blush: :laughing:

I’m confortable with setting up a blank node, and then find() it and put the real object there, as demonstrated in RoamingRalph sample : “start_point”.

conspiracy ? :laughing: :laughing:
That’s too far, Thomas. But you can always blame your lazyness.
Don’t you feel weird when you found out that even NodePath.posInterval (which is the recommended method in the manual) isn’t documented in the statically generated API ?

It’s because it’s bound at runtime, in /pandac/libpandaModules.py, alongside with other useful methods, such as :

def place(self):
        base.startDirect(fWantTk = 1)
        from direct.tkpanels import Placer
        return Placer.place(self)

Happy reading !

for now i added a small note in the manual. so noone can say we hide this most useful tool on purpose.