InitializeMenu(). This should control the setting of the ShowPos variable.
The application can currently report the frames-per-second rate. This is displayed by the DisplayOnScreenInfo() function. We will now change this function to also report the position of the picked atomic if the ShowPos variable is TRUE.
DisplayOnScreenInfo() function:
static void DisplayOnScreenInfo(RwCamera *camera) { RwChar caption[256]; RtCharsetDesc charsetDesc; RwInt32 crw, crh;
crw = RwRasterGetWidth(RwCameraGetRaster(camera)); crh = RwRasterGetHeight(RwCameraGetRaster(camera));
RtCharsetGetDesc(Charset, &charsetDesc);
if( FPSOn ) { RsSprintf(caption, RWSTRING("FPS: %03d"), FramesPerSecond); RsCharsetPrint( Charset, caption, 0, 0, rsPRINTPOSTOPRIGHT ); }
if (ShowPos) { if (PickedAtomic) { RwFrame *f = RpAtomicGetFrame(PickedAtomic); RwMatrix *m = RwFrameGetLTM(f); RsSprintf(caption, RWSTRING("%4.2f %4.2f %4.2f"), m->pos.x, m->pos.y, m->pos.z); RsCharsetPrint( Charset, caption, 0, 2, rsPRINTPOSTOPRIGHT ); } } return;
}


You might wonder why matrices in RenderWare Graphics use a vector called "right" which in this illustration points towards the left of the screen. This often is a cause of concern. To resolve this, imagine that you can fly into the computer monitor and look back towards the screen. In this situation you will have the axis labeled "x" in the diagram above pointing towards the right, and the "z" axis will be pointing "at" you. We have not modified the coordinate system, but by changing our position we have resolved the names of the vectors in the matrices that RenderWare Graphics uses.
© 1993-2004 Criterion Software Limited. All rights reserved. Built Thu Feb 12 13:46:58 2004.
Send Feedback