Sign in to follow this  

Making copies of same mesh in vertex buffer - how should indices be modified?

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

I'm trying to make multiple copies of the same vertex buffer in a larger vertex buffer. I can make the vertex copies fine (it would seem) however I'm having problems with copying th eindices, since its the same vertex buffer the indices have to change and cannot simply be copy+pasted within the same index buffer. What I do is: Create a vertex buffer x times larger than the vertex buffer I'm copying from fill large vertex buffer with values from the small vertex buffer, once I reach the end of the small vertex buffer I reset the counter to 0 and start over. I've checked the values and they're all correct (i.e. I know for sur eI'm copying th ebuffer values properly and doing so multiple times) I create an index buffer x times larger than the index buffer I'm copying from I copy the smaller index buffer to the larger one, after filling it up once I offset the value of the small index buffer by the number of vertices then I set them to the larger index buffer. This does not seem to work, I'm fairly certain my idea behind creating a larger index buffer are flawed since when I render without an index buffer set the model shows up broken but in a consistantly broken way (i.e. all the triangles look the same but don't connect to other triangles properly). I'm really not sure what I sould be doing? Maybe it's just late (4am) and I've been working on this for the past four-ish hours...

Share this post


Link to post
Share on other sites
nvm, just figured out I shouldn't be incrementing the indice value by the number of indices the model has but by the largest indice(+1), it makes so much sense actually, I don't understand why I thought doing the other thing would work...

Now off to bed before I actually break code...

Share this post


Link to post
Share on other sites

This topic is 2846 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this