lv_gltf.h

API reference for lv_gltf.h

Report on GitHub

Functions

lv_gltf_set_environment

Assign an environment to a glTF object for IBL rendering

 
void lv_gltf_set_environment(lv_obj_t *obj, lv_gltf_environment_t *environment)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
environmentlv_gltf_environment_t *pointer to the environment to use

The environment can be shared across multiple glTF objects

If no environment is set before attempting to load a file, a default one will be created for you

lv_gltf_set_yaw

Set the yaw (horizontal rotation) of the camera

 
void lv_gltf_set_yaw(lv_obj_t *obj, float yaw)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
yawfloatyaw angle in degrees

lv_gltf_set_pitch

Set the pitch (vertical rotation) of the camera

 
void lv_gltf_set_pitch(lv_obj_t *obj, float pitch)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
pitchfloatpitch angle in degrees

lv_gltf_set_distance

Set the camera distance from the focal point

 
void lv_gltf_set_distance(lv_obj_t *obj, float value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valuefloatdistance value

lv_gltf_set_fov

Set the field of view

 
void lv_gltf_set_fov(lv_obj_t *obj, float value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valuefloatvertical FOV in degrees. If zero, the view will be orthographic (non-perspective)

lv_gltf_set_focal_x

Set the X coordinate of the camera focal point

 
void lv_gltf_set_focal_x(lv_obj_t *obj, float value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valuefloatX coordinate

lv_gltf_set_focal_y

Set the Y coordinate of the camera focal point

 
void lv_gltf_set_focal_y(lv_obj_t *obj, float value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valuefloatY coordinate

lv_gltf_set_focal_z

Set the Z coordinate of the camera focal point

 
void lv_gltf_set_focal_z(lv_obj_t *obj, float value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valuefloatZ coordinate

lv_gltf_set_camera

Set the active camera index The camera is selected from the first glTF model added to the viewer

 
void lv_gltf_set_camera(lv_obj_t *obj, uint32_t value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valueuint32_tcamera index (0 for default camera, 1+ for scene camera index)

Values higher than the scene's camera count will be clamped to the maximum available camera index

lv_gltf_set_animation_speed

DEPRECATED. See lv_gltf_model_set_animation_speed

Set the animation speed ratio

The actual ratio is the value parameter / LV_GLTF_ANIM_SPEED_NORMAL Values greater than LV_GLTF_ANIM_SPEED_NORMAL will speed-up the animation Values less than LV_GLTF_ANIM_SPEED_NORMAL will slow down the animation

 
void lv_gltf_set_animation_speed(lv_obj_t *obj, uint32_t value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valueuint32_tspeed-up ratio of the animation

lv_gltf_set_background_mode

Set the background mode

 
void lv_gltf_set_background_mode(lv_obj_t *obj, lv_gltf_bg_mode_t value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valuelv_gltf_bg_mode_tbackground mode

lv_gltf_set_background_blur

Set the background blur amount

 
void lv_gltf_set_background_blur(lv_obj_t *obj, uint32_t value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valueuint32_tblur amount between 0 and 100

lv_gltf_set_env_brightness

Set the environmental brightness/power

 
void lv_gltf_set_env_brightness(lv_obj_t *obj, uint32_t value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valueuint32_tbrightness multiplier

lv_gltf_set_image_exposure

Set the image exposure level

 
void lv_gltf_set_image_exposure(lv_obj_t *obj, float value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valuefloatexposure level (1.0 is default)

lv_gltf_set_antialiasing_mode

Set the anti-aliasing mode

 
void lv_gltf_set_antialiasing_mode(lv_obj_t *obj, lv_gltf_aa_mode_t value)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a glTF viewer object
valuelv_gltf_aa_mode_tanti-aliasing mode

Enums

lv_gltf_aa_mode_t

NameValueDescription
LV_GLTF_AA_MODE_OFF0
LV_GLTF_AA_MODE_ON1Anti aliasing off
LV_GLTF_AA_MODE_DYNAMIC2Anti aliasing on
Used by 1 function
  • lv_gltf_set_antialiasing_mode — param value

lv_gltf_bg_mode_t

NameValueDescription
LV_GLTF_BG_MODE_SOLID0
LV_GLTF_BG_MODE_ENVIRONMENT1Solid background. Use lv_obj_set_style_bg_color to set the background color
Used by 1 function
  • lv_gltf_set_background_mode — param value

Dependencies

How is this guide?

Last updated on

On this page