Primitive Object

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files
- Examples

Typedefs | Functions
Primitive Object
Evas » Evas 3D Extensions

A primitive object is an object with necessary data for creating meshes with ptimitive shapes. More...

## 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)
| User-defined parametric surface function. More...

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

## Detailed Description

A primitive object is an object with necessary data for creating meshes with ptimitive shapes.

Data from a primitive can be set to Evas_Canvas3D_Mesh by using evas_canvas3d_mesh_from_primitive_set() function.

## Typedef Documentation

Evas_Canvas3D_Surface_Func

User-defined parametric surface function.

Used for easy creation of custom surfaces as a primitive.

Since
  1.15

## Function Documentation

EOAPI void evas_canvas3d_primitive_form_set | ( | Evas_Canvas3D_Mesh_Primitive | form | ) |

Set 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] | form | Form of primitive.

EOAPI Evas_Canvas3D_Mesh_Primitive evas_canvas3d_primitive_form_get | ( | void |  | ) |

Get the form of the given primitive.

See also evas_canvas3d_primitive_form_set.

Returns
  Form of primitive.

EOAPI void evas_canvas3d_primitive_mode_set | ( | Evas_Canvas3D_Primitive_Mode | mode | ) |

Set 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 alternative algorithm for primitive with given form (like cone without base or sphere textured in alternative way).

Now available next mods of primitives are witout base (bases) (supported for cylinder and cone) and with alternative UV (supported by sphere).

Default form is EVAS_CANVAS3D_PRIMITIVE_MODE_DEFAULT.

Parameters

  [in] | mode | Mode of primitive.

EOAPI Evas_Canvas3D_Primitive_Mode evas_canvas3d_primitive_mode_get | ( | void |  | ) |

Get the mode of the given primitive.

See also evas_canvas3d_primitive_mode_set.

Returns
  Mode of primitive.

EOAPI void evas_canvas3d_primitive_ratio_set | ( | Evas_Real | ratio | ) |

Set the ratio of the given primitive.

Now ratio uses 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, will be used 3.0 as ratio. Like ratio of usual doughnut.

Default ratio is 3.0.

Parameters

  [in] | ratio | Ratio of primitive.

EOAPI Evas_Real evas_canvas3d_primitive_ratio_get | ( | void |  | ) |

Get the ratio of the given primitive.

See also evas_canvas3d_primitive_ratio_set.

Returns
  Ratio of primitive.

EOAPI void evas_canvas3d_primitive_precision_set | ( | int | precision | ) |

Set the precision of the given primitive.

Precision uses in all non tabulated primitives and defines precision of created primitives. Available values is from 3 to infinity. But if value will be more than 100, should be a warning about possibility of incorrect or slow work.

Default ratio is 10.

Parameters

  [in] | precision | Precision of primitive.

EOAPI int evas_canvas3d_primitive_precision_get | ( | void |  | ) |

Get the precision of the given primitive.

See also evas_canvas3d_primitive_precision_set.

Returns
  Precision of primitive.

EOAPI void evas_canvas3d_primitive_surface_set | ( | Evas_Canvas3D_Surface_Func * | surface | ) |

Set the surface of the given primitive.

Surface uses only in surface primitive and defines equation of filling mesh data on call of evas_canvas3d_mesh_primitive_set.

It gives possibility 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 as an example of usage.

Default surface is `null`

Parameters

  [in] | surface | Pointer to customers surface function.

EOAPI void evas_canvas3d_primitive_tex_scale_set | ( | Evas_Real | tex_scale_x,
|  | Evas_Real | tex_scale_y
| ) |  |

Set the texture scale of the given primitive.

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

It uses to create periodical textured meshes.

Default tex_scale is {1.0, 1.0}

Parameters

  [in] | tex_scale_x |
  [in] | tex_scale_y |

EOAPI void evas_canvas3d_primitive_tex_scale_get | ( | Evas_Real * | tex_scale_x,
|  | Evas_Real * | tex_scale_y
| ) |  |

Get the texture scale of the given primitive.

See also evas_canvas3d_primitive_tex_scale_set.

Parameters

  [out] | tex_scale_x |
  [out] | tex_scale_y |