Pārlūkot izejas kodu

gltf model file support (CN) (#340)

* update physics

* update input

* update

* update code sharing in getting-help.md

* Export Compliance

* update on file i/o

* pi / 4

* inputs

* forum url

* read only user

* html5 gamepad

* sdk api update

* update

* image properties

* update editor

* defold sdk update

* animation updates

* animation fix

* run as admin

* update bob

* update about AndroidX support

* software render

* linux-faq.md update

* 4.28.2021 updates

* Basis Universal format

* sound & mesh

* gamepad event mapping

* admob url

* Minor edit to building blocks intro text

* update gamepad & ios

* project settings

* libffi version

* scaling

* image compression

* update gamepads

* increase memory

* caching assets

* update 2021/10/6

* update 2021/10/16
blend-modes.md

* update 2021/11/12

* allow dynamic transforms update

* Bundle update

* update faq

* bullet & bob

* script properties update

* editor-styling

* build server url

* editor templates

* spine extension update

* Fix typo in the "optimizations" word in Chinese docs

* Update to material.md - Constants buffers

* Verify Graphics Calls

* H5 parameters

* OpenJDK downloads

* cn update corresponds to [pull 259](https://github.com/defold/doc/pull/259)

* application security

* porting guidelines

* update for 8f1651f

* cn update for 094bf6f

* cn update for 20fdfc5 & 6263317

* cn update for 7/19/2022

* title

* profiling update

* update editor.md

* update bob.md

* update shortcuts

* update fixed update note

* Update properties.md

* Update material.md

* Updates links

* Update bob help with the latest info

* camera & renderer

* Updated android keystore info zh_cn

* bundling.md release vs debug zh_cn

* update bob.md & gui-clipping.md

* contentless bundle

* consoles update

* model animation link

* gamepad & faq

* remove a camera lib

* font shadow render mode fix

* updates about app-manifest and others

* Update script.md

* includes in shaders

* editor scripts

* material updates

* Added dynamic atlas and texture creation

* fixes for atlas and some others

* update screenshots and add explanations (CN)

* add a line about Dynamic Prototype (CN)

* remove "inline" marks in pics

* de-translate the subtitle "Running the debugger" & images fix

* bundle identifier restrictions

* node properties Enabled and Visible (CN)

* release checklist & slice-9

* Update project-settings.md (CN)

* Update camera.md (CN)

* Update project-settings.md (CN)

* culling of meshes (CN)

* Update project-settings.md (CN)

* gltf model file support (CN)
COCO 2 gadi atpakaļ
vecāks
revīzija
688def2fbb

+ 1 - 1
docs/zh/manuals/glossary.md

@@ -125,7 +125,7 @@ msg.post("#weapon", "disable")
 
 ## Model
 
-![Model](images/icons/model.png){.left} 3D 模型组件支持在游戏中使用 Collada 网格模型, 骨骼和动画. 详情请见 [模型教程](/manuals/model/).
+![Model](images/icons/model.png){.left} 3D 模型组件支持在游戏中使用 glTF 和 Collada 网格模型, 骨骼和动画. 详情请见 [模型教程](/manuals/model/).
 
 ## ParticleFX
 

+ 1 - 1
docs/zh/manuals/importing-assets.md

@@ -25,7 +25,7 @@ Defold 支持 PNG 和 JPEG 图片格式. 其中 PNG 图片必须是 32 位 RGBA
 * 图片可以用来实现2D游戏常见的各种可视内容. 详情请见 [如何导入和使用2D图像](/manuals/importing-graphics).
 * 声音文件可以用 [声音组件](/manuals/sound)来播放.
 * 字体文件 可以用于 [Label 组件](/manuals/label) 和GUI中的 [text 节点](/manuals/gui-text).
-* Collada 模型可以用于 [Model 组件](/manuals/model) 来显示3D模型和动画. [关于3D模型导入详见这里](/manuals/importing-models).
+* glTF 和 Collada 模型可以用于 [Model 组件](/manuals/model) 来显示3D模型和动画. [关于3D模型导入详见这里](/manuals/importing-models).
 
 
 ## 编辑外部资源

+ 18 - 19
docs/zh/manuals/importing-models.md

@@ -4,12 +4,22 @@ brief: 本教程介绍了通过模型组件导入 3D 模型的方法.
 ---
 
 # 导入3D模型
-Defold 目前支持 Collada *.dae* 格式的骨骼和动画模型. 可以使用类似 Maya, 3D Max, Sketchup 和 Blender 的软件保存或者转换3D模型为Collada格式. Blender 是一个著名的3D建模, 动画及渲染软件. 它在 Windows, macOS 和 Linux 都能运行并且在 http://www.blender.org 上免费下载.
+Defold 目前支持 GL Transmission Format *.glTF* 和 Collada *.dae* 格式的模型,骨骼和动画. 可以使用类似 Maya, 3D Max, Sketchup 和 Blender 的软件保存或者转换3D模型为Collada格式. Blender 是一个著名的3D建模, 动画及渲染软件. 它在 Windows, macOS 和 Linux 都能运行并且在 http://www.blender.org 上免费下载.
 
 ![Model in Blender](images/model/blender.png){srcset="images/model/[email protected] 2x"}
 
-## 导出 Collada 格式文件
-导出的 Collada 格式文件扩展名是 *.dae*. 此文件包含模型所有的点, 边和面的信息, 如果模型贴了图, 同时还包含 _UV 坐标_ (用于确定纹理如何铺在模型表面), 以及骨架骨骼和动画数据.
+## 导入模型到 Defold
+要导入模型, 只需将 *.gltf* 文件或者 *.dae* 文件及其相应贴图拖拽至 *资源面板* 即可.
+
+![导入模型资源](images/model/assets.png){srcset="images/model/[email protected] 2x"}
+
+
+## 使用模型
+当模型导入到 Defold 之后即可在 [模型组件](/manuals/model) 上使用它.
+
+
+## 导出 glTF 和 Collada 格式文件
+导出的 *.gltf* 或 *.dae* 文件包含模型所有的点, 边和面的信息, 如果模型贴了图, 同时还包含 _UV 坐标_ (用于确定纹理如何铺在模型表面), 以及骨架骨骼和动画数据.
 
 * 关于多边形网格的解释详见 http://en.wikipedia.org/wiki/Polygon_mesh.
 
@@ -25,13 +35,12 @@ Defold 对于导出的动画作了一些限制:
 
 
 ### 需求
-对于导出的 Collada 格式模型需遵循以下需求:
+导出模型的时候需遵循以下需求:
 
 * 模型必须由单个网格组成
 * 模型必须使用单个材质
+* 导出的 *.gltf* 文件要嵌入网格数据. 附带于其他文件的二进制网格数据不受支持. 
 
-
-#### 网格组合
 可以使用 Blender 来组合多个网格. 选中所有网格, 按 `CTRL`/`CMD` + `J` 来进行组合操作.
 
 ![组合网格](images/model/blender_join_meshes.png)
@@ -43,7 +52,7 @@ Defold 对于导出的动画作了一些限制:
 ![删除材质](images/model/blender_remove_materials.png)
 
 
-#### 导出纹理
+### 导出纹理
 如果模型没有纹理, 可以使用 Blender 来生成一个. 这个工作要在删除多余材质之前完成. 从选择网格及其所有的点开始:
 
 ![Select all](images/model/blender_select_all_vertices.png)
@@ -61,17 +70,7 @@ Defold 对于导出的动画作了一些限制:
 ![Export UV layout result](images/model/blender_export_uv_layout_result.png)
 
 
-## 从 Blender 中导出
-从导出菜单选项中导出 Collada 格式文件. 选中模型然后点选 导出为 Collada 菜单项, 选中 "Selection Only" 选项即可导出文件.
+### 从 Blender 中导出
+从导出菜单选项中导出模型文件. 选中模型然后点选导出模型菜单项, 选中 "Selection Only" 选项即可导出文件.
 
 ![Exporting using Blender](images/model/blender_export.png)
-
-
-## 导入到 Defold 中
-要导入模型, 只需要把 *.dae* 文件及其相应纹理图片拖放到 *资源面板* 里即可.
-
-![Imported model assets](images/model/assets.png){srcset="images/model/[email protected] 2x"}
-
-
-## 使用模型
-模型导入 Defold 后就可以使用 [模型组件](/manuals/model) 了.

+ 3 - 3
docs/zh/manuals/model.md

@@ -23,7 +23,7 @@ Model 组件和其他游戏对象组件一样, 两种创建办法:
 除了常见的 *Id*, *Position* 和 *Rotation* 属性, 模型组件还有如下特有属性:
 
 *Mesh*
-: 这个属性指定 Collada *.dae* 文件的模型网格. 如果文件包含多组网格, 只读取第一个.
+: 这个属性指定 glTF *.gltf* 或者 Collada *.dae* 文件的模型网格. 如果文件包含多组网格, 只读取第一个.
 
 *Material*
 : 添加合适的材质. 一开始可以使用默认的 *model.material* 材质.
@@ -32,7 +32,7 @@ Model 组件和其他游戏对象组件一样, 两种创建办法:
 : 指定适当的纹理.
 
 *Skeleton*
-: 指定 Collada *.dae* 文件里的骨骼. 注意Defold只支持一个骨骼树.
+: 指定 glTF *.gltf* 或者 Collada *.dae* 文件里的骨骼. 注意Defold只支持一个骨骼树.
 
 *Animations*
 : 指定模型的 *动画集文件*.
@@ -90,7 +90,7 @@ go.animate("#model", "cursor", go.PLAYBACK_LOOP_PINGPONG, 1, go.EASING_LINEAR, 1
 
 ## 材质
 
-3D 一半都有给网格赋予材质的功能, 比如颜色和贴图. 在 Collada *.dae* 文件输出时, 这些信息被写入文件. 应该基于游戏需要选择或者建造 _高性能_ 材质. 材质由 _着色器程序_ 及其若干相关属性组成.
+3D 一半都有给网格赋予材质的功能, 比如颜色和贴图. 这些信息保存在由 3D 软件输出的 glTF *.gltf* 或者 Collada *.dae* 文件中. 应该基于游戏需要选择或者建造 _高性能_ 材质. 材质由 _着色器程序_ 及其若干相关属性组成.
 
 在内置材质文件夹里有一个3D模型材质. 如果需要自定义材质, 请参考 [材质文档](/manuals/material). [着色器教程](/manuals/shader) 介绍了着色器程序的工作方式.