Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
deftypes [2019/03/12 14:57] – [Notice] admin | deftypes [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Internal Model Definition ====== | ||
- | Gorilla3D holds model, animation and material data inside of an internal structure for better instancing, abstraction and management. | ||
- | |||
- | The so-called DefTypes can be stored and loaded to/from *.G3D file format. | ||
- | |||
- | ===== Structure ===== | ||
- | |||
- | Take a look at the following schematic structure of a model definition. | ||
- | |||
- | < | ||
- | -TModelDef | ||
- | // holds a list of TMeshDef instances | ||
- | | ||
- | | ||
- | // a reference to the owner model | ||
- | | ||
- | | ||
- | | ||
- | |||
- | // holds a list of TMaterialDef instances | ||
- | -List:: | ||
- | | ||
- | // a reference to the owner model | ||
- | | ||
- | |||
- | // holds a list of textures | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | // holds a list of shader codes | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | // holds a list of sub materials for layered material sources | ||
- | | ||
- | | ||
- | [...] | ||
- | | ||
- | | ||
- | | ||
- | -/ | ||
- | |||
- | // holds a list of THumanoidDef instances | ||
- | | ||
- | | ||
- | // a reference to the owner model | ||
- | | ||
- | // holds a list of TControllerDef references | ||
- | | ||
- | |||
- | // represents a tree of TJointDef nodes | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | // holds a list of TControllerDef instances | ||
- | | ||
- | | ||
- | // a reference to the mesh, the controller handles | ||
- | | ||
- | |||
- | // is a sub component of TSkinDef | ||
- | | ||
- | | ||
- | // the owner controller of the skin definition | ||
- | | ||
- | |||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | // holds a list of TAnimationDef instances | ||
- | | ||
- | | ||
- | // reference to the owner model | ||
- | | ||
- | |||
- | // holds a list of TAnimationStageDef instances | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | </ | ||
- | |||
- | ===== G3D File Format ===== | ||
- | |||
- | The Gorilla3D file format is a representation of the internal model structure defintion. | ||
- | It allows different kinds of storage formats: | ||
- | |||
- | ^ Format | ||
- | | BSON | binary json format: https:// | ||
- | | JSON | default json format: https:// | ||
- | |||
- | In addition to those formats we provide different storage options: | ||
- | |||
- | ^ Option ^ Notes ^ | ||
- | | None | The save routine simply stores data plain as BSON or JSON | | ||
- | | Zipped | ||
- | | Beautified | Compatible with JSON format. Defines data will be exported with linebreaks and indents or not. This option has no influence on bson format. | | ||
- | | FastestCompression | If the Zipped-Option is set, this option will choose the fastest algorithm for packing the data stream. | | ||
- | | MaxCompression | If the Zipped-Option is set, this option will chose the maximum compression algorithm for packing the data stream. | | ||
- | |||
- | Depending on your model data you can configure those options to optimize filesize. | ||
- | In most cases a zipped JSON format with MaxCompression provides the best results. | ||
- | |||
- | < | ||
- | G3D_TEST : TGorillaG3DOptions = [TGorillaG3DOption.Zipped, | ||
- | </ | ||
- | |||
- | ===== Notice ===== | ||
- | |||
- | Every G3D file starts with some header information, | ||
- | The header format is described below: | ||
- | |||
- | <file pascal> | ||
- | TGorillaG3DFormat = (BSONFormat, | ||
- | | ||
- | TGorillaG3DOption | ||
- | None, | ||
- | Zipped, | ||
- | Beautified, | ||
- | FastestCompression, | ||
- | MaxCompression); | ||
- | |||
- | TGorillaG3DOptions = Set Of TGorillaG3DOption; | ||
- | |||
- | TGorillaG3DHeader = record | ||
- | /// DEFAULT-VALUE = " | ||
- | /// 10 characters identify the exporter tool | ||
- | Exporter : Array[0..9] of Byte; | ||
- | Version : Cardinal; | ||
- | /// Datetime when the file was generated. (8 byte float value) | ||
- | Timestamp : TDateTime; | ||
- | /// The data format the was stored (bson or json). | ||
- | Format | ||
- | /// enum with values above | ||
- | Options : TGorillaG3DOptions; | ||
- | end; | ||
- | </ |