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()
orglframebuffertexture()
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
Post a Comment