Python Forum
how to destroy or remove object rendered with opengl from the screen? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: how to destroy or remove object rendered with opengl from the screen? (/thread-2778.html)



how to destroy or remove object rendered with opengl from the screen? - hsunteik - Apr-09-2017

There are many ways to render object on the screen,such as using  VAO/VBO and glbegin/glend,but how do I destroy them or remove them from the scene?
One way I can think of is by making the object transparent by changing the alpha value in the shader,
But there are some problem,
1)the object isn't really removed or destroyed,but just invisible instead.
2)I need to rerender the whole scene from back to front again.
My main question is,how does games like minecraft destroy its block when player destroys it?


RE: how to destroy or remove object rendered with opengl from the screen? - hsunteik - Apr-09-2017

Nevermind,already found a way.
My idea is giving it a if statement before rendering the object and continue to render the object only if the boolean variable is true.
If not,don't render,which means destroy or remove.