Sign in to follow this  
jor1980

[SlimDx]create mesh form index and vertex buffer

Recommended Posts

jor1980    152
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
jor1980    152
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
Washu    7829
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
Washu    7829
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

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