Jump to content
  • Advertisement

Archived

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

nerdboy80

Creating mesh in c# from vertex data problem

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

Newbie to DX, so bear with me... I am doing the following: ------------------------------------------------- _trackMesh = new Mesh(300, 900, MeshFlags.Managed | MeshFlags.VbWriteOnly, CustomVertex.PositionNormal.Format, d); CustomVertex.PositionNormal [] vertdata2 = (CustomVertex.PositionNormal[]) _trackMesh.LockVertexBuffer(typeof(CustomVertex.PositionNormal), LockFlags.None); ------------------------------------------------- But, when I look at vertdata2 it reports it''s length as 0. Do I need to explicitly create the vertex buffer for this mesh? How would I do that? Thanks, NerdBoy

Share this post


Link to post
Share on other sites
Advertisement
You have to pass the number of vertices you want to lock as a third argument, ''ranks''. It''s a params[] argument so that''s why you were able to call the function without it -- but you don''t want to do that.

Share this post


Link to post
Share on other sites

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