#Delphi #Firemonkey 3D app for Windows, iOS and Android.
This app features a 3D scene with a rigged sailboat over animated ocean surface.
This GBE3D demo application was added to this fork of GBE3D 3d components, by Gregory Bersegeay.
https://github.com/gbegreg/GBE3D ( visit and give it a star ! )
SailboatDemo was expanded from waterdemo sample. The SailboatDemo rigged boat scene can be used in sailing games and simulations.
Features:
Note: At this time Github Web does not accept files larger than 25MB to be posted. Had to use git command line to update fSailboatDemo.fmx.
SailboatDemo 3d machinery: Every 3d object is parented to a TDummy (see image below). The dummys are used to position objects at run time. The position of actual objects is set at design time, in relation to its dummy. This allows fine adjustment of object positions.
Also helps with objects doing cyclic movements. As an example, dummyDolphin is parented to the OceanSurface, so it floats. The Dolphin model itself is moved up and down (Position.z) with a senoid function to jump out of the ocean.
Not implemented at this time:
In order to compile this demo you have to install GBE3D components:
install the GBE3D design package in this fork as I have added 3 mesh components: TOceanSurface, TSailSurface and TWindArrow. SailboatDemo also uses TGBEHeightmap for the terrain and TGBEClouds.
Status: Tested with Delphi 11.1 on Windows, iOS and Android (jun/22)
Form in fSailboatDemo.pas is rigged to be controlled externally.
These functions allow manipulating the state of the boat for the frame at run time:
procedure SetBoatState(const aCap,aHeel,aSpeed,aBoomAngle,aRudderAngle,aWindDir,aWindSpeed:Single); // sets state of boat
procedure SetSailShape( ixSail:integer; aPtArray:TPointF_Array ); // sets sail surf to a polyline
procedure set3DcharacterState(ix:integer; const x,y,alfa:Single); // ix = which char // sets position/rotation of animated character
procedure set3dMarks(ix:integer; const ax,ay:Single); // sets mark position
Procedure setTerrainBitmap(bVisible:boolean; aBMP:TBitmap); // use a gray shade bitmap to set large scale terrain ( land )
All models used in SailboatDemo are embedded in fSailboatDemo.fmx file. Model and texture files are not needed to build or deploy the app.
But they are available for edition in Blender .blend format (original) and in .glb
See models folder.
https://github.com/omarreis/GBE3D/tree/master/demos/SailboatDemo/models
To import modified 3d models into the scene, I used Blender to export models to collada format ( one that works with TModel3D ) and then imported the TModel3D in the Delphi IDE.
The executable with all graphic assets inside makes it easier to run the app. A single file - SailboatDemo.exe - is needed. No instalation required.
Single file Win32 executable (v2.0):
This demo doesn't save data to files, uses no cookies and collects no user data. Session state is not persistent.
App is not available in the phone stores at this time, but runs ok on iOS and Android. To run on these devices, you must compile from source.
You can also experiment with this code on phones by using OPYC sailing game. OPYC combines this 3D scene with 2D animation using Box2D physics engine, integrating real world NOAA winds and high resolution world maps GSHHG.
OPYC is available on app stores (iOS and Android). Search for "OPYC".
OPYC game requires user registration
https://youtu.be/M9_Z5RxW3Pc SailboatDemo V2 on Youtube (jun22) - new!
https://www.tiktok.com/@omar_reis/video/7107767340376329478 tiktok of SailboatDemo on phone new!
http://www.youtube.com/watch?v=bBpZxB8GLpg SailboatDemo V1 on Youtube