Jump to content
  • Advertisement
Sign in to follow this  
noatom

Concatenating indices for meshes

This topic is 2076 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 basically trying to get all the data from all the meshes and put them into a single buffer(a buffer for vertices,one for indices). The models are of TriangleList type.

 

Here's how I'm currently doing it:

vector<unsigned long> finall_indices;
	unsigned long indices_before_adding = 0;
	for (long long i = 0; i < meshes.size(); i++){
		for (long long s = 0; s < meshes.at(i)->index_queue.size(); s++){
			finall_indices.push_back(meshes.at(i)->index_queue.at(s)+ indices_before_adding);
		}
		indices_before_adding += meshes.at(i)->index_queue.size();
	}

However,there are some problems,like missing quads. The indices are fine,because I tested them when I did not put all the mesh data together.

 

What am I doing wrong?

 

 

 

Answer:

 

To indices_before_adding should be added the nr of vertices in the last mesh,every time a new mesh's indices are added to the finall_indices mesh.

Edited by noatom

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!