c++ - animating a model without redrawing the whole background drawing --OPENGL -


using opengl , making simple animation small triangle move through path have created mouse (glutmotionfunc).

so problem how can animate small triangle without redrawing whole path using glutswapbuffers();

and ,how can rotate triangle only.

i don't want use overlay switching between these 2 layers takes time.

if redrawing whole path expensive, can rendering off-screen framebuffer. mechanism opengl called frame buffer object (fbo)

explaining how use fbos in detail beyond scope of answer here, should able find tutorials. using functions like:

  • glgenframebuffers()
  • glbindframebuffer()
  • glframebufferrenderbuffer() or glframebuffertexture()

this way, can draw additional triangle fbo whenever new triangle added. show rendering on screen, can copy current content of fbo primary framebuffer using glblitframebuffer().


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -