# lv_gltf.h (/api/libs/gltf/gltf_view/lv_gltf_h)



<ApiSummary functions="43" enums="2" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (15)&#x22;,&#x22;Getters (21)&#x22;,&#x22;Other (7)&#x22;]">
  <ApiTab value="Setters (15)">
    <ApiMember kind="function" name="lv_gltf_set_environment" file="libs/gltf/gltf_view/lv_gltf.h" line="65" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L65">
      lv_gltf_set_environment [#lv_gltf_set_environment]

      Assign an environment to a glTF object for IBL rendering

      ```c title=" " lineNumbers=1
      void lv_gltf_set_environment(lv_obj_t *obj, lv_gltf_environment_t *environment)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name          | Type                                                                       | Description                       |
      | ------------- | -------------------------------------------------------------------------- | --------------------------------- |
      | `obj`         | <ApiLink name="lv_obj_t" display="lv_obj_t *" />                           | pointer to a glTF viewer object   |
      | `environment` | <ApiLink name="lv_gltf_environment_t" display="lv_gltf_environment_t *" /> | pointer to the environment to use |

      <Callout type="info">
        The environment can be shared across multiple glTF objects
      </Callout>

      <Callout type="info">
        If no environment is set before attempting to load a file, a default one will be created for you
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_yaw" file="libs/gltf/gltf_view/lv_gltf.h" line="126" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L126">
      lv_gltf_set_yaw [#lv_gltf_set_yaw]

      Set the yaw (horizontal rotation) of the camera

      ```c title=" " lineNumbers=1
      void lv_gltf_set_yaw(lv_obj_t *obj, float yaw)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                     |
      | ----- | ------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `yaw` | `float`                                          | yaw angle in degrees            |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_pitch" file="libs/gltf/gltf_view/lv_gltf.h" line="140" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L140">
      lv_gltf_set_pitch [#lv_gltf_set_pitch]

      Set the pitch (vertical rotation) of the camera

      ```c title=" " lineNumbers=1
      void lv_gltf_set_pitch(lv_obj_t *obj, float pitch)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `pitch` | `float`                                          | pitch angle in degrees          |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_distance" file="libs/gltf/gltf_view/lv_gltf.h" line="154" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L154">
      lv_gltf_set_distance [#lv_gltf_set_distance]

      Set the camera distance from the focal point

      ```c title=" " lineNumbers=1
      void lv_gltf_set_distance(lv_obj_t *obj, float value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | `float`                                          | distance value                  |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_fov" file="libs/gltf/gltf_view/lv_gltf.h" line="179" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L179">
      lv_gltf_set_fov [#lv_gltf_set_fov]

      Set the field of view

      ```c title=" " lineNumbers=1
      void lv_gltf_set_fov(lv_obj_t *obj, float value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                                                                       |
      | ------- | ------------------------------------------------ | --------------------------------------------------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object                                                   |
      | `value` | `float`                                          | vertical FOV in degrees. If zero, the view will be orthographic (non-perspective) |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_focal_x" file="libs/gltf/gltf_view/lv_gltf.h" line="197" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L197">
      lv_gltf_set_focal_x [#lv_gltf_set_focal_x]

      Set the X coordinate of the camera focal point

      ```c title=" " lineNumbers=1
      void lv_gltf_set_focal_x(lv_obj_t *obj, float value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | `float`                                          | X coordinate                    |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_focal_y" file="libs/gltf/gltf_view/lv_gltf.h" line="211" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L211">
      lv_gltf_set_focal_y [#lv_gltf_set_focal_y]

      Set the Y coordinate of the camera focal point

      ```c title=" " lineNumbers=1
      void lv_gltf_set_focal_y(lv_obj_t *obj, float value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | `float`                                          | Y coordinate                    |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_focal_z" file="libs/gltf/gltf_view/lv_gltf.h" line="225" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L225">
      lv_gltf_set_focal_z [#lv_gltf_set_focal_z]

      Set the Z coordinate of the camera focal point

      ```c title=" " lineNumbers=1
      void lv_gltf_set_focal_z(lv_obj_t *obj, float value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | `float`                                          | Z coordinate                    |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_camera" file="libs/gltf/gltf_view/lv_gltf.h" line="253" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L253">
      lv_gltf_set_camera [#lv_gltf_set_camera]

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

      ```c title=" " lineNumbers=1
      void lv_gltf_set_camera(lv_obj_t *obj, uint32_t value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                                                    |
      | ------- | ------------------------------------------------ | -------------------------------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object                                |
      | `value` | <ApiLink name="uint32_t" />                      | camera index (0 for default camera, 1+ for scene camera index) |

      <Callout type="info">
        Values higher than the scene's camera count will be clamped to the maximum available camera index
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_animation_speed" file="libs/gltf/gltf_view/lv_gltf.h" line="287" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L287">
      lv_gltf_set_animation_speed [#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

      ```c title=" " lineNumbers=1
      void lv_gltf_set_animation_speed(lv_obj_t *obj, uint32_t value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | <ApiLink name="uint32_t" />                      | speed-up ratio of the animation |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_background_mode" file="libs/gltf/gltf_view/lv_gltf.h" line="309" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L309">
      lv_gltf_set_background_mode [#lv_gltf_set_background_mode]

      Set the background mode

      ```c title=" " lineNumbers=1
      void lv_gltf_set_background_mode(lv_obj_t *obj, lv_gltf_bg_mode_t value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | <ApiLink name="lv_gltf_bg_mode_t" />             | background mode                 |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_background_blur" file="libs/gltf/gltf_view/lv_gltf.h" line="323" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L323">
      lv_gltf_set_background_blur [#lv_gltf_set_background_blur]

      Set the background blur amount

      ```c title=" " lineNumbers=1
      void lv_gltf_set_background_blur(lv_obj_t *obj, uint32_t value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | <ApiLink name="uint32_t" />                      | blur amount between 0 and 100   |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_env_brightness" file="libs/gltf/gltf_view/lv_gltf.h" line="337" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L337">
      lv_gltf_set_env_brightness [#lv_gltf_set_env_brightness]

      Set the environmental brightness/power

      ```c title=" " lineNumbers=1
      void lv_gltf_set_env_brightness(lv_obj_t *obj, uint32_t value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | <ApiLink name="uint32_t" />                      | brightness multiplier           |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_image_exposure" file="libs/gltf/gltf_view/lv_gltf.h" line="351" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L351">
      lv_gltf_set_image_exposure [#lv_gltf_set_image_exposure]

      Set the image exposure level

      ```c title=" " lineNumbers=1
      void lv_gltf_set_image_exposure(lv_obj_t *obj, float value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | `float`                                          | exposure level (1.0 is default) |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_set_antialiasing_mode" file="libs/gltf/gltf_view/lv_gltf.h" line="369" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L369">
      lv_gltf_set_antialiasing_mode [#lv_gltf_set_antialiasing_mode]

      Set the anti-aliasing mode

      ```c title=" " lineNumbers=1
      void lv_gltf_set_antialiasing_mode(lv_obj_t *obj, lv_gltf_aa_mode_t value)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |
      | `value` | <ApiLink name="lv_gltf_aa_mode_t" />             | anti-aliasing mode              |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (21)">
    <ApiMember kind="function" name="lv_gltf_get_model_count" file="libs/gltf/gltf_view/lv_gltf.h" line="102" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L102">
      lv_gltf_get_model_count [#lv_gltf_get_model_count]

      Get the number of models loaded in the glTF viewer

      ```c title=" " lineNumbers=1
      size_t lv_gltf_get_model_count(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                     |
      | ----- | ------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** <ApiLink name="size_t" /> — the total number of models in the viewer
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_model_by_index" file="libs/gltf/gltf_view/lv_gltf.h" line="110" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L110">
      lv_gltf_get_model_by_index [#lv_gltf_get_model_by_index]

      Get a specific model by its index

      ```c title=" " lineNumbers=1
      lv_gltf_model_t * lv_gltf_get_model_by_index(const lv_obj_t *obj, size_t id)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                              |
      | ----- | ------------------------------------------------------ | ---------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object          |
      | `id`  | <ApiLink name="size_t" />                              | index of the model to retrieve (0-based) |

      **Returns:** <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> — pointer to the model at the specified index, or NULL if index is invalid
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_primary_model" file="libs/gltf/gltf_view/lv_gltf.h" line="119" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L119">
      lv_gltf_get_primary_model [#lv_gltf_get_primary_model]

      Get the primary model from the glTF viewer The primary model is the first model added to the viewer and can be used for camera selection and other primary operations

      ```c title=" " lineNumbers=1
      lv_gltf_model_t * lv_gltf_get_primary_model(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> — pointer to the primary model, or NULL if no models are loaded
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_yaw" file="libs/gltf/gltf_view/lv_gltf.h" line="133" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L133">
      lv_gltf_get_yaw [#lv_gltf_get_yaw]

      Get the yaw (horizontal rotation) of the camera

      ```c title=" " lineNumbers=1
      float lv_gltf_get_yaw(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** `float` — yaw angle in degrees
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_pitch" file="libs/gltf/gltf_view/lv_gltf.h" line="147" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L147">
      lv_gltf_get_pitch [#lv_gltf_get_pitch]

      Get the pitch (vertical rotation) of the camera

      ```c title=" " lineNumbers=1
      float lv_gltf_get_pitch(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** `float` — pitch angle in degrees
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_distance" file="libs/gltf/gltf_view/lv_gltf.h" line="161" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L161">
      lv_gltf_get_distance [#lv_gltf_get_distance]

      Get the camera distance scale factor from the focal point

      ```c title=" " lineNumbers=1
      float lv_gltf_get_distance(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** `float` — distance scaling factor value
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_world_distance" file="libs/gltf/gltf_view/lv_gltf.h" line="168" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L168">
      lv_gltf_get_world_distance [#lv_gltf_get_world_distance]

      Get the camera distance from the focal point in world units

      ```c title=" " lineNumbers=1
      float lv_gltf_get_world_distance(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a GLTF viewer object |

      **Returns:** `float` — world unit distance value
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_fov" file="libs/gltf/gltf_view/lv_gltf.h" line="186" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L186">
      lv_gltf_get_fov [#lv_gltf_get_fov]

      Get the field of view

      ```c title=" " lineNumbers=1
      float lv_gltf_get_fov(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** `float` — vertical FOV in degrees
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_focal_x" file="libs/gltf/gltf_view/lv_gltf.h" line="204" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L204">
      lv_gltf_get_focal_x [#lv_gltf_get_focal_x]

      Get the X coordinate of the camera focal point

      ```c title=" " lineNumbers=1
      float lv_gltf_get_focal_x(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** `float` — X coordinate
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_focal_y" file="libs/gltf/gltf_view/lv_gltf.h" line="218" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L218">
      lv_gltf_get_focal_y [#lv_gltf_get_focal_y]

      Get the Y coordinate of the camera focal point

      ```c title=" " lineNumbers=1
      float lv_gltf_get_focal_y(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** `float` — Y coordinate
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_focal_z" file="libs/gltf/gltf_view/lv_gltf.h" line="232" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L232">
      lv_gltf_get_focal_z [#lv_gltf_get_focal_z]

      Get the Z coordinate of the camera focal point

      ```c title=" " lineNumbers=1
      float lv_gltf_get_focal_z(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** `float` — Z coordinate
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_camera" file="libs/gltf/gltf_view/lv_gltf.h" line="260" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L260">
      lv_gltf_get_camera [#lv_gltf_get_camera]

      Get the active camera index

      ```c title=" " lineNumbers=1
      uint32_t lv_gltf_get_camera(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** <ApiLink name="uint32_t" /> — active camera index
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_camera_count" file="libs/gltf/gltf_view/lv_gltf.h" line="273" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L273">
      lv_gltf_get_camera_count [#lv_gltf_get_camera_count]

      Get the number of cameras in the first glTF model added to the viewer This count represents the valid range for the camera index parameter used with <ApiLink name="lv_gltf_set_camera" display="lv_gltf_set_camera()" />

      To get the camera count of other models, call lv\_gltf\_model\_get\_camera\_count(model) directly with the specific model

      ```c title=" " lineNumbers=1
      uint32_t lv_gltf_get_camera_count(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** <ApiLink name="uint32_t" /> — number of available cameras
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_animation_speed" file="libs/gltf/gltf_view/lv_gltf.h" line="298" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L298">
      lv_gltf_get_animation_speed [#lv_gltf_get_animation_speed]

      DEPRECATED. See `lv_gltf_model_get_animation_speed`

      Get the animation speed ratio

      The actual ratio is the return value / LV\_GLTF\_ANIM\_SPEED\_NORMAL

      ```c title=" " lineNumbers=1
      uint32_t lv_gltf_get_animation_speed(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_background_mode" file="libs/gltf/gltf_view/lv_gltf.h" line="316" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L316">
      lv_gltf_get_background_mode [#lv_gltf_get_background_mode]

      Get the background mode

      ```c title=" " lineNumbers=1
      lv_gltf_bg_mode_t lv_gltf_get_background_mode(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** <ApiLink name="lv_gltf_bg_mode_t" /> — background mode
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_background_blur" file="libs/gltf/gltf_view/lv_gltf.h" line="330" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L330">
      lv_gltf_get_background_blur [#lv_gltf_get_background_blur]

      Get the background blur amount

      ```c title=" " lineNumbers=1
      uint32_t lv_gltf_get_background_blur(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** <ApiLink name="uint32_t" /> — blur amount between 0 and 100
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_env_brightness" file="libs/gltf/gltf_view/lv_gltf.h" line="344" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L344">
      lv_gltf_get_env_brightness [#lv_gltf_get_env_brightness]

      Get the environmental brightness/power

      ```c title=" " lineNumbers=1
      uint32_t lv_gltf_get_env_brightness(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** <ApiLink name="uint32_t" /> — brightness multiplier
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_image_exposure" file="libs/gltf/gltf_view/lv_gltf.h" line="358" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L358">
      lv_gltf_get_image_exposure [#lv_gltf_get_image_exposure]

      Get the image exposure level

      ```c title=" " lineNumbers=1
      float lv_gltf_get_image_exposure(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** `float` — exposure level
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_antialiasing_mode" file="libs/gltf/gltf_view/lv_gltf.h" line="376" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L376">
      lv_gltf_get_antialiasing_mode [#lv_gltf_get_antialiasing_mode]

      Get the anti-aliasing mode

      ```c title=" " lineNumbers=1
      lv_gltf_aa_mode_t lv_gltf_get_antialiasing_mode(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                     |
      | ----- | ------------------------------------------------------ | ------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to a glTF viewer object |

      **Returns:** <ApiLink name="lv_gltf_aa_mode_t" /> — anti-aliasing mode
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_current_view_plane" file="libs/gltf/gltf_view/lv_gltf.h" line="398" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L398">
      lv_gltf_get_current_view_plane [#lv_gltf_get_current_view_plane]

      Get a plane that faces the current view camera, centered some units in front of it

      ```c title=" " lineNumbers=1
      lv_3dplane_t lv_gltf_get_current_view_plane(lv_obj_t *obj, float distance)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                             | Description                                                                                                                   |
      | ---------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a GLTF viewer object                                                                                               |
      | `distance` | `float`                                          | distance in front of the camera to set the plane, in world units. see lv\_gltf\_get\_world\_distance to get the auto-distance |

      **Returns:** <ApiLink name="lv_3dplane_t" /> — camera facing plane
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_get_ray_from_2d_coordinate" file="libs/gltf/gltf_view/lv_gltf.h" line="406" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L406">
      lv_gltf_get_ray_from_2d_coordinate [#lv_gltf_get_ray_from_2d_coordinate]

      Calculates a ray originating from the camera and passing through the specified mouse position on the screen.

      ```c title=" " lineNumbers=1
      lv_3dray_t lv_gltf_get_ray_from_2d_coordinate(lv_obj_t *obj, const lv_point_t *screen_pos)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                                       | Description                     |
      | ------------ | ---------------------------------------------------------- | ------------------------------- |
      | `obj`        | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           | pointer to a GLTF viewer object |
      | `screen_pos` | <ApiLink name="lv_point_t" display="const lv_point_t *" /> | screen coordinate, in pixels    |

      **Returns:** <ApiLink name="lv_3dray_t" /> — mouse point ray
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (7)">
    <ApiMember kind="function" name="lv_gltf_create" file="libs/gltf/gltf_view/lv_gltf.h" line="55" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L55">
      lv_gltf_create [#lv_gltf_create]

      Create a glTF object

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_gltf_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                  |
      | -------- | ------------------------------------------------ | ---------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to the parent object |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created glTF object
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_load_model_from_file" file="libs/gltf/gltf_view/lv_gltf.h" line="73" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L73">
      lv_gltf_load_model_from_file [#lv_gltf_load_model_from_file]

      Load a glTF model from a file into the viewer

      ```c title=" " lineNumbers=1
      lv_gltf_model_t * lv_gltf_load_model_from_file(lv_obj_t *obj, const char *path)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                         |
      | ------ | ------------------------------------------------ | ----------------------------------- |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a glTF viewer object     |
      | `path` | `const char *`                                   | file path to the glTF model to load |

      **Returns:** <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> — pointer to the loaded glTF model, or NULL on failure
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_load_model_from_bytes" file="libs/gltf/gltf_view/lv_gltf.h" line="82" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L82">
      lv_gltf_load_model_from_bytes [#lv_gltf_load_model_from_bytes]

      Load a glTF model from a byte array into the viewer

      ```c title=" " lineNumbers=1
      lv_gltf_model_t * lv_gltf_load_model_from_bytes(lv_obj_t *obj, const uint8_t *bytes, size_t len)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                 | Description                     |
      | ------- | ---------------------------------------------------- | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" />     | pointer to a glTF viewer object |
      | `bytes` | <ApiLink name="uint8_t" display="const uint8_t *" /> | glTF raw data                   |
      | `len`   | <ApiLink name="size_t" />                            | glTF raw data length in bytes   |

      **Returns:** <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> — pointer to the loaded glTF model, or NULL on failure
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_add_model" file="libs/gltf/gltf_view/lv_gltf.h" line="95" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L95">
      lv_gltf_add_model [#lv_gltf_add_model]

      Add a glTF model to the viewer.

      Contrary to `lv_gltf_load_model_from_file` and `lv_gltf_load_model_from_bytes`, the model is owned by the caller of this function meaning that it's the caller's responsibility to delete the model when it is no longer needed, that is, the model must outlive the viewer's lifetime.

      ```c title=" " lineNumbers=1
      lv_result_t lv_gltf_add_model(lv_obj_t *obj, lv_gltf_model_t *model)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                           | Description                     |
      | ------- | -------------------------------------------------------------- | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" />               | pointer to a glTF viewer object |
      | `model` | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> | glTF model to add to the viewer |

      **Returns:** <ApiLink name="lv_result_t" /> — LV\_RESULT\_OK if the model was added to the viewer or LV\_RESULT\_INVALID on failure
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_recenter" file="libs/gltf/gltf_view/lv_gltf.h" line="239" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L239">
      lv_gltf_recenter [#lv_gltf_recenter]

      Set the focal coordinates to the center point of the model object

      ```c title=" " lineNumbers=1
      void lv_gltf_recenter(lv_obj_t *obj, lv_gltf_model_t *model)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                           | Description                                                 |
      | ------- | -------------------------------------------------------------- | ----------------------------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" />               | pointer to a glTF viewer object                             |
      | `model` | <ApiLink name="lv_gltf_model_t" display="lv_gltf_model_t *" /> | a model attached to this viewer or NULL for the first model |
    </ApiMember>

    <ApiMember kind="function" name="lv_intersect_ray_with_plane" file="libs/gltf/gltf_view/lv_gltf.h" line="389" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L389">
      lv_intersect_ray_with_plane [#lv_intersect_ray_with_plane]

      Get the point that a given ray intersects with a specified plane at, if any

      ```c title=" " lineNumbers=1
      lv_result_t lv_intersect_ray_with_plane(const lv_3dray_t *ray, const lv_3dplane_t *plane, lv_3dpoint_t *collision_point)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name              | Type                                                           | Description                                                                                      |
      | ----------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
      | `ray`             | <ApiLink name="lv_3dray_t" display="const lv_3dray_t *" />     | the intersection test ray                                                                        |
      | `plane`           | <ApiLink name="lv_3dplane_t" display="const lv_3dplane_t *" /> |                                                                                                  |
      | `collision_point` | <ApiLink name="lv_3dpoint_t" display="lv_3dpoint_t *" />       | output <ApiLink name="lv_3dpoint_t" /> holder, values are only valid if true is the return value |

      **Returns:** <ApiLink name="lv_result_t" /> — LV\_RESULT\_OK if intersection, LV\_RESULT\_INVALID if no intersection
    </ApiMember>

    <ApiMember kind="function" name="lv_gltf_world_to_screen" file="libs/gltf/gltf_view/lv_gltf.h" line="416" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L416">
      lv_gltf_world_to_screen [#lv_gltf_world_to_screen]

      Get the screen position of a 3d point

      ```c title=" " lineNumbers=1
      lv_result_t lv_gltf_world_to_screen(lv_obj_t *obj, const lv_3dpoint_t world_pos, lv_point_t *screen_pos)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                                         | Description                     |
      | ------------ | ------------------------------------------------------------ | ------------------------------- |
      | `obj`        | <ApiLink name="lv_obj_t" display="lv_obj_t *" />             | pointer to a GLTF viewer object |
      | `world_pos`  | <ApiLink name="lv_3dpoint_t" display="const lv_3dpoint_t" /> | world position to convert       |
      | `screen_pos` | <ApiLink name="lv_point_t" display="lv_point_t *" />         |                                 |

      **Returns:** <ApiLink name="lv_result_t" /> — LV\_RESULT\_OK if conversion valid, LV\_RESULT\_INVALID if no valid conversion
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_gltf_aa_mode_t" file="libs/gltf/gltf_view/lv_gltf.h" line="34" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L34">
  lv_gltf_aa_mode_t [#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  |
</ApiMember>

<TypeUsedBy name="lv_gltf_aa_mode_t" count="1">
  * `lv_gltf_set_antialiasing_mode` — param `value`
</TypeUsedBy>

<ApiMember kind="enum" name="lv_gltf_bg_mode_t" file="libs/gltf/gltf_view/lv_gltf.h" line="40" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/libs/gltf/gltf_view/lv_gltf.h#L40">
  lv_gltf_bg_mode_t [#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 |
</ApiMember>

<TypeUsedBy name="lv_gltf_bg_mode_t" count="1">
  * `lv_gltf_set_background_mode` — param `value`
</TypeUsedBy>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_3dmath.h&#x22;, &#x22;lv_types.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_gltf_model.h&#x22;]" includedBy="[&#x22;lv_gltf_data_internal.hpp&#x22;, &#x22;lv_gltf_view_internal.h&#x22;]" transitiveIncludes="[&#x22;lv_array.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_gltf_model_loader.h&#x22;, &#x22;lv_gltf_model_node.h&#x22;, &#x22;lv_math.h&#x22;]" />
