Archived

This topic is now archived and is closed to further replies.

Roof Top Pew Wee

Moving individual vertices

Recommended Posts

A few days ago, there was a post about creating a particle engine, but there was one issue I didn''t see covered. My understanding is for a good particle engine, you make a dynamic vertex buffer, and then update each vertex individually. So would you do something like this: for the top right corner of the quad: vertex[whatever].x = cos(rotation + pi/4) * scale + xPosition; vertex[whatever].y = sin(rotation + pi/4) * scale + yPosition; and for the top left vertex[whatever + 1].x = cos(rotation + pi * 3/4) * scale +xPosition; vertex[whatever+1].y = sin(rotation + pi * 3/4) * scale +yPosition; Of course this code would be made faster with precalculated constants and maybe look up tables for the trig values. But would this be the most efficient way to do it? I''d appreciate any help. --Vic--

Share this post


Link to post
Share on other sites