• Advertisement
Sign in to follow this  

[SlimDx]create mesh form index and vertex buffer

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

Hi a am using Visual basic with SlimDx, and i want to create a mesh but i don´t know how to load the indexbuffer and the vertexbuffer into the mesh, i put the next code: Dim malla As New Mesh(device, 2967, 2993, MeshFlags.Dynamic, VertexFormat.Position Or VertexFormat.Diffuse) And i don´t know how to set the vertexbuffer and the indexbuffer into this new mesh

Share this post


Link to post
Share on other sites
Advertisement
You need to lock the appropriate buffers and then dump the data into them.

Share this post


Link to post
Share on other sites
Quote:
Original post by Washu
You need to lock the appropriate buffers and then dump the data into them.


i am a little bit confuse because in directx i did in this way:

Dim malla As New Mesh(2967, 2993, MeshFlags.Dynamic, CustomVertex.PositionTextured.Format, device)
malla.VertexBuffer.SetData(verticest, 0, LockFlags.None)

malla.IndexBuffer.SetData(indices, 0, LockFlags.None)


but slimdx hasn´t the option malla.vertexbuffer.setdata so i don´t know how to do it.

Anyone has a little example?

Share this post


Link to post
Share on other sites
See the BaseMesh.LockVertexBuffer(LockFlags)(LockFlags) and BaseMesh.LockIndexBuffer(LockFlags) methods in the SlimDX Documentation.

Share this post


Link to post
Share on other sites
i am watching the slimdx documentatiom but it hasn´t some explanation about BaseMesh.LockvertexBuffer and BaseMesh.LockIndexBuffer

Share this post


Link to post
Share on other sites
Quote:
Original post by jor1980
i am watching the slimdx documentatiom but it hasn´t some explanation about BaseMesh.LockvertexBuffer and BaseMesh.LockIndexBuffer


That's because you are expected to look at the STRANGELY SIMILARLY named methods in the DirectX documentation

SlimDX is a light wrapper around DirectX. As such, almost all functions in SlimDX have a counterpart in DirectX.

Share this post


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

  • Advertisement