C++C++11C++14C++17ComponentsLanguage FeatureLearn C++

Learn About Working With 3D In Modern Windows C++ Development

In application development 3D Objects can be displayed with 2D projection methods by using 2D / 3D mathematical calculations . That may be hard and needs much coding to display them. You can use OpenGL and DirectX with their own 3D commands to display them. You can also use and port a 3D Engine SDK. Simply, In C++ Builder 3D Objects can be easily displayed in the Viewport3D component. You can change their shape, position, color, materials etc. on design time or on runtime. You can add Texture Materials or Light Materials on them. You can group them by using Dummy objects. You can use all of these without any graphical engine API/SDK/DLL or Lib. You just need to drag one of the 3D objects listed below in to viewport, then you have windows applications which has 3D objects. Note that FireMonkey supports GPU usage on runtime. All basic 3d objects can be be found in 3D Shapes category of Tool Palette.

Creating a 3D Object on Runtime

Simply, you can create these listed basic 3D shapes by dragging them into ViewPort3D component, you can also arrange their position, rotation, size and other properties in your application UI design. You can also create them on run time. Parent object must be given, it can be a ViewPort3D, Dummy object or other 3D Objects. here is a TCube sample given below;

Here are some of them listed below.

TPlane

The TPlane is used in Viewport3D component, it is a class implements a 2D plane that can be placed on a 3D FireMonkey form, it represents a 2D plane that can be employed in a 3D form. Planes support 3D rotation and alignment. TPlane is a visual object that can be added from the Tool Palette.

TDisk

The TDisk is used in Viewport3D component, it is a class implements a 3D flat disk shape that can be placed on a 3D FireMonkey form. TDisk is a visual object that can be added from the Tool Palette. To change the color or add texture to the disk, use the MaterialSource property. Set SubdivisionsAxes and SubdivisionsCap to specify how smooth the disk’s surface is.

TCube

The TCube is used in Viewport3D component, it is a class implements a 3D cube shape, built on a 3D wireframe, that can be placed on a 3D FireMonkey form. TCube is a visual object that can be added from the Tool Palette. To change the color or add texture to the cube, use the MaterialSource property. Set SubdivisionsDepthSubdivisionsHeight and SubdivisionsWidth to specify how smooth the cube’s surfaces are.

TRectangle3D

The TRectangle3D is used in Viewport3D component, it represents a 3D rectangle, it is a class implements an extruded 3D shape under the form of a 3D rectangle that can be placed on a 3D FireMonkey form. TRectangle3D is a visual object that can be added from the Tool Palette.

TSphere

The TSphere is is used in Viewport3D component, it is a 3D sphere, a class implements a 3D sphere shape built on a 3D wireframe, that can be placed on a 3D FireMonkey form. TSphere is a visual object that can be added from the Tool Palette. To change the color or add texture to the sphere, use the MaterialSource property. Set SubdivisionsAxes and SubdivisionsHeight to specify how smooth the sphere’s surfaces are.

TCylinder

The TCylinder is is used in Viewport3D component, it is a 3D cylinder, a class implements a 3D cylinder shape built on a 3D wireframe, that can be placed on a 3D FireMonkey form. TCylinder is a visual object that can be added from the Tool Palette. To change the color or add texture to the sphere, use the MaterialSource property. Set SubdivisionsAxes and SubdivisionsHeight to specify how smooth the sphere’s surfaces are.

TEllipse3D

The TEllipse3D is used in Viewport3D component, it is a 3D ellipse,  an elliptic cylinder, class implements an extruded 3D shape under the form of a 3D ellipse that can be placed on a 3D FireMonkey form. TEllipse3D is a visual object that can be added from the Tool Palette.

TCone

The TCone is used in Viewport3D component, represents a 3D cone, class implements a 3D cone shape, built on a 3D wireframe, that can be placed on a 3D FireMonkey form. TCone is a visual object that can be added from the Tool Palette. To change the color or add texture to the cone, use the MaterialSource property. Set SubdivisionsAxesSubdivisionsCap and SubdivisionsHeight to specify how smooth the cone’s surfaces are.

TText3D

The TText3D is used in Viewport3D component, it represents a 3D rendered text, it is a class implements an extruded 3D shape under the form of a 3D text rendition, that can be placed on a 3D FireMonkey form. TText3D is a visual object that can be added from the Tool Palette.

All 3D objects under this 3D Shapes category can be found here

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Introduction to C++Learn C++

Learn Copy Constructors in C++ Classes

C++C++11C++14C++17Introduction to C++Learn C++Syntax

Learn How To Use Types Of Destructors In C++?

C++C++11C++14Learn C++Syntax

How To Convert u32string To A wstring In C++

C++C++11C++14C++17C++20Introduction to C++Learn C++

How To Learn The Move Constructors In Modern C++?

Worth reading...
Introduction To C++ Windows Development With C++Builder