Site icon Learn 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;

[crayon-676320b471c97466085490/]

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.

[crayon-676320b471ca0327328216/]

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.

[crayon-676320b471ca2404557295/]

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.

[crayon-676320b471ca4038346876/]

TRectangle3D

[crayon-676320b471ca7085473097/]

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.

[crayon-676320b471ca8682977003/]

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.

[crayon-676320b471cb2494343175/]

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.

[crayon-676320b471cb3197826865/]

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

Exit mobile version