Crosshair jumpy

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
JPulham
Posts: 320
Joined: Sat Nov 19, 2005 12:06 pm

Crosshair jumpy

Post by JPulham »

I created a crosshair similar to that in the example '07. collision' This is a billboard at the closest intersection. However, when the mouse is moved it becomes 'jumpy' and flickers as you rotate. I could have a billboard fixed in the cestre of the screen but my 'death ray' :D goes fom the gun barrel to the furthest point. So how can I create a smooth flowing crosshair. Is 2D ok?

Could this work: draw in centre of screen. get closest intersection from centre screen. Fire from gun barrel to that intersection. That way the gun aims infront of the player. If I did that, how would I rotate the gun at the end of a bone?

Please help, JPulham.
pushpork
flipnode
Posts: 15
Joined: Thu Jul 27, 2006 1:24 am

Crosshair lower

Post by flipnode »

Just move the crosshair drawing, lower in your code.
flipnode
Posts: 15
Joined: Thu Jul 27, 2006 1:24 am

Post by flipnode »

this might help u

Code: Select all

ITexture* cursor = driver->getTexture("./media/menu/art/cursor.bmp");
driver->makeColorKeyTexture(cursor, position2d<s32>(0,0));
put this in your game loop

Code: Select all

//////////////////////
// draw cursor
//////////////////////
position2d<s32> posCursor((BR_GuiWindow->getScreenWidth()/2),(BR_GuiWindow->getScreenHeight()/2));

driver->draw2DImage(cursor, posCursor, rect<s32>(0,0,16,16), 0, SColor(100,255,255,255), true);
see don't use the mouse cursor postion to calculate where the cursor should go.
Post Reply