Camera Coordinates?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
corteplaneta
Posts: 12
Joined: Mon Jul 04, 2005 3:04 am
Location: Amerika
Contact:

Camera Coordinates?

Post by corteplaneta »

Hey guys, I've been trying to draw the coordinates of the camera into static text, but I keep getting a conversion error and I can't figure out how to cast the vector3df into a stringw. Here...

Code: Select all

IGUIStaticText* camera_coords = env->addStaticText(camera->getPosition(),rect<s32>(10,450,200,450),true);
..and the error

Code: Select all

c:\deletemeafter\VC7\VC7.cpp(42) : error C2440: 'type cast' : cannot convert from 'const irr::core::vector3df' to 'wchar_t'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
any help would be awesome :).
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

print the numbers in to a temp string first, like so:

Code: Select all

wchar_t tmp[50];
core::vector3d<f32> pos = camera->getPosition();
swprintf(tmp, 50, L"X=%.2f Y=%.2f Z=%.2f",pos.X,pos.Y,pos.Z);

IGUIStaticText* camera_coords = env->addStaticText(tmp,rect<s32>(10,450,200,450),true);
corteplaneta
Posts: 12
Joined: Mon Jul 04, 2005 3:04 am
Location: Amerika
Contact:

Post by corteplaneta »

Thanks a ton dude :D!
Post Reply