Jump to content
  • Advertisement

Archived

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

dta1

GL_ARB_vertex_blend

This topic is 5462 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 can''t figure out how you''re supposed to use the GL_ARB_vertex_blend extension. I''ve read about it in the opengl extension register and came up with this code:

	glMatrixMode(GL_MODELVIEW1_ARB);
	glLoadIdentity();

	glMatrixMode(GL_MODELVIEW0_ARB);
	glLoadIdentity();

// Render other stuff...


	// Bind the texture

	glBindTexture(GL_TEXTURE_2D, texture);

	glEnable(GL_VERTEX_BLEND_ARB);

	glVertexBlendARB(2);

	float j[2] = { 0.5f, 0.5f };
	glWeightfvARB(2, j);

	glMatrixMode(GL_MODELVIEW1_ARB);

	// Draw triangles

	glBegin(GL_TRIANGLES);

	// Go through all vertices

	for(int i=0; i<m_numVertices; i++)
	{
		glTexCoord2f(m_texCoords[i].x, m_texCoords[i].y); 
		glNormal3fv	(m_normals	[i + frame * m_numVertices].data());
		glVertex3fv	(m_vertices	[i + frame * m_numVertices].data());
	}

	frame++;

	glMatrixMode(GL_MODELVIEW0_ARB);

	// Draw triangles

	glBegin(GL_TRIANGLES);

	// Go through all vertices

	for(i=0; i<m_numVertices; i++)
	{
		glTexCoord2f(m_texCoords[i].x, m_texCoords[i].y); 
		glNormal3fv	(m_normals	[i + (frame+1) * m_numVertices].data());
		glVertex3fv	(m_vertices	[i + (frame+1) * m_numVertices].data());
	}

	glEnd();

	glDisable(GL_VERTEX_BLEND_ARB);

// Render other stuff...


That''s the way I thought it was meant to be but it just renders the same model twice (on the same spot) but with different frames. I would appreciate a hint in the right direction

Share this post


Link to post
Share on other sites
Advertisement

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