Loading FBX model into DirectX application

僤鯓⒐⒋嵵緔 提交于 2019-12-25 01:56:23

问题


I am trying to render a 3d model from FBX file in my directx application, so I have loaded it using fbx sdk, but I found a big problem, probably caused by different coordinate system: DirectX use left handed, Fbx - right handed, so finally I got it rendered, but with two issues:

  • all parts of the model look mirrored by Z axis (or by X - its not clear)
  • position of the parts is incorrect after applying transformation matrix provided by FBX for each part;

So how what I can do with Vertex data and/or transformation matrix?


回答1:


You will need to save the model and transformation data in your application differently than they are stored in the file. In general, it sounds like what you need to do is:

  • Load the FBX
  • Apply the transformations to each part according to the FBX
  • Apply the transformation to invert the Z-axis on all of the vertices
  • Render/use the resulting model.

Applying the FBX transformations in the wrong coordinate systems will yield incorrect results.



来源:https://stackoverflow.com/questions/14484887/loading-fbx-model-into-directx-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!