Python Forum
how to destroy or remove object rendered with opengl from the screen?
Thread Rating:
  • 3 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to destroy or remove object rendered with opengl from the screen?
#1
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?
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why does [root.destroy, exit()]) fail after pyinstaller? Rpi Edward_ 4 579 Oct-18-2023, 11:09 PM
Last Post: Edward_
Heart Yahoo email "search and destroy"! Linh_lee 20 4,062 Aug-28-2022, 10:57 AM
Last Post: sandrahdes
  Pygame with OpenGL on RPI Zero without X: invalid operation aserranoh 0 1,354 Mar-20-2022, 09:49 PM
Last Post: aserranoh
  wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen' Shadower 1 6,124 Feb-06-2019, 01:25 AM
Last Post: woooee
  Remove object jmf08 5 3,005 Jan-17-2019, 02:01 PM
Last Post: ichabod801
  Notebook is rendered as static html by github miner_tom 2 3,071 Aug-23-2018, 09:00 PM
Last Post: perfringo
  Creating shadow in OpenGL with normal? hsunteik 0 3,336 Apr-27-2017, 08:23 AM
Last Post: hsunteik
  NullFunctionError in opengl hsunteik 2 4,034 Apr-04-2017, 07:29 AM
Last Post: hsunteik
  Traditional OpenGL vs GLSL? hsunteik 2 4,027 Mar-27-2017, 03:54 PM
Last Post: nilamo
  How to set the window icon with OpenGL GLUT hsunteik 3 6,192 Mar-19-2017, 11:53 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020