Sign in to follow this  
waZim

Problem with Vertex Buffer Objects (VBO) using Indexed data (IBO)

Recommended Posts

hi All, I am saving my 3D model data in 3 seperate Indexed Lists which i exported from a Collada file, in the following format..
	VertexList = // N Number of Vertices
	{ 
		x1,y1,z1,
		x2,y2,z2,
		x3,y3,z3,
		.....
	};
	NormalsList = // M Number of Normals
	{ 
		x1,y1,z1,
		x2,y2,z2,
		x3,y3,z3,
		.....
	};
	TexCoordsList = // O Number of TexCoords
	{ 
		s1,t1,
		s2,t2,
		s3,t3,
		.....
	};

	IndexList = // (NumberOfTriangles * 3 * 3) Number of Indices 
	{
		t1.v1.V, t1.v1.N, t1.v1.T, // Triangle 1 Vertix 1 Indices
		t1.v2.V, t1.v2.N, t1.v2.T, // Triangle 1 Vertix 2 Indices
		t1.v3.V, t1.v3.N, t1.v3.T, // Triangle 1 Vertix 3 Indices

		t2.v1.V, t2.v1.N, t2.v1.T, // Triangle 2 Vertix 1 Indices
		t2.v2.V, t2.v2.N, t2.v2.T, // Triangle 2 Vertix 2 Indices
		t2.v3.V, t2.v3.N, t2.v3.T, // Triangle 2 Vertix 3 Indices

		.......................... // And so on
	};


Now How collada Compresses those Lists is, that the Size of all those 3 Lists are different, Note "N", "M" and "O" Number of Vertices, Normals and TexCoords respectively... How can i render this data using VBO and glDrawElements() or anything else. except duplicating the vertices which have different set of (Normals,TexCoord) from the vertices List... In Other Words, re-Creating the Vertex Lists and so on.. If i put the Data "As it is" in VBOs each for Verext, Normals and TexCoords and then Put the Indices in an IBO. glDrawElements only considers the count Number of Indices from the List of Indices and Fetches the Same Index Data from all the 3 VBOs (Vertex, Normals, TexCoords)..

Share this post


Link to post
Share on other sites

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