Преглед изворни кода

culling of meshes (CN) (#338)

* 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)
COCO пре 2 година
родитељ
комит
3a631e0de2
1 измењених фајлова са 23 додато и 18 уклоњено
  1. 23 18
      docs/zh/manuals/mesh.md

+ 23 - 18
docs/zh/manuals/mesh.md

@@ -46,24 +46,7 @@ Mesh 组件包含一些列属性:
 
 ## 运行时操作
 
-可以使用 Defold 缓存在运行时修改3D网格.
-
-## 材质常量
-
-{% include shared/material-constants.md component='mesh' variable='tint' %}
-
-`tint`
-: 3D网格颜色 (`vector4`). 四元数 x, y, z, 和 w 分别对应红, 绿, 蓝和不透明度.
-
-## 顶点的局部/世界坐标空间
-如果3D网格材质的坐标空间设为局部坐标空间, 则数据会原封不动传入着色器, 这样通常要在着色器程序里进行GPU顶点/法线的转换.
-
-如果3D网格材质的坐标空间设为世界坐标空间, 则必须要么提供默认的 “位置” 和 “法线”, 流, 要么在编辑3D网格时, 在下拉菜单中选择好. 这样便于引擎把同样是世界坐标系的3D网格进行数据合批.
-
-## 举例
-关于3D网格操作及示例项目和代码片段请参考 [这个论坛帖子](https://forum.defold.com/t/mesh-component-in-defold-1-2-169-beta/65137).
-
-用三角形建立方块的例子:
+可以使用 Defold 缓存在运行时修改3D网格. 下面是一个使用三角面生成方块的例子:
 
 ```Lua
 
@@ -100,3 +83,25 @@ end
 local res = go.get("#mesh", "vertices")
 resource.set_buffer(res, buf)
 ```
+
+关于如何使用 Mesh 组件, 示例项目和代码片段, 详情参见 [论坛发布帖子](https://forum.defold.com/t/mesh-component-in-defold-1-2-169-beta/65137).
+
+## 视锥体剔除
+
+Mesh 不会被自动剔除, 因为它们具有动态特性, 而且无法确定位置数据的编码方式. 为了剔除网格, 需要使用 6 个浮点数, 把轴对齐的边界框设置为缓存元数据 (AABB 最小/最大):
+
+```lua
+buffer.set_metadata(buf, hash("AABB"), { 0, 0, 0, 1, 1, 1 }, buffer.VALUE_TYPE_FLOAT32)
+```
+
+## 材质常量
+
+{% include shared/material-constants.md component='mesh' variable='tint' %}
+
+`tint`
+: 3D网格颜色 (`vector4`). 四元数 x, y, z, 和 w 分别对应红, 绿, 蓝和不透明度.
+
+## 顶点的局部/世界坐标空间
+如果3D网格材质的坐标空间设为局部坐标空间, 则数据会原封不动传入着色器, 这样通常要在着色器程序里进行GPU顶点/法线的转换.
+
+如果3D网格材质的坐标空间设为世界坐标空间, 则必须要么提供默认的 “位置” 和 “法线”, 流, 要么在编辑3D网格时, 在下拉菜单中选择好. 这样便于引擎把同样是世界坐标系的3D网格进行数据合批.