Page 1 of 1

get camera x,y,z..

Posted: Mon Dec 01, 2003 6:16 am
by Spartacus
How do I get the cameras xyz so i can use swprintf to print the x,y, and z coordinate to a status box or somthing? I tried looking at docs i cant find any way?

Posted: Mon Dec 01, 2003 6:59 am
by [dx/x]=HUNT3R
same way you get any node's coordinates

Code: Select all

core::vector3df someVector = camera->getPosition();

Posted: Mon Dec 01, 2003 8:12 am
by Spartacus
Yes I tried that already probelm was i didnt unerstand how i can get each xyz?

Posted: Mon Dec 01, 2003 8:15 am
by gastar
Hi,

someVector.X
someVector.Y
someVector.Z

Posted: Mon Dec 01, 2003 10:46 am
by DevSpartacus
What will X Y and Z return float double integer? i saw that in docs but it said T ? as in template i guess but i dont know how id use that? with the swprintf

Posted: Mon Dec 01, 2003 11:32 am
by madinitaly
Shoud be:

Code: Select all

wchar tmp[1024];
swprintf (tmp, L"X: %f, Y: %f, Z: %f", someVector.X, someVector.Y, someVector.Z);

Posted: Tue Dec 02, 2003 4:16 am
by Guest
I currently have this:

wchar_t tmp[1024];
camera_pos=camera->getPosition();
swprintf(tmp, 1024, L"X: %f Y: %f Z: %f",camera_pos.X,camera_pos.Y,camera_pos.Z);
statusText->setText(tmp);

And X,Y,and Z area always 0?

Posted: Tue Dec 02, 2003 4:41 am
by [dx/x]=HUNT3R
are you using the FPS camera, b/c if you are the same thing happens to me everytime too. The getPosition, get AbsolutePosition and setPosition methods do not work with the FPS camera... :evil:

Posted: Tue Dec 02, 2003 6:54 am
by Spartacus
I got it so im not anymore I think, However now i cant move 0.o AT ALL!