Jump to content
  • Advertisement

Archived

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

Austrian Coder

Manipulating a VA

This topic is 5747 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

Hi! I need infos, how i can manipulate the data of an existing Vertex Array. I would like to make a Particle System, which uses a Vertex Array. I konw, that VA are dynamic. Here a spezific situation: in VA gPartilceVertexArray is from position 125 to 546 the vertexes of the actuall rendered particles. Now some particles die and i should manipulate this array. But How? Thanks for your help, Christian

Share this post


Link to post
Share on other sites
Advertisement
with vertex arrays u dont have to draw all the indices unless u use
glDrawArrays( QUADS, 100, 500 ) which will draw them all from 100..500 in that order
using glDrawElements will let u put them in any order u wish ie u can use indices 100,105,200 etc + skip oyut the ones inbetween

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
I know how to draw elements in an VA. But how can i manipulate it?
Must i generate every time an new array and make it then to an va with glVertexPointer(3, GL_FLOAT, 0, g_PaticlesVertexArray);
or can i manipulate it directly? Like:
Particlesystem from index 547 - 2413 died so i must delete this indexes.

Share this post


Link to post
Share on other sites
>>Must i generate every time an new array<<

well u shouldnt generate it with (new) everytime but yes u create the indices everytime eg
int indices[1000];
for ( ind=0; ind indices[ind] = part_num[ind];

very very quick to do, u could also do thi when youre updating the part system eg

loop ( all particles )
{
is part alive
indices[partnum] = thisone;

etc
}

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

edited by ze: using i as an element index causes the forum software to parse an italic tag. Changed 'i' to 'ind'

[edited by - zealouselixir on October 20, 2002 4:57:40 PM]

Share this post


Link to post
Share on other sites

  • 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!