Jump to content
  • Advertisement

Archived

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

Roof Top Pew Wee

Moving individual vertices

This topic is 5964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!