In OpenGL how can I hide part of a shape?

Nov 10, 2013 at 10:35pm
And slowly reveal it?
Nov 11, 2013 at 12:02am
                                           
Nov 11, 2013 at 12:21am
Use the stencil buffer.
Nov 11, 2013 at 7:25pm
Is it useful for making shapes look like they animated into view?
Nov 11, 2013 at 7:44pm
closed account (N36fSL3A)
Look up glfog
Nov 11, 2013 at 7:47pm
FWIW, glFog is deprecated in later versions of OpenGL.

Also can you be more specific about what you want? Do you just want an object to scroll in from the side of the screen? Or start far away from the camera and move closer? Or "appear out of thin air" like it was being teleported with a star trek teleporter? Or fade in from a solid color? Or what?
Last edited on Nov 11, 2013 at 7:48pm
Nov 11, 2013 at 7:55pm
Well basically, I want rectangles in my 2D gui to slide into view when I click a certain rectangle..

So I click this -> []

And then it becomes -> [ ]

But I don't want it to happen instantly I want it to animate/slide into view from the side..
Nov 11, 2013 at 8:22pm
closed account (N36fSL3A)
So just translate the box.
Nov 11, 2013 at 9:24pm
The idea behind basic animation is you move an object slowly over a period of time.

Give your object a velocity. Every update.. add its velocity to its position. Then set its velocity to 0 when it's at the final position you want it to be.
Nov 11, 2013 at 9:34pm
Thanks
Topic archived. No new replies allowed.