将 FBX 模型加载到 DirectX 应用程序中 [英] Loading FBX model into DirectX application

查看:54
本文介绍了将 FBX 模型加载到 DirectX 应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 Directx 应用程序中的 FBX 文件渲染 3d 模型,所以我使用fbx sdk加载它,但我发现了一个大问题,可能是由不同的坐标系引起的:DirectX使用左手,Fbx - 右手,所以最后我得到了它的渲染,但有两个问题:

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:

  • 模型的所有部分看起来都被 Z 轴(或 X - 不清楚)镜像了
  • 应用FBX提供的变换矩阵后零件的位置不正确每个部分;

那么我可以如何处理顶点数据和/或转换矩阵?

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

推荐答案

您将需要在应用程序中保存模型和转换数据,而不是将它们存储在文件中.一般来说,听起来你需要做的是:

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:

  • 加载 FBX
  • 根据 FBX 将变换应用于每个部分
  • 应用变换以反转所有顶点上的 Z 轴
  • 渲染/使用生成的模型.

在错误的坐标系中应用 FBX 变换会产生错误的结果.

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

这篇关于将 FBX 模型加载到 DirectX 应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆