JavaFX文档翻译——TriangleMesh篇

Defines a 3D triangle mesh that consists of its associated VertexFormat and a set of separate arrays of vertex components such as points, normals, texture coordinates, and an array of faces that define the individual triangles of the mesh.

TriangleMesh类定义了一个3D的三角形网格,这个网格由它相关的VertexFormat类和一组独立的顶点组件数组组成。其中,顶点组件包括:点、法线、纹理坐标和一组定义单个三角形网格的表面数组。

Note that the term point, as used in the method names and method descriptions, actually refers to a 3D point (x, y, z) in space representing the position of a single vertex. The term points (plural) is used to indicate sets of 3D points for multiple vertices.

请注意,在函数名和函数描述中所谓的“点”,实际上是指三维空间中的一个点。

Similarly, the term normal is used to indicate a 3D vector (nx, ny, nz) in space representing the direction of a single vertex. The term normals (plural) is used to indicate sets of 3D vectors for multiple vertices.

相似的,术语“法线”是用来表示空间中的一个3维矢量,这个矢量代表一个点的方向。

The term texCoord is used to indicate a single pair of 2D texture coordinates (u, v) for a single vertex, while the term texCoords (plural) is used to indicate sets of texture coordinates for multiple vertices.

术语“texCoord”用来表示一个顶点的2维纹理坐标(u,v)。术语“texCoords”被用来表示多个顶点的一组纹理坐标。

Lastly, the term face is used to indicate 3 set of interleaving points, normals (optional, depending on the associated VertexFormat) and texture coordinates that together represent the geometric topology of a single triangle, while the term faces (plural) is used to indicate sets of triangles (each represent by a face).

最后,术语“face”表示一组“点”、“法线”、“纹理坐标”的集合,一个face表示一个三角形的几何拓扑。其中“法线”是可选的,依赖于相关的VertexFormat。术语“faces”表示一组三角形的几何拓扑。

For example, the faces with VertexFormat.POINT_TEXCOORD that represent a single textured rectangle, using 2 triangles, have the following data order: [ p0, t0, p1, t1, p3, t3, // First triangle of a textured rectangle p1, t1, p2, t2, p3, t3 // Second triangle of a textured rectangle ]

例如,一个拥有VertexFormat.POINT_TEXCOORD属性的faces代表了一个具有纹理的长方形,这个长方形由两个三角形构成,这个faces的数据结构如下: [ p0,t0,p1,t1,p3,t3, //具有纹理的长方形的第一个三角形 p1,t1,p2,t2,p3,t3//长方形的第二个三角形 ]

whereas the faces with VertexFormat.POINT_NORMAL_TEXCOORD that represent a single textured rectangle, using 2 triangles, have the following data order: [ p0, n0, t0, p1, n1, t1, p3, n3, t3, // First triangle of a textured rectangle p1, n1, t1, p2, n2, t2, p3, n3, t3 // Second triangle of a textured rectangle ]

然而,如果faces具有参数VertexFormat.POINT_NORMAL_TEXCOORD,那么这个faces代表了一个具有纹理的3D长方形,faces的数据结构如下: [ p0, n0, t0, p1, n1, t1, p3, n3, t3, // 具有纹理的长方形的第一个三角形 p1, n1, t1, p2, n2, t2, p3, n3, t3 // 长方形的第二个三角形 ]

where p0, p1, p2 and p3 are indices into the points array, n0, n1, n2 and n3 are indices into the normals array, and t0, t1, t2 and t3 are indices into the texCoords array.

p0, p1, p2和p3的位置代表着点的数组,n0, n1, n2和n3为法线数组,t0, t1, t2和t3为纹理坐标数组。

A triangle has a front and back face. The winding order of a triangle’s vertices determines which side is the front face. JavaFX chooses the counter-clockwise (or right-hand rule) winding order as the front face. By default, only the front face of a triangle is rendered. See CullFace for more information.

一个三角形有正反两面。三角形顶点的绕组顺序决定了哪一面是正面。JavaFX选择了逆时针方向的环绕顺序作为正面。在默认情况下,只有三角形的正面会被渲染。

The length of points, normals, and texCoords must be divisible by 3, 3, and 2 respectively. The length of faces must be divisible by 6 if it is of VertexFormat.POINT_TEXCOORD else it must be divisible by 9 if it is of VertexFormat.POINT_NORMAL_TEXCOORD. The values in the faces array must be within the range of the number of vertices in the points array (0 to points.length / 3 - 1) for the point indices, within the range of the number of vertices in the normals array (0 to normals.length / 3 - 1) for the normal indices, and within the range of the number of the vertices in the texCoords array (0 to texCoords.length / 2 - 1) for the texture coordinate indices.

点、法线、纹理坐标的长度必须能被3、3、2整除。如果faces携带VertexFormat.POINT_TEXCOORD属性,那么faces的长度必须能被6整除,如果faces携带VertexFormat.POINT_NORMAL_TEXCOORD属性,那么它的长度必须能被9整除。

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏搞前端的李蚊子

Html5模拟通讯录人员排序(sen.js)

// JavaScript Document  var PY_Json_Str = ""; var PY_Str_1 = ""; var PY_Str_...

5846
来自专栏WOLFRAM

错觉艺术的巅峰,错觉图形大师M.C. Escher的不可能方块的可能模型

1333
来自专栏增长技术

App Guide相关

##TourGuide https://github.com/worker8/TourGuide

702
来自专栏余生开发

echarts太阳分布图-饼图来回穿梭

var dom = document.getElementById("container");

1142
来自专栏码匠的流水账

聊聊HystrixThreadPool

hystrix-core-1.5.12-sources.jar!/com/netflix/hystrix/HystrixThreadPool.java

761
来自专栏linux驱动个人学习

高通Audio中ASOC的machine驱动

ASoC被分为Machine、Platform和Codec三大部分,其中的Machine驱动负责Platform和Codec之间的耦合以及部分和设备或板子特定的...

9664
来自专栏MelonTeam专栏

Bitmap 源码阅读笔记

导语: Android 系统上的图片的处理,跟Bitmap 这个类脱不了关系,我们有必要去深入阅读里面的源码,以便在工作中能更好的处理Bitmap相关的问题...

2458
来自专栏linux驱动个人学习

高通msm8909耳机调试

1、DTS相应修改: DTS相关代码:kernel/arch/arm/boot/dts/qcom/msm8909-qrd-skuc.dtsi: 1 s...

7335
来自专栏Hadoop数据仓库

Oracle sqlldr 如何导入一个日期列

1. LOAD DATA INFILE * INTO TABLE test FIELDS TERMINATED BY X'9' TRAILING NULLCO...

1786
来自专栏专知

2018年SCI期刊最新影响因子排行,最高244,人工智能TPAMI9.455

2018年6月26日,最新的SCI影响因子正式发布,涵盖1万2千篇期刊。CA-Cancer J Clin 依然拔得头筹,其影响因子今年再创新高,达244.585...

1272

扫码关注云+社区