Accessing Vertex Positions of static mesh

@: It also looks like the rotation is off. Did you change the Actors or Components transformation or both?

The way the vertices are transformed looks wrong to me. But I also still haven’t had that in-depth look at the engine I would have liked.

Lets assume you import a static mesh asset. The vertices of the static mesh are in model space just like they were imported.
Now a StaticMeshComponent has a StaticMesh. But the StaticMeshComponent can be translated, rotated, scaled. So in order to go from model to component space you have to transform the vertices through this first.
Finally a StaticMeshComponent is attached to A(n)Actor. The Actor also has a transformation consisting of translation, rotation and scale (which is applied to “all” components). To finally reach world space for the vertices the component space needs to be transformed by the actors transformation as well.
Theoretically there could be more transformations inbetween. For example if the StaticMeshComponent is attached to a socket which animates via some sort of skeleton. Depending on how “deep” this “inheritance” goes you’ll have quite a few calculations to do.

This may be completely wrong so please correct me in that case so I can learn too. :slight_smile: