Quake 3 map tutorial modification

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
Guest

Quake 3 map tutorial modification

Post by Guest »

Hi.
I'd like to modify the quake 3 map tutorial in order to make the 3d coordinates appear in the window caption : here is the code ( unmodified ) utilised in the tutorial to show the number of polys and the framerate in the windows caption

Code: Select all

swprintf(tmp, 1024, L"Quake 3 Map Example - Irrlicht Engine (fps:%d) Triangles:%d", fps,driver>getPrimitiveCountDrawn() );

device->setWindowCaption(tmp);
I tried to use a sprintf to write in a string the value of node->getPosition() , but the coordinates type is vector3df , and sprintf works only with *char.

What can I do ?
Thank you in advance
condrula
Posts: 44
Joined: Wed Mar 10, 2004 11:51 pm
Location: italy

Post by condrula »

Endar told me this, some 3d ago...


After you get the camera position, put this code in the while loop, after "driver->endScene()"

code:
wchar_t tmp[1024];
swprintf(tmp, 1024, L"Camera Position: (%f, %f, %f)", camera_vector.X, camera_vector.Y, camera_vector.Z );
device->setWindowCaption(tmp);
shabadam
Posts: 10
Joined: Sat Jul 03, 2004 11:39 am
Location: Italy

Post by shabadam »

Thanx ! :D
Post Reply