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
0.8.3:deftypes [2022/04/08 08:51] – [Structure] admin0.8.3:deftypes [2022/04/08 08:59] (current) – [Changelog] admin
Line 105: Line 105:
   -TJointRefDef   -TJointRefDef
   [...]   [...]
-                                       -/List+  -/List::Skeletons
   -/TSkinDef   -/TSkinDef
   -/Skin::TSkinDef   -/Skin::TSkinDef
Line 200: Line 200:
 ===== TModelDef ===== ===== TModelDef =====
  
-The TModelDef structure is representing a scene consisting of meshes, materials, lights and animations.+The TModelDef structure is representing a scene consisting of meshes, materials, lights, cameras and animations.
 It does not contain mesh information itself. Instead sub meshes are attached which hold those kind of information. It does not contain mesh information itself. Instead sub meshes are attached which hold those kind of information.
  
Line 388: Line 388:
 // Self = TModelDef // Self = TModelDef
 LLightDef := TLightDef.Create(Self); LLightDef := TLightDef.Create(Self);
 +LLightDef.LightType := TLightType.Spot;
 +LLightDef.Direction := Point3D(0, 1, 0);
 LLightDef.Diffuse := TAlphaColorF.Create(1, 0, 0, 1); LLightDef.Diffuse := TAlphaColorF.Create(1, 0, 0, 1);
 LLightDef.Ambient := TAlphaColorF.Create(0.5, 0.5, 0.5, 1); LLightDef.Ambient := TAlphaColorF.Create(0.5, 0.5, 0.5, 1);
 +LLightDef.Specular := TAlphaColorF.Create(0.15, 0.15, 0.15, 1);
 +LLightDef.Intensity := 1;
 +// attenuation values are configurable but have no effect on rendering yet, due to FMX limitations
 +LLightDef.ConstantAttenuation := 1.0;
 +LLightDef.LinearAttenuation := 0;
 +LLightDef.QuadraticAttenuation := 0;
 +LLightDef.SpotCutOff := 180;
 +LLightDef.SpotExponent := 0;
 LLightDef.Transform := TMatrix3D.CreateTranslation(TPoint3D.Create(0, -50, -50)); LLightDef.Transform := TMatrix3D.CreateTranslation(TPoint3D.Create(0, -50, -50));
 </file> </file>
  
 +==== Cameras ====
 +
 +Gorilla3D is also able to manage logical instances for cameras. It is very common for 3D file formats to export camera information.
 +
 +<file pascal>
 +// Self = TModelDef
 +LCamDef := TCameraDef.Create(Self);
 +LCamDef._Type := TCameraType.PerspectiveCamera; // TCameraType.OrthographicCamera
 +LCamDef.Target := 'Mesh1';
 +LCamDef.FOV := 45;
 +LCamDef.AspectRatio := 16 / 9;
 +// near and far plane are configurable, but have no effect on rendering
 +// due to hardcoded constant values in FMX framework
 +LCamDef.NearPlane := 1;
 +LCamDef.FarPlane := 1000;
 +LCamDef.Transform := TMatrix3D.CreateTranslation(TPoint3D.Create(0, -5, -10));
 +</file>
 ==== Shaders ==== ==== Shaders ====
  
Line 523: Line 550:
 === AnimationStage === === AnimationStage ===
  
-An animation stage is directly referred to a specific objec (mesh or joint) inside the parent model structure. It is the container which holds all modifiers / interpolators.+An animation stage is directly referred to a specific object (mesh or joint) inside the parent model structure. It is the container which holds all modifiers / interpolators.
  
 <file pascal> <file pascal>
Line 677: Line 704:
  
 ===== TODO ===== ===== TODO =====
-  * Import/Export of camera definitions 
   * TSamplerDef integration   * TSamplerDef integration
   * TImageDef integration   * TImageDef integration
Line 695: Line 721:
     * late resolving of humanoid controllers, because controllers were not registered before creating humanoids (circular reference)     * late resolving of humanoid controllers, because controllers were not registered before creating humanoids (circular reference)
     * on loading g3d files, the loader now adds the path of the g3d to texture paths, if they are relative     * on loading g3d files, the loader now adds the path of the g3d to texture paths, if they are relative
 +    * multiple skeletons per skindef allowed
  
 Next step: [[transparency|Transparency]] Next step: [[transparency|Transparency]]