views:

109

answers:

2

Hi. I'm new at OpenGL. Basically I want to know how to resize a rectangle. For example: I have a rectangle, height = 10, width = 20. I want the rectangle to grow 90 points up in 1 second for a new height of 100. Is there a function that can do this? Or I'll have to do it frame by frame?

Thanks

+3  A: 

You'll have to do it frame by frame. OpenGL is a graphics library, not a physics engine or game library; it only provides functions for drawing primitives (triangles, quads, etc.), not for manipulating "objects" on any higher level.

Jesse Beder
+1  A: 

As Jesse Beder replied, You have to do this in each frame, and manage all of the time yourself. Since OpenGL is not a retained mode graphics engine, each frame needs to be drawn manually.

However, you do not need to actually resize your rectangle each frame. You can, alternatively, just change it's transform. You can use glScale/glTranslate, etc, to just change how the rendering is done, which will effectively make it "grow".

Reed Copsey