Jump to content
  • Advertisement
Sign in to follow this  
spiffycrony

Loading x files

This topic is 4089 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
×

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!