Quote:
Originally Posted by Kalimba
When you draw a texture in OpenGL, you can specify an alpha value for each vertex.
To accomplish what you're doing in that demo, I would maintain a list of ~20 "history state" nodes for the moving object. Each history state would consist of: - The location of the object
- The lifetime of the object
- The current alpha value of the object
In my app's update function, I would iterate these nodes, updating each node's current alpha and removing any expired nodes, based -- of course -- on how much time has elapsed since the last update.
In my app's draw function, I would again iterate the node list (drawing from oldest to newest), drawing the object at the location specified in the node, applying each node's current alpha value to the vertices being drawn.
|
just remember to set your blend mode appropriately.