Page 1 of 1

Crosshair jumpy

Posted: Wed Jul 19, 2006 5:57 pm
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.

Crosshair lower

Posted: Sun Aug 06, 2006 5:48 pm
by flipnode
Just move the crosshair drawing, lower in your code.

Posted: Sun Aug 06, 2006 9:14 pm
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.