优化3D资产

Optimizing 3D Assets

优化3D资产

In Qt Quick 3D, you can import 3D models and scenes that are created using 3D modeling tools. To see the supported file formats, see the Balsam tool documentation.

​在Qt Quick 3D中,可以导入使用3D建模工具创建的3D模型和场景。要查看支持的文件格式,请参阅Balsam工具文档。

3D Content Overview

3D内容概述

In this section, you will find an overview of creating and exporting 3D assets to use in Qt Quick 3D. For more detailed information, see the section for the specific 3D modeling tool that you are using.

​在本节中,您将看到创建和导出要在Qt Quick 3D中使用的3D资源的概述。有关更详细的信息,请参见有关您正在使用的特定三维建模工具的部分。

Geometry

几何体

  • Use Triangles Qt Quick 3D only supports geometry exported as triangles. Many 3D modeling tools provide an option to triangulate meshes during export, while you must do it manually before the export with some tools. If models are not triangulated on export, they will be triangulated on import which may lead to less than optimal results. If models are exported using primitives that can not be triangulated, then those primitives will be ignored on import.
  • 使用三角形Qt Quick 3D仅支持导出为三角形的几何体。许多三维建模工具都提供了在导出过程中对网格进行三角剖分的选项,而在使用某些工具导出之前,必须手动执行此操作。如果模型在导出时未三角化,则它们将在导入时三角化,这可能导致不理想的结果。如果模型是使用无法三角剖分的基本体导出的,则在导入时将忽略这些基本体。
  • Handling Pivot Points Each DCC (Digital Content Creation) tool handles pivot points differently. In Qt Quick 3D, there is only one pivot per object and it is used as the origin for position, scale, and rotation operations. In your DCC tool, feel free to adjust the position of a 3D model's pivot as needed. However, extreme edits to pivots in 3D modeling tools can cause problems upon import, especially if animated. This difference is often manifested as a difference in the position or orientation of an object. As an artist, you can prevent these kinds of problems by only making simple edits to your pivot points. Keep your pivot points to the default (world) alignment, don't scale them, and make sure that if you have multiple pivots (Maya) that they are all at the same location in space.
  • 处理枢轴点每个DCC(数字内容创建)工具处理枢轴点的方式不同。在Qt Quick 3D中,每个对象只有一个轴,它用作位置、缩放和旋转操作的原点。在DCC工具中,可以根据需要自由调整三维模型轴的位置。但是,在三维建模工具中对枢轴进行极端编辑可能会导致导入时出现问题,尤其是在设置动画时。这种差异通常表现为物体位置或方向的差异。作为一名艺术家,您可以通过对轴心点进行简单编辑来防止此类问题。将轴点保持默认(世界)对齐,不要缩放它们,并确保如果有多个轴(Maya),它们都位于空间中的同一位置。
  • Transformation As you would expect you can import full 3D transform information including position, rotation, scale, and pivot. Qt Quick 3D can handle right-handed coordinate systems, Y-up and quaternion based rotation. The principal limitation in this area is pivot points. As discussed above, only simple edits to pivot points are supported.
  • 变换正如您所期望的,您可以导入完整的3D变换信息,包括位置、旋转、缩放和轴。Qt Quick 3D可以处理右手坐标系、Y向上和基于四元数的旋转。这方面的主要限制是枢轴点。如上所述,仅支持对轴点进行简单编辑。

Most DCC tools allow artists to freeze transformations, and we highly recommend performing this operation before importing mesh data into Qt Quick 3D. This operation ensures that the imported mesh has clean transformation data and no arbitrary transformation values, which can be confusing or an impediment to your work.

大多数DCC工具允许艺术家冻结变换,我们强烈建议在将网格数据导入Qt Quick 3D之前执行此操作。此操作确保导入的网格具有干净的变换数据,并且没有任意变换值,这可能会造成混淆或妨碍您的工作。

Note: After freezing transforms, you may have to reposition the pivot point in some DCC tools.

注意:冻结变换后,可能需要在某些DCC工具中重新定位轴点。

Animations

动画

Animations are supported on imported attribute. Position, rotation, scale, and pivot can all be animated. An example of our advanced support for animations would be a hierarchy of items, rotated simultaneously on an arbitrary axis.

导入属性支持动画。位置、旋转、缩放和枢轴都可以设置动画。我们对动画的高级支持的一个例子是在任意轴上同时旋转的项目层次结构。

  • Time-based Animations By default, in many 3D modeling tools, when you are creating keyframes you are associating them with certain frame numbers. This is great in the film industry where frame rates are constant, but this technique necessarily has problems in applications where the frame rate may not be rock solid. Our solution to this problem is to express the locations of keyframes in time values instead of frame numbers. That way, if you say "this logo animation plays for 3 seconds", we can guarantee that it plays for 3 seconds. If you express it in frames, "this logo animation plays for 180 frames", it may play for 3 seconds if you're getting 60 fps, but if you drop to 30 fps the animation is going to go much slower.
  • 基于时间的动画 默认情况下,在许多三维建模工具中,在创建关键帧时,会将它们与某些帧编号关联。这在帧速率恒定的电影行业中很好,但这种技术在帧速可能不稳定的应用中必然存在问题。我们解决这个问题的方法是用时间值而不是帧号来表示关键帧的位置。这样,如果你说“这个标志动画播放3秒”,我们可以保证它播放3秒。如果你用帧来表达它,“这个标志动画播放180帧”,如果你得到60 fps,它可能会播放3秒,但如果你降低到30 fps,动画会慢得多。

Luckily, accounting for this is relatively simple. Many 3D modeling tools default to a setting of 24 frames per second, so your keyframes are translated at that ratio. If you want a keyframe at one second, put it on frame 24. Two seconds? Frame 48, and so on. Usually, configurable frame rates are offered, and the frame rate setting should be respected upon import. It's also worthwhile to note that for example Maya, starts at frame one by default. If you have a keyframe at frame one, the time for that keyframe is 1/24 or 0.041 seconds. It may be a good idea to go into your Maya animation settings and start your animations at frame 0, or 0/24 = 0 seconds.

幸运的是,解释这一点相对简单。许多三维建模工具默认设置为每秒24帧,因此您的关键帧将按该比率转换。如果您想在一秒钟内设置关键帧,请将其放置在第24帧。两秒钟?帧48等。通常提供可配置的帧速率,导入时应遵循帧速率设置。还值得注意的是,例如Maya,默认情况下从第一帧开始。如果在第一帧有一个关键帧,则该关键帧的时间为1/24或0.041秒。最好进入Maya动画设置,并在第0帧或0/24=0秒处开始动画。

  • Different Animation Systems 3D modeling tools offer highly complex and specialized animation systems. We recommend using Qt Quick 3D's animation capabilities whenever practical. This helps in keeping the mesh information clean on import.
  • 不同的动画系统 3D建模工具提供高度复杂和专业化的动画系统。我们建议尽可能使用Qt Quick 3D的动画功能。这有助于在导入时保持网格信息干净。
  • Baking Animations You must bake all animations before exporting.
  • 烘焙动画 必须在导出之前烘焙所有动画。

Materials

材质

For materials, material slot IDs and UV layouts are imported.

对于材质,将导入材质槽ID和UV布局。

  • Textures Images applied to different material IDs are imported. We recommend using .png or compressed image formats.
  • 纹理 导入应用于不同材质ID的纹理图像。我们建议使用.png或压缩图像格式。
  • Using Powers of Two Texture Map Pixel Dimensions As is the case with most real-time graphics, texture maps run optimally when their pixel dimensions are set to powers of two. See image dimensions for more detailed information on images.
  • 使用二的幂纹理贴图像素维度 ​与大多数实时图形一样,使用两个纹理贴图像素维度的幂,当纹理贴图的像素维度设置为二的幂时,纹理贴图运行最佳。有关图像的详细信息,请参见图像尺寸。

Lights and Cameras

灯光与摄影机

Lights and cameras can be imported.

可以导入灯光和相机。

  • Lights For light, directional, point, and spot lights with position, rotation, light color, and the attenuation factors properties will be imported.
  • 灯光 将导入具有位置、旋转、灯光颜色和衰减因子属性的灯光、平行光、点光源和聚光灯的灯光。
  • Cameras Perspective and orthographic cameras can be imported. Position, and rotation properties are imported, as well as start and end clipping. For perspective cameras, field of view is also imported.
  • 摄影机 可以导入摄影机透视和正交摄影机。将导入位置和旋转特性以及开始和结束剪裁。对于透视摄影机,还将导入视野。

Other

其他

  • Axis Conversion Qt Quick 3D uses a Y-up coordinate system, ensure that Up Axis is set to Y.
  • 轴转换 Qt Quick 3D使用Y-up坐标系,确保将上轴设置为Y。
  • Hierarchy Qt Quick 3D supports importing hierarchical information. Hierarchies of arbitrary depth are supported, including grouped nodes. Hierarchical transforms are applied as expected.
  • 层级 Qt Quick 3D的层次结构支持导入层次结构信息。支持任意深度的层次结构,包括分组节点。按预期应用分层变换。

Exporting from Different Tools

从不同工具导出

Tool 工具
Maya
Blender
3D Studio Max
Modo

© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值