Hello World ! Can anyone tell me how to put a '+' character at the screen centre in 3D World space..It should stay at the centre while moving camera..I don't want to use glutWarpPointer()...anyone who can tell me ..when I move my camera it must be at the screen centre..

camera is rotating along with mouse movement using glutPassiveMotionFunc()...actually the problem is ..when I press only W(forward movemnt)...'+' remains its position but while pressing W button when I make some mouse movement...It doesn't stay in the centre...help me...

How are you positioning the '+' character? I assume you are trying to create a crosshair. What I would do is, have a crosshair image and use this formula to center it on screen.

crosshairX = (Screenwidth - crosshairImageWidth)/2
crosshairY = (Screenheight - crosshairImageHeight)/2

The camera should have no effect on the crosshair at all.

ya you are right, I want put crosshair to shoot targets...I want to use '+' character(CROSSHAIR) at center instead of an image...i.e it will be get affected by camera..how to avoid this...I programmed for it...but didn't succeed...can you suggest me some idea ...

and which technique you use for inserting an image onto the GL screen...devIL library or any other concept...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.