c++ - How to get really smooth moving objects using openGL -


I am working on an application where I remove a circular progress indicator which is gradually "filled" Here you can see. I am using Intermediate mode and I am portraying this circular shape by simply illustrating the corner on each frame update (see the code below). When the circle fills the boundary between white and brown then there is a slight flicker and I am thinking how can I make it more smooth.

This is a concrete example, but in general I am thinking that how to get the easiest offer while using very simple liner interpolation? When I see the proposal when I flick between the pages on my iPhyl, it is very smooth, which makes me wonder how will I achieve it on my fast (fast) mac?

  Photobondown: Photoshop Countdown (Float Affiliation): Duration (FMIL), Start_time (0) {Set Action Command ("LEPP"); } Zero PhotoBoothCountdown :: update () {if (start_time! = 0) {float cur = ofGetElapsedTimeMillis (); Perc = (cur-start_time) / period; }} Zero PhotoBoothCountdown :: Draw () {float resolution = 150; Int parts_filled = resolution * perc; Int parts_unfilled = (resolution - parts_field); Float part_angle = TWO_PI / resolution; // printf ("Filled:% i /% i /% i \ n", partsfield, parts enveloped, (partsfield + parts enclosed)); Float radius = 300.0f; Float width = 100; Float radius_inner = radius-width; Float center_x = ofGetWidth () / 2; Float center_y = gatehead () / 2; Float angle = 0; GlBegin (GL_TRIANGLE_STRIP); GlColor4f (0.2 F, 0.2 F, 0.2 F, 0.9F); For (int i = 0; i & lt; = parts_filled; ++ i) {float kosa = cos (angle); Float sin = sin (angle); GlVertex2f (center_x + cosa * radius, center_y + cena * radius); GlVertex2f (center_x + cosa * radius_inner, center_y + sina * radius_inner); Angle = = part_engal; } Glend (); GlBegin (GL_TRIANGLE_STRIP); GlColor4f (1.0f, 1.0f, 1.0f, 0.9f); Angle - = part_angle; (Int i = 0; i & lt; = parts_unfilled; ++ i) {float kosa = cos (angle) for; Float sin = sin (angle); GlVertex2f (center_x + cosa * radius, center_y + cena * radius); GlVertex2f (center_x + cosa * radius_inner, center_y + sina * radius_inner); Angle = = part_engal; } Glend (); If (purse & gt; = 1) {printf ("need fire"); FireEvent (); Reset (); }} Zero PhotoBoothCountdown :: start () {start_time = ofGetElapsedTimeMillis (); End_time = start_time + period; } Zero PhotoBoothCountdown :: reset () {start_time = 0; End_time = 0; Perc = 0; } Take a look at  


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -