Skip to content

CCanvas3D

CCanvas3D

CCanvas3D is a class for simplified creation and visualization of 3D objects on a chart.

Description

CCanvas3D greatly simplifies creation and visualization of large amounts of data in the form of animated 3D graphics. The class contains the methods for managing camera and lighting, as well as features the resource manager for creating graphic resources: textures, shaders, vertex buffers, indexes, and shader parameters.

Besides, the library contains the classes of the scene base objects, such as a box, a three-dimensional surface on user data, or an arbitrary grid.

A video card should support DX 11 and Shader Model 5.0 for the functions to work.

Declaration

class CCanvas

Title

#include <Canvas\Canvas.mqh>

Inheritance hierarchy

CCanvas

CCanvas3D

Class methods by groups

Creating/deletingDescription
CreateCreates a graphic resource for rendering a 3D scene without binding to a chart object.
AttachGets a graphical resource from the OBJ_BITMAP_LABEL object and attaches it to an instance of the CCanvas class.
ObjectAddAdds an object to a 3D scene for subsequent rendering.
DestroyDestroys a graphic resource and releases a graphic 3D context.
Light
AmbientColorSetSets the color and intensity of the ambient all-round lighting.
AmbientColorGetGets the color and intensity of the ambient all-round lighting.
LightDirectionSetSets the direction of a directed light source.
LightDirectionGetGets the direction of a directed light source.
LightColorSetSets the color and intensity of a directed light source.
LightColorGetGets the color and intensity of a directed light source.
Camera
ProjectionMatrixSetCalculates and sets a 3D coordinate projection matrix to a 2D frame.
ProjectionMatrixGetGets a 3D scene projection matrix to a 2D frame.
ViewMatrixSetSets a 3D scene view matrix.
ViewMatrixGetReturns a 3D scene view matrix.
ViewPositionSetSets a viewpoint on a 3D scene.
ViewRotationSetSets the direction of a gaze at a 3D scene.
ViewTargetSetSets the coordinates of the point a gaze is directed at.
ViewUpDirectionSetSets the direction of the upper frame border in 3D space.
Rendering
RenderRenders all scene objects in the frame inner buffer for subsequent display.
RenderBeginPrepares a graphic context for rendering a new frame.
RenderEndCopies a rendered frame to the inner buffer and updates a chart image if necessary.
Getting resources
DXContextGets the graphic context handle.
DXDispatcherGets the resource dispatcher handle.
InputSceneGets the pointer to the buffer of scene parameters.
Last updated on