- Blog.csdn.net/qq_31709249…
- GlTF is a run-time asset for GL(WebGL, OpenGL ES, and OpenGL) interfaces.
- The glTF asset contains zero or more scenes, and all nodes in the scene.nodes array must be root nodes
- Node hierarchies are defined using the children attribute, such as “childredn”:[1,2,3,4]
- The node defines the spatial transformation through matrix properties, rotation, scale, and translation properties. The ratation property is the unit quaternion (x,y,z,w), as in “rotation”:[0,0,0,1]; Scale and translatiion attributes are unit ternary values, such as “scale”:[1,1,1], “translation”:[-17,-11,2]
- Scene: Indicates the entrance of the scene. Nodes form a tree structure
- Node: A node in the scene hierarchy that contains transformations and can have child nodes. Node deformations are described by pointing to mesh,camera and skin
- Camera: Defines the viewpoint configuration for rendering the scene
- Mesh: describes geometric objects in the scene, which are accessed by accessor. The deformation target is defined by extending the Mesh concept. The deformation target is a variable Mesh, which can be realized by primitives’ targets attribute. Generally, it only supports three attributes, POSITION,NORMAL and TANGENT. Ed
- The mesh is defined by vertex attributes. The number of joints affecting a vertex is limited to four per group, so the accessor must have a VEC4 type.
- Texture :glTF divides texture access into three distinct object types: texture, image, and sampler.
- Material :glTF defines a material using a common set of parameters based on the material representation commonly used in physical rendering (PBR).
- Animation :glTF Node-transformed keyframe animation supports joint animation and skin animation. The keyframe data is stored in the cache and referenced in the animation by accessors.
- Extensions: Any glTF object can have optional Extensions properties.
- “BufferView” represents a subset of the data in the buffer. Objects in the glTF file do not access buffer and bufferView directly, but through Accessor accessors.
- Buffers store binary data, containing big data files such as geometry, mesh, animation and skins, and are retrieved by accessors. ByteLength “specifies the size of the cache file, and the” URI “attribute is the DATA from the URI to the buffer, which can also be stored in a glTF file as base64 encoded data and referenced by the URI
{
"scenes": [{"nodes" : [ 0]}],"nodes": [{"mesh" : 0}]."meshes": [{"primitives": [{"attributes" : {
"POSITION" : 1
},
"indices" : 0}}]]."buffers": [{"uri" : "data:application/octet-stream; base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAAAAACAPwAAAAA="."byteLength" : 44}]."bufferViews": [{"buffer" : 0."byteOffset" : 0."byteLength" : 6."target" : 34963 //34962 stands for ARRAY_BUFFER and 34963 stands for ELEMENT_ARRAY_BUFFER
},
{
"buffer" : 0."byteOffset" : 8."byteLength" : 36."target" : 34962}].// Each accessor corresponds to a BufferView, which defines the data type, data format, and layout of the BufferView
"accessors": [{"bufferView" : 0."byteOffset" : 0."componentType" : 5123.//512 is a FLOAT
"count" : 3."type" : "SCALAR".// The type attribute is used to indicate whether the data element is a scalar (SCALLAR), vector (VEC3), or matrix (MAT4).
"max" : [ 2]."min" : [ 0] {},"bufferView" : 1."byteOffset" : 0."componentType" : 5126."count" : 3."type" : "VEC3"."max" : [ 1.0.1.0.0.0]."min" : [ 0.0.0.0.0.0]}],"asset" : {
"version" : "2.0"}}Copy the code