Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-29-2010, 02:27 PM   #3 (permalink)
wahness
Registered Member
 
Join Date: Apr 2010
Posts: 138
wahness is on a distinguished road
Default

Quote:
Originally Posted by Kalimba View Post
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.
wahness is offline   Reply With Quote
 

» Advertisements
» Online Users: 354
13 members and 341 guests
AlanR917, amit.mangal, AyClass, Domele, esoteric, ilmman, ipodphone, martianflash, minglei, Newbie123, Objective Zero, Sesio, Wharazhasri
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,567
Threads: 94,081
Posts: 402,751
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Wharazhasri
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:16 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.