lv_gltf.h
API reference for lv_gltf.h
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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
environment | lv_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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
yaw | float | yaw 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
pitch | float | pitch 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | float | distance value |
lv_gltf_set_fov
Set the field of view
void lv_gltf_set_fov(lv_obj_t *obj, float value)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | float | vertical 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | float | X 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | float | Y 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | float | Z 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | uint32_t | camera 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | uint32_t | speed-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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | lv_gltf_bg_mode_t | background mode |
lv_gltf_set_background_blur
Set the background blur amount
void lv_gltf_set_background_blur(lv_obj_t *obj, uint32_t value)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | uint32_t | blur 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | uint32_t | brightness multiplier |
lv_gltf_set_image_exposure
Set the image exposure level
void lv_gltf_set_image_exposure(lv_obj_t *obj, float value)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | float | exposure 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a glTF viewer object |
value | lv_gltf_aa_mode_t | anti-aliasing mode |
Enums
lv_gltf_aa_mode_t
| Name | Value | Description |
|---|---|---|
LV_GLTF_AA_MODE_OFF | 0 | |
LV_GLTF_AA_MODE_ON | 1 | Anti aliasing off |
LV_GLTF_AA_MODE_DYNAMIC | 2 | Anti aliasing on |
Used by 1 function
lv_gltf_set_antialiasing_mode— paramvalue
lv_gltf_bg_mode_t
| Name | Value | Description |
|---|---|---|
LV_GLTF_BG_MODE_SOLID | 0 | |
LV_GLTF_BG_MODE_ENVIRONMENT | 1 | Solid background. Use lv_obj_set_style_bg_color to set the background color |
Used by 1 function
lv_gltf_set_background_mode— paramvalue
Dependencies
How is this guide?
Last updated on