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' 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 jumpy
Crosshair lower
Just move the crosshair drawing, lower in your code.
this might help u
put this in your game loop
see don't use the mouse cursor postion to calculate where the cursor should go.
Code: Select all
ITexture* cursor = driver->getTexture("./media/menu/art/cursor.bmp");
driver->makeColorKeyTexture(cursor, position2d<s32>(0,0));
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);