User:AlexandraSM Creating the User Interface (FireMonkey 3D Tutorial)
Go Up to Tutorial: Creating a FireMonkey 3D Application
Creating a FireMonkey 3D Application
- Select File > New > FireMonkey Desktop Application - Delphi > In FireMonkey Desktop Application wizard choose 3D FireMonkey Application and press the OK button.
- The FireMonkey Form Designer appears, displaying a FMX.Forms.TForm3D.
Adding and Adjusting Components
- From the Tool Palette, add the following FireMonkey 3D components (by entering the component name in the Search field and pressing Return):
- In the FireMonkey Form Designer, adjust the position and size of the FireMonkey 3D components to suit your needs:
- To move an object, simply drag and drop.
- To rotate a 3D component, use the three blue handles that appear when you click the component. Each handle rotates the component in the associated plane in space (that is, the x, y, or z vertex). When you click a handle, it becomes red to indicate that it is the active handle. Note: You can also use the RotationAngle properties in the Object Inspector (x, y, and z)
- To resize a component, use the resizer control, which is a small blue cube located on one corner of the component. The resizer works in one dimension at a time; the resizer is red on the side of the cube that is the selected (active) dimension. Note: You can also use the properties in the Object Inspector (for TCube, the size-related properties are Depth, Width, and Height).
- To change the material of the two cubs to the followings:
- Add a TTextureMaterialSource to the form.
- In Object Inspector, with the TTextureMaterialSource adjust Texture property by clicking ellipsis […] >Edit. The Bitmap Editor wizard opens. Click the Load button of the Bitmap Editor to load the wanted texture. After loading the texture, click OK button of the Bitmap Editor
- In Object Inspector with the first cub in focus, adjust the MaterialSource property by clicking ellipsis […] > and choose the the added TTextureMaterialSource from the list.
- TTextureMaterialSource adds only texture to the cub.
- Add a TLightMaterialSource to the form
- To specify the color and texture of the material, use the TLightMaterialSource propertiis.
- In Object Inspector, with the TLightMaterialSource adjust:
- Texture property by clicking ellipsis […] >Edit. The Bitmap Editor wizard opens. Click the Load button of the Bitmap Editor to load the wanted texture. After loading the texture, click OK button of the Bitmap Editor
- Ambient, Diffuse, Emissive and Specular by defaut are set like in the folowwing image.
- In Object Inspector, with the TLightMaterialSource adjust:
- To specify the color and texture of the material, use the TLightMaterialSource propertiis.
- Add a TTextureMaterialSource to the form.
- This is the result at designs time
- At this point, you can click F9 to compile, build, and run your first FireMonkey 3D application.