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.4:primitives [2022/06/16 15:22] – [TGorillaCapsule] admin0.8.4:primitives [2022/07/22 12:55] (current) – [TGorillaModel] admin
Line 91: Line 91:
   FCylinder:= TGorillaCylinder.Create(GorillaViewport1);   FCylinder:= TGorillaCylinder.Create(GorillaViewport1);
   FCylinder.Parent := GorillaViewport1;     FCylinder.Parent := GorillaViewport1;  
-   +
-  /// create a cylinder with more detail+
 {$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
   /// create a very detailled cylinder.   /// create a very detailled cylinder.
Line 126: Line 125:
   FCapsule.Parent := GorillaViewport1;     FCapsule.Parent := GorillaViewport1;  
      
-  /// create a cylinder with more detail+  FCapsule.Radius := 0.35; 
 {$IFDEF MSWINDOWS} {$IFDEF MSWINDOWS}
   /// create a very detailled capsule.   /// create a very detailled capsule.
-  FCapsule.Radius := 0.35; 
   FCapsule.Segments := 128;   FCapsule.Segments := 128;
   FCapsule.Rings := 64;   FCapsule.Rings := 64;
 {$ELSE} {$ELSE}
   /// on Android platform number of vertices is limited to 32K.   /// on Android platform number of vertices is limited to 32K.
-  FCapsule.Radius := 0.25; 
   FCapsule.Segments := 32;   FCapsule.Segments := 32;
   FCapsule.Rings := 8;   FCapsule.Rings := 8;
Line 149: Line 147:
  
 {{:0.8.4:p_plane.jpg?nolink&600|}} {{:0.8.4:p_plane.jpg?nolink&600|}}
 +
 +<file pascal>
 +uses
 +  Gorilla.Plane;
 +  
 +[...]
 +
 +begin
 +  FPlane:= TGorillaPlane.Create(GorillaViewport1);
 +  FPlane.Parent := GorillaViewport1;  
 +  
 +  /// placing it as floor
 +  FPlane.RotationAngle.X := -90;
 +  
 +{$IFDEF MSWINDOWS}
 +  /// create a very detailled plane.
 +  FPlane.SubdivisionsHeight := 128;
 +  FPlane.SubdivisionsWidth := 128;
 +{$ELSE}
 +  /// on Android platform number of vertices is limited to 32K.
 +  FPlane.SubdivisionsHeight := 16;
 +  FPlane.SubdivisionsWidth := 16;
 +{$ENDIF}
 +  
 +  /// make it larger
 +  FPlane.SetSize(10, 5, 0.1);
 +  
 +  /// to forbid mouse interaction
 +  FPlane.SetHitTestValue(false);
 +end;
 +</file>
 ==== TGorillaCone ==== ==== TGorillaCone ====
  
 {{:0.8.4:p_cone.jpg?nolink&600|}} {{:0.8.4:p_cone.jpg?nolink&600|}}
 +
 +<file pascal>
 +uses
 +  Gorilla.Cone;
 +  
 +[...]
 +
 +begin
 +  FCone := TGorillaCone.Create(GorillaViewport1);
 +  FCone.Parent := GorillaViewport1;  
 +  
 +  FCone.TopRadius := 0.01;
 +  FCone.BottomRadius := 2;
 +  
 +{$IFDEF MSWINDOWS}
 +  /// create a very detailled cone.
 +  FCone.Sides := 128;
 +  FCone.HeightSegments := 128;
 +{$ELSE}
 +  /// on Android platform number of vertices is limited to 32K.
 +  FCone.Sides := 32;
 +  FCone.HeightSegments := 1;
 +{$ENDIF}
 +  
 +  /// make it larger
 +  FCone.SetSize(2, 2, 2);
 +  
 +  /// to forbid mouse interaction
 +  FCone.SetHitTestValue(false);
 +end;
 +</file>
 ==== TGorillaTube ==== ==== TGorillaTube ====
  
 {{:0.8.4:p_tube.jpg?nolink&600|}} {{:0.8.4:p_tube.jpg?nolink&600|}}
 +
 +<file pascal>
 +uses
 +  Gorilla.Tube;
 +  
 +[...]
 +
 +begin
 +  FTube := TGorillaTube.Create(GorillaViewport1);
 +  FTube.Parent := GorillaViewport1;  
 +  
 +  FTube.TopRadius1 := 0.25;
 +  FTube.TopRadius2 := 0.15;
 +  FTube.BottomRadius1 := 0.5;
 +  FTube.BottomRadius2 := 0.15;
 +  
 +{$IFDEF MSWINDOWS}
 +  /// create a very detailled tube.
 +  FTube.Sides := 128;
 +{$ELSE}
 +  /// on Android platform number of vertices is limited to 32K.
 +  FTube.Sides := 24;
 +{$ENDIF}
 +  
 +  /// make it larger
 +  FTube.SetSize(2, 2, 2);
 +  
 +  /// to forbid mouse interaction
 +  FTube.SetHitTestValue(false);
 +end;
 +</file>
 ==== TGorillaTorus ==== ==== TGorillaTorus ====
  
 {{:0.8.4:p_torus.jpg?nolink&600|}} {{:0.8.4:p_torus.jpg?nolink&600|}}
 +
 +<file pascal>
 +uses
 +  Gorilla.Torus;
 +  
 +[...]
 +
 +begin
 +  FTorus := TGorillaTorus.Create(GorillaViewport1);
 +  FTorus.Parent := GorillaViewport1;  
 +  
 +  FTorus.Radius1 := 1;
 +  FTorus.Radius2 := 0.3;
 +  
 +{$IFDEF MSWINDOWS}
 +  /// create a very detailled torus.
 +  FTorus.RadSegments := 128;
 +  FTorus.Sides := 128;
 +{$ELSE}
 +  /// on Android platform number of vertices is limited to 32K.
 +  FTorus.RadSegments := 24;
 +  FTorus.Sides := 18;
 +{$ENDIF}
 +  
 +  /// make it larger
 +  FTorus.SetSize(2, 2, 2);
 +  
 +  /// to forbid mouse interaction
 +  FTorus.SetHitTestValue(false);
 +end;
 +</file>
 +
 +==== TGorillaGrid ====
 +
 +{{:0.8.4:p_grid.jpg?nolink&600|}}
 +
 +<file pascal>
 +uses
 +  Gorilla.Grid;
 +  
 +[...]
 +
 +begin
 +  FGrid := TGorillaGrid.Create(GorillaViewport1);
 +  FGrid.Parent := GorillaViewport1;  
 +  
 +  /// make it larger
 +  FGrid.SetSize(10, 10, 10);
 +  
 +  /// pre configure grid, othwise nothing will be rendered
 +  FGrid.DefaultLines := 16;
 +  FGrid.Frequency := 0.25;
 +  FGrid.Marks := 0.5;
 +  FGrid.LineColor := TAlphaColorRec.Cornflowerblue;
 +end;
 +</file>
 +
 +
  
 ==== TGorillaGrid3D ==== ==== TGorillaGrid3D ====
 +
 +The Grid3D component is a container holding 3 instances of TGorillaGrid for each 3D axis: GridX, GridY and GridZ.
  
 {{:0.8.4:p_grid3d.jpg?nolink&600|}} {{:0.8.4:p_grid3d.jpg?nolink&600|}}
 +
 +<file pascal>
 +uses
 +  Gorilla.Grid;
 +  
 +[...]
 +
 +begin
 +  FGrid3D := TGorillaGrid3D.Create(GorillaViewport1);
 +  FGrid3D.Parent := GorillaViewport1;  
 +  
 +  /// make it larger
 +  FGrid3D.SetSize(10, 10, 10);
 +  
 +  /// to modify each grid inside of the container use GridX, GridY or GridZ property
 +  FGrid3D.GridX.DefaultLines := 16;
 +  FGrid3D.GridX.Frequency := 1.5;
 +  FGrid3D.GridX.Marks := 2.5;
 +  FGrid3D.GridX.LineColor := TAlphaColorRec.Cornflowerblue;
 +end;
 +</file>
 +
 ==== TGorillaModel ==== ==== TGorillaModel ====
  
Line 168: Line 341:
 For detailled reading on loading models, please have a closer look [[models|here]]. For detailled reading on loading models, please have a closer look [[models|here]].
  
-Next step:: [[terrain|Terrain]]+Next step: [[cameras|Cameras]]