Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
deftypes [2019/03/12 14:54] – [G3D File Format] admindeftypes [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. 
- 
-<file> 
--TModelDef 
-        // holds a list of TMeshDef instances 
-  -List::Meshes 
-  -TMeshDef 
-                        // a reference to the owner model 
-  -@Model::TModelDef 
-  -/TMeshDef 
-  -/List::Meshes 
- 
-        // holds a list of TMaterialDef instances 
-        -List::Materials 
-  -TMaterialDef 
-                        // a reference to the owner model 
-  -@Model::TModelDef 
- 
-                        // holds a list of textures 
-  -List::Textures 
-  -TTextureDef 
-  -/TTextureDef 
-  -/List::Textures 
- 
-                        // holds a list of shader codes 
-  -List::Shaders 
-  -TShaderDef 
-  -/TShaderDef 
-  -/List::Shaders 
- 
-                        // holds a list of sub materials for layered material sources 
-  -List::Materials 
-  -TMaterialDef 
-                                 [...] 
-  -/TMaterialDef 
-  -/List::Materials 
-  -/TMaterialDef 
-        -/List::Materials 
- 
-  // holds a list of THumanoidDef instances 
-  -List::Humanoids 
-  -THumanoidDef 
-                        // a reference to the owner model 
-  -@Model::TModelDef 
-  // holds a list of TControllerDef references 
-  -@List::Controllers 
- 
-  // represents a tree of TJointDef nodes 
-  -Root::TJointDef 
-  -TJointDef 
-  -TJointDef 
-  -TJointDef 
-  -TJointDef 
-  -/TJointDef 
-  -/TJointDef 
-  -/Root::TJointDef 
-  -/THumanoidDef 
-  -THumanoidDef 
-  [...] 
-  -/THumanoidDef 
-  -/List::Humanoids 
- 
-  // holds a list of TControllerDef instances 
-  -List::Controllers 
-  -TControllerDef 
-                        // a reference to the mesh, the controller handles 
-  -@Mesh::TMeshDef 
- 
-  // is a sub component of TSkinDef 
-  -Skin::TSkinDef 
-  -TSkinDef 
-                                        // the owner controller of the skin definition 
-  -@Controller::TControllerDef 
- 
-  // holds a list of TJointRefDef instances - these 
-  // are referenced objects to TJointDef instances 
-  -List::LinkedJoint 
-  -TJointRefDef 
-  -TJointRefDef 
-  -TJointRefDef 
-  -TJointRefDef 
-  -TJointRefDef 
-  [...] 
-  -/List::LinkedJoints 
- 
-  // contains the root joint of the skeleton 
-  -@Skeleton::TJointRefDef 
-  -/TSkinDef 
-  -/Skin::TSkinDef 
-  -/TControllerDef 
-  -TControllerDef 
-  [...] 
-  -/TControllerDef 
-  -/List::Controllers 
- 
-  // holds a list of TAnimationDef instances 
-  -List::Animations 
-  -TAnimationDef 
-                        // reference to the owner model 
-  -@Model::TModelDef 
- 
-  // holds a list of TAnimationStageDef instances 
-  -List::Stages 
-  -TAnimationStageDef 
-  -List::Interpolators 
-  -TInterpolatorDef 
-  -TInterpolatorDef 
-  -TInterpolatorDef 
-  [...] 
-  -/List::Interpolators 
-  -/TAnimationStageDef 
-  -TAnimationStageDef 
-  [...] 
-  -/TAnimationStageDef 
-  -/List::Stages 
-  -/TAnimationDef 
-  -TAnimationDef 
-  [...] 
-  -/TAnimationDef 
-  -/List::Animations 
- -/TModelDef 
-</file> 
- 
-===== G3D File Format ===== 
- 
-The Gorilla3D file format is a representation of the internal model structure defintion. 
-It allows different kinds of storage formats: 
- 
-^ Format  ^ Notes  ^ 
-| BSON      | binary json format: https://en.wikipedia.org/wiki/BSON [wikipedia] | 
-| JSON       | default json format: https://en.wikipedia.org/wiki/JSON [wikipedia] | 
- 
-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  | Store as zipped data stream. You can extend this option by the FastestCompression or MaxCompression option. If none of them is set, the exporter will use default compression. | 
-| 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. 
- 
-<code> 
-G3D_TEST : TGorillaG3DOptions = [TGorillaG3DOption.Zipped, TGorillaG3DOption.MaxCompression]; 
-</code> 
- 
-===== Notice ===== 
- 
-<file pascal> 
-  TGorillaG3DOption  = ( 
-    None, 
-    Zipped, 
-    Beautified, 
-    FastestCompression, 
-    MaxCompression); 
- 
-  TGorillaG3DOptions = Set Of TGorillaG3DOption; 
- 
-  /// <summary> 
-  /// The G3D header information which defines the exported format (bson or json) 
-  /// and options like zipped, beautified, ... 
-  /// Also the G3D format version is given for future adjustments. 
-  /// </summary> 
-  TGorillaG3DHeader = record 
-    /// <summary> 
-    ///   10 characters identify the exporter tool 
-    /// </summary> 
-    Exporter : Array[0..9] of Byte; 
-    /// <summary> 
-    ///   Version the file was generated. 
-    /// </summary> 
-    Version : Cardinal; 
-    /// <summary> 
-    ///   Datetime when the file was generated. (8 byte float value) 
-    /// </summary> 
-    Timestamp : TDateTime; 
-    /// <summary> 
-    ///   The data format the was stored (bson or json). 
-    /// </summary> 
-    Format  : TGorillaG3DFormat; 
-    /// <summary> 
-    ///   Number of options used for generating the data format 
-    ///   (zipped, beautified, fast-compression, ...) 
-    /// </summary> 
-    Options : TGorillaG3DOptions; 
- 
-    constructor Create(AZipped : Boolean; AFormat : TGorillaG3DFormat); 
-  end; 
-</file>