Jump to content

  • Log In with Google      Sign In   
  • Create Account


Concatenating indices for meshes


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 noatom   Members   -  Reputation: 782

Like
1Likes
Like

Posted 10 February 2014 - 02:19 PM

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, 10 February 2014 - 03:54 PM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS