Macros | Typedefs | Functions
Primitive Object

The Evas_Canvas3D_Primitive structure defines the data for generating meshes for various types of primitive shapes such as cubes, cylinders, spheres, surfaces, terrain, etc. More...

Macros

#define EVAS_CANVAS3D_PRIMITIVE_CLASS   evas_canvas3d_primitive_class_get()
 Evas 3D canvas primitive class.
 

Typedefs

typedef void() Evas_Canvas3D_Surface_Func(Evas_Real *out_x, Evas_Real *out_y, Evas_Real *out_z, Evas_Real a, Evas_Real b)
 The Evas_Canvas3D_Surface_Func type of functions are used to create parametric surfaces as primitives. More...
 

Functions

EOAPI void evas_canvas3d_primitive_form_set (Eo *obj, Evas_Canvas3D_Mesh_Primitive form)
 The form of the given primitive. More...
 
EOAPI Evas_Canvas3D_Mesh_Primitive evas_canvas3d_primitive_form_get (const Eo *obj)
 The form of the given primitive. More...
 
EOAPI void evas_canvas3d_primitive_mode_set (Eo *obj, Evas_Canvas3D_Primitive_Mode mode)
 The mode of the given primitive. More...
 
EOAPI Evas_Canvas3D_Primitive_Mode evas_canvas3d_primitive_mode_get (const Eo *obj)
 The mode of the given primitive. More...
 
EOAPI void evas_canvas3d_primitive_ratio_set (Eo *obj, Evas_Real ratio)
 The ratio of the given primitive. More...
 
EOAPI Evas_Real evas_canvas3d_primitive_ratio_get (const Eo *obj)
 The ratio of the given primitive. More...
 
EOAPI void evas_canvas3d_primitive_precision_set (Eo *obj, int precision)
 The precision of the given primitive. More...
 
EOAPI int evas_canvas3d_primitive_precision_get (const Eo *obj)
 The precision of the given primitive. More...
 
EOAPI void evas_canvas3d_primitive_surface_set (Eo *obj, Evas_Canvas3D_Surface_Func *surface)
 The surface of the given primitive. More...
 
EOAPI void evas_canvas3d_primitive_tex_scale_set (Eo *obj, Evas_Real tex_scale_x, Evas_Real tex_scale_y)
 The texture scale of the given primitive. More...
 
EOAPI void evas_canvas3d_primitive_tex_scale_get (const Eo *obj, Evas_Real *tex_scale_x, Evas_Real *tex_scale_y)
 The texture scale of the given primitive. More...
 

Detailed Description

The Evas_Canvas3D_Primitive structure defines the data for generating meshes for various types of primitive shapes such as cubes, cylinders, spheres, surfaces, terrain, etc.

Use the evas_canvas3d_mesh_from_primitive_set() function to generate a mesh's frame of this primitive.

Typedef Documentation

◆ Evas_Canvas3D_Surface_Func

Evas_Canvas3D_Surface_Func

The Evas_Canvas3D_Surface_Func type of functions are used to create parametric surfaces as primitives.

These compute the vertex x,y,z values for given v,u values.

Parameters
out_xThe x component of the calculated value.
out_yThe y component of the calculated value.
out_zThe z component of the calculated value.
ais the v value.
bis the u value.
See also
Primitive Object
Since
1.15

Function Documentation

◆ evas_canvas3d_primitive_form_set()

EOAPI void evas_canvas3d_primitive_form_set ( Eo obj,
Evas_Canvas3D_Mesh_Primitive  form 
)

The form of the given primitive.

Form defines which function will be chosen to set data to mesh on call of evas_canvas3d_mesh_primitive_set.

Now available next forms of primitives are tabulated primitives (SQUARE and CUBE), solids of revolution (CYLINDER, CONE, SPHERE and TORUS) and surfaces (SURFACE and TERRAIN).

Default form is EVAS_CANVAS3D_MESH_PRIMITIVE_NONE.

Parameters
[in]objThe object.
[in]formForm of primitive.

◆ evas_canvas3d_primitive_form_get()

EOAPI Evas_Canvas3D_Mesh_Primitive evas_canvas3d_primitive_form_get ( const Eo obj)

The form of the given primitive.

Form defines which function will be chosen to set data to mesh on call of evas_canvas3d_mesh_primitive_set.

Now available next forms of primitives are tabulated primitives (SQUARE and CUBE), solids of revolution (CYLINDER, CONE, SPHERE and TORUS) and surfaces (SURFACE and TERRAIN).

Default form is EVAS_CANVAS3D_MESH_PRIMITIVE_NONE.

Parameters
[in]objThe object.
Returns
Form of primitive.

◆ evas_canvas3d_primitive_mode_set()

EOAPI void evas_canvas3d_primitive_mode_set ( Eo obj,
Evas_Canvas3D_Primitive_Mode  mode 
)

The mode of the given primitive.

Mode defines which function will be chosen to set data to mesh on call of evas_canvas3d_mesh_primitive_set. It helps to choose an alternative algorithm for primitives with a given form, such as a cone without a base or sphere textured in alternative way.

Mods of primitives are now available without base (bases) (supported for cylinder and cone) and with alternative UV (supported by sphere).

Default form is EVAS_CANVAS3D_PRIMITIVE_MODE_DEFAULT.

Parameters
[in]objThe object.
[in]modeMode of primitive.

◆ evas_canvas3d_primitive_mode_get()

EOAPI Evas_Canvas3D_Primitive_Mode evas_canvas3d_primitive_mode_get ( const Eo obj)

The mode of the given primitive.

Mode defines which function will be chosen to set data to mesh on call of evas_canvas3d_mesh_primitive_set. It helps to choose an alternative algorithm for primitives with a given form, such as a cone without a base or sphere textured in alternative way.

Mods of primitives are now available without base (bases) (supported for cylinder and cone) and with alternative UV (supported by sphere).

Default form is EVAS_CANVAS3D_PRIMITIVE_MODE_DEFAULT.

Parameters
[in]objThe object.
Returns
Mode of primitive.

◆ evas_canvas3d_primitive_ratio_set()

EOAPI void evas_canvas3d_primitive_ratio_set ( Eo obj,
Evas_Real  ratio 
)

The ratio of the given primitive.

Ratio is used only in torus as the ratio of the major radius and minor radius. For this usage Available values is from 1.0 to infinity. If ratio for torus has a bad value, 3.0 will be used as the ratio.

Default ratio is 3.0.

Parameters
[in]objThe object.
[in]ratioRatio of primitive.

◆ evas_canvas3d_primitive_ratio_get()

EOAPI Evas_Real evas_canvas3d_primitive_ratio_get ( const Eo obj)

The ratio of the given primitive.

Ratio is used only in torus as the ratio of the major radius and minor radius. For this usage Available values is from 1.0 to infinity. If ratio for torus has a bad value, 3.0 will be used as the ratio.

Default ratio is 3.0.

Parameters
[in]objThe object.
Returns
Ratio of primitive.

◆ evas_canvas3d_primitive_precision_set()

EOAPI void evas_canvas3d_primitive_precision_set ( Eo obj,
int  precision 
)

The precision of the given primitive.

Precision is used in all non tabulated primitives and defines the precision of created primitives. Available values range from 3 to infinity. If the value is more than 100, you may see a warning about possibility of incorrect values or slow processing.

Default ratio is 10.

Parameters
[in]objThe object.
[in]precisionPrecision of primitive.

◆ evas_canvas3d_primitive_precision_get()

EOAPI int evas_canvas3d_primitive_precision_get ( const Eo obj)

The precision of the given primitive.

Precision is used in all non tabulated primitives and defines the precision of created primitives. Available values range from 3 to infinity. If the value is more than 100, you may see a warning about possibility of incorrect values or slow processing.

Default ratio is 10.

Parameters
[in]objThe object.
Returns
Precision of primitive.

◆ evas_canvas3d_primitive_surface_set()

EOAPI void evas_canvas3d_primitive_surface_set ( Eo obj,
Evas_Canvas3D_Surface_Func surface 
)

The surface of the given primitive.

Surface is used only in surface primitives and defines the equation of filling mesh data on call of evas_canvas3d_mesh_primitive_set.

This allows you to create customers primitives like shell, heart, hyperbolic paraboloid etc. See _shell_func in examples/evas/evas-3d-visual-test.c or _perlin_terrain in modules/evas/primitives/surfaces/terrain.c for usage examples.

Default surface is null

Parameters
[in]objThe object.
[in]surfacePointer to customers surface function.

◆ evas_canvas3d_primitive_tex_scale_set()

EOAPI void evas_canvas3d_primitive_tex_scale_set ( Eo obj,
Evas_Real  tex_scale_x,
Evas_Real  tex_scale_y 
)

The texture scale of the given primitive.

Texture scale uses in all non tabulated primitives and defines scale of texture coordinates or primitives.

It uses to create periodical textured meshes.

Default tex_scale is {1.0, 1.0}

Parameters
[in]objThe object.
[in]tex_scale_xTexture scale X coordinate
[in]tex_scale_yTexture scale Y coordinate

◆ evas_canvas3d_primitive_tex_scale_get()

EOAPI void evas_canvas3d_primitive_tex_scale_get ( const Eo obj,
Evas_Real tex_scale_x,
Evas_Real tex_scale_y 
)

The texture scale of the given primitive.

Texture scale uses in all non tabulated primitives and defines scale of texture coordinates or primitives.

It uses to create periodical textured meshes.

Default tex_scale is {1.0, 1.0}

Parameters
[in]objThe object.
[out]tex_scale_xTexture scale X coordinate
[out]tex_scale_yTexture scale Y coordinate