• Advertisement
Sign in to follow this  

Loading x files

This topic is 3941 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 am loading a directx x file into a Mesh object as follows Dim mesh_ = Mesh.FromFile(MyBase.OutputFile, MeshFlags.DoNotClip, device) When i get the vertices as follows the normal values are 0. Dim Mesh2 As Mesh = mesh_.Clone(MeshFlags.Managed, VertexFormats.PositionNormal Or VertexFormats.Diffuse, direct3DDevice) mesh_ = mesh_.Clone(MeshFlags.Managed, VertexFormats.PositionNormal Or VertexFormats.Diffuse, direct3DDevice) Mesh2.Dispose() Dim source() As CustomVertex.PositionNormalColored = mesh_.LockVertexBuffer(GetType(CustomVertex.PositionNormalColored), 0, mesh_.NumberVertices) How to make sure the normals are updated in the mesh object when loading from directx x file?

Share this post


Link to post
Share on other sites
Advertisement
Use normalize method.

I suggest you to clone mesh using vertex declaration and not vertex format.
If you need some help visit my website, you can find a lot of sample of managed directX programming in VB.Net



Share this post


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

  • Advertisement