Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gbegreg committed Nov 19, 2019
1 parent 83b0b17 commit d1a850f
Show file tree
Hide file tree
Showing 11 changed files with 662,538 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
66 changes: 66 additions & 0 deletions .gitignore
@@ -0,0 +1,66 @@
# Uncomment these types if you want even more clean repository. But be careful.
# It can make harm to an existing project source. Read explanations below.
#
# Resource files are binaries containing manifest, project icon and version info.
# They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
#*.res
#
# Type library file (binary). In old Delphi versions it should be stored.
# Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
#*.tlb
#
# Diagram Portfolio file. Used by the diagram editor up to Delphi 7.
# Uncomment this if you are not using diagrams or use newer Delphi version.
#*.ddp
#
# Visual LiveBindings file. Added in Delphi XE2.
# Uncomment this if you are not using LiveBindings Designer.
#*.vlb
#
# Deployment Manager configuration file for your project. Added in Delphi XE2.
# Uncomment this if it is not mobile development and you do not use remote debug feature.
#*.deployproj
#
# C++ object files produced when C/C++ Output file generation is configured.
# Uncomment this if you are not using external objects (zlib library for example).
#*.obj
#

# Delphi compiler-generated binaries (safe to delete)
*.exe
*.dll
*.bpl
*.bpi
*.dcp
*.so
*.apk
*.drc
*.map
*.dres
*.rsm
*.tds
*.dcu
*.lib
*.a
*.o
*.ocx

# Delphi autogenerated files (duplicated info)
*.cfg
*.hpp
*Resource.rc

# Delphi local files (user-specific info)
*.local
*.identcache
*.projdata
*.tvsconfig
*.dsk

# Delphi history and backups
__history/
__recovery/
*.~*

# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
*.stat
23 changes: 23 additions & 0 deletions FMXRace.dpr
@@ -0,0 +1,23 @@
program FMXRace;





{$R *.dres}

uses
System.StartUpCopy,
FMX.Forms,
principale in 'principale.pas' {fPrincipale},
GBECubemap in 'GBECubemap.pas',
uGBEUtils3D in 'uGBEUtils3D.pas';

{$R *.res}

begin
Application.Initialize;
Application.FormFactor.Orientations := [TFormOrientation.Landscape];
Application.CreateForm(TfPrincipale, fPrincipale);
Application.Run;
end.
1,445 changes: 1,445 additions & 0 deletions FMXRace.dproj

Large diffs are not rendered by default.

Binary file added FMXRace.res
Binary file not shown.
63 changes: 63 additions & 0 deletions GBECubemap.pas
@@ -0,0 +1,63 @@
unit GBECubemap;

interface

uses
System.SysUtils, System.Classes, FMX.Types, FMX.Controls3D, FMX.Objects3D, FMX.Graphics, System.UITypes, FMX.Materials,FMX.types3D, System.Types,
System.Math.Vectors, FMX.Materialsources;

type
TGBECubemap = class(TMesh)
private
protected
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure generateCubemap;
published
property Locked default False;
property HitTest default False;
property Visible default True;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents('GBE3D', [TGBECubemap]);
end;

{ TGBECubemap }

constructor TGBECubemap.Create(AOwner: TComponent);
begin
inherited;
TwoSide := true;
generateCubemap;
end;

procedure TGBECubeMap.generateCubemap;
begin
self.Data.Clear;

// 18 points pour pouvoir appliquer la texture correctement (8 points sufisent pour le cube, mais on ne peut ensuite associer
// qu'un point de la texture à un sommet, alors on duplique les sommets nécessaires pour pouvoir appliquer la texture correctement sur les 6 faces).
self.Data.Points :=
'-1 -1 1, 1 -1 1, -1 1 1, 1 1 1, 1 -1 -1, 1 1 -1, -1 -1 -1, -1 1 -1, -1 -1 1, -1 1 1,'+ // faces Gauche, Face, Droit, Derrière
'-1 -1 1, 1 -1 1, 1 -1 -1, -1 -1 -1, -1 1 -1, -1 1 1, 1 1 -1, 1 1 1'; // faces Haut et Bas
// Positionnement de la texture à chaque points
self.Data.TexCoordinates :=
'0.0 0.34, 0.25 0.34, 0.0 0.66, 0.25 0.66, 0.5 0.34, 0.5 0.66, 0.75 0.34, 0.75 0.66, 1 0.34, 1 0.66,'+
' 0.25 0.0, 0.25 0.34, 0.5 0.34, 0.5 0.0, 0.5 1, 0.25 1, 0.5 0.66, 0.25 0.66';
// Création et indexation des triangles en fonction du besoin
self.Data.TriangleIndices := '0 1 2 ,2 1 3 ,1 4 3, 3 4 5, 4 6 5, 5 6 7, 6 8 7, 7 8 9, 10 11 12, 12 10 13, 14 15 16, 16 15 17';
end;

destructor TGBECubemap.Destroy;
begin
inherited;
end;

end.
Binary file added circuit1-128.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added heightmap-montagne2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
659,809 changes: 659,809 additions & 0 deletions principale.fmx

Large diffs are not rendered by default.

0 comments on commit d1a850f

Please sign in to comment.