about set_pos_hpr

I was using the function set_pos_hpr and then i moved the panda relative to itself but it is not working properly or i am unable to do it.

I use the line

	pandaActor.set_pos(pandaActor,1,1,0);

but the change is like ;
Initial Position: 0.000000 0.000000 0.000000
Final Position: 0.005000 0.005000 0.000000
less by a factor of 200.
Can some one tell me what is wrong??

Code:

// MovingPanda.cpp : Defines the entry point for the console application. 
 // 

 #include "stdafx.h" 
 #include "pandaFramework.h" 
 #include "pandaSystem.h" 
 #include "displayregion.h" 
 #include "genericAsyncTask.h" 
 #include "asyncTaskManager.h" 
 #include "eventHandler.h"   
 #include "buttonThrower.h"
 #include "PNMImage.h"
 #include "texture.h"

 
PandaFramework framework; 
 PT(AsyncTaskManager) taskMgr = AsyncTaskManager::get_global_ptr(); 
 PT(ClockObject) globalClock = ClockObject::get_global_clock(); 
 PT(DisplayRegion) dRegion1; 
 NodePath camera; 
 NodePath camera2; 
 NodePath pandaActor; 
WindowFramework *window;

 void event_button_down (const Event* evenmt, void* data) ; 
 // Task to move the camera 
 AsyncTask::DoneStatus SpinCameraTask(GenericAsyncTask* task, void* data) { 
	 printf("Initi Position: %f %f %f\n",pandaActor.get_x(),pandaActor.get_y(),pandaActor.get_z());
	pandaActor.set_pos(pandaActor,1,1,0);
	 printf("Final Position: %f %f %f\n",pandaActor.get_x(),pandaActor.get_y(),pandaActor.get_z());

	 return AsyncTask::DS_cont; 
 } 
   
 int main(int argc, char *argv[]) { 

    framework.open_framework(argc, argv); 
     framework.set_window_title("My Panda3D Window"); 
  
    window = framework.open_window(); 
    dRegion1 = window ->get_graphics_output()->make_display_region(.75,1,.75,1); 
    dRegion1->set_sort(1); 
    camera = window->get_camera(0); // Get the camera and store it 
	camera2 = window->make_camera();
     //camera2 = window->get_camera(1); 
     dRegion1->set_camera(camera2); 
    // Load the environment model 
     NodePath environ = window->load_model(framework.get_models(), "models/environment"); 
     environ.reparent_to(window->get_render()); 
     environ.set_scale(0.25 , 0.25, 0.25); 
     environ.set_pos(-8, 42, 0); 
     camera.set_pos(0,0,3); 
     camera.set_hpr(0, 0, 0); 

     camera2.set_pos(0,-20,3); 
     camera2.set_hpr(0, 0, 0); 

	 freopen("out.txt","w",stdout);
     // Load our panda 
     pandaActor = window->load_model(framework.get_models(), "panda-model"); 
     pandaActor.set_scale(0.005); 
     pandaActor.reparent_to(window->get_render()); 
     
     // Load the walk animation 
     window->load_model(pandaActor, "panda-walk4"); 
     window->loop_animations(0); 
     window->enable_keyboard();
	
     // Add our task do the main loop, then rest in peace. 
     taskMgr->add(new GenericAsyncTask("Spins the camera", &SpinCameraTask, (void*) NULL)); 
	 
	 framework.main_loop(); 


	 framework.close_framework(); 
     return (0); 
 }

Thanks

if you set the position relative to a node. it will happen in the nodes coordinate system (that includes scale, position, rotation (and i think shear))
in your case, you scaled the node to
pandaActor.set_scale(0.005); ( in the parents coordinate system)
then positioned it relatively to 1 in its own (scaled down) coordinate system.

printing the position relative to its parent. it will be at 0.005.

so everything is working as it should.

Thanks. Did not realize that.