Sign in to follow this  
spiffycrony

Loading x files

Recommended Posts

spiffycrony    122
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
robydx    225
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

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