PDA

View Full Version : Help with an animation



Eztlicoatl
10-03-2015, 05:33 PM
Hi everyone!

I'm almost new to OpenGL, I've been learning to use basic functions. At this point I'm capable of making a 2D animation. But I have a problem now, my animation is simulating a robotic arm (just with lines haha) so the point is that I have managed to follow a circle path, but I need it to really draw it as my "robot" passes by the circle path. Maybe I'm making bad use of the function glClear(GL_COLOR_BUFFER_BIT) but I need it to make the animation. If I dont use it everything is a mess as you may know.

Any tips to get this done please? I would apreciate your help.

Carmine
10-03-2015, 05:56 PM
Nothing wrong with using glClear. It is used in probably 99.99% of OpenGL simulations/animations. Are you worried that you will be erasing part of the circle that is already drawn? That's not a problem. In each frame of the animation you should redraw the entire circle, i.e. from start to where the robot arm is now. So a longer arc will be drawn at each step as you progress through the animation. GL is plenty fast enough to draw arcs of any length.

Eztlicoatl
10-03-2015, 06:03 PM
I see! I'll try doing that! I haven't tought of doing it that way! Thanks Carmine!!