Read Static Mesh Data into Procedural Mesh
Hey Guys, So I'm currently working on reading in the render data from a static mesh and using it to create a procedural mesh so I can deform it at runtime, but running into issues with getting the mesh to render properly. Here's the current function I have for reading in the render data using it:
Currently it'll render only the first 1/3 of the mesh. My hunch is the hard-coded normals I'm using for generation, but I can't really find any normal info inside FStaticMeshLODResources. Any ideas? Thanks
asked May 09 '16 at 04:25 AM in C++ Programming
You're not getting all of the indices. With a triangle list that actually uses the indices correctly it will have quite a few more indices than vertices. Best thing to do is a separate loop that looks at indexBuffer.GetNumIndices() and copies all of them to the triangles array you have.
For an example, it's possible to have a cube with only 8 vertices but still need 36 indices to makeup all 12 triangles.
To copy the indices, something like this should get them all.
Follow this question
Once you sign in you will be able to subscribe for any updates here