优化三维资源

Optimizing 3D Assets

优化三维资源

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中,可以导入使用三维建模工具创建的三维模型和场景。要查看支持的文件格式,请参阅Balsam工具文档。

3D Content Overview

三维内容概述

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中使用的三维资源的概述。有关详细信息,请参见正在使用的特定三维建模工具的部分。

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.
  • 变换 正如所期望的,可以导入完整的三维变换信息,包括位置、旋转、缩放和轴。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帧/秒,它可能会播放3秒,但如果你降低到30帧/秒时,动画会慢得多。
  • 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.
  • 使用两次方纹理贴图像素尺寸 与大多数实时图形的情况一样,当纹理贴图的像素尺寸设置为二次方时,纹理贴图会以最佳方式运行。

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向上坐标系,确保“上轴”设置为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

© 2024 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值