A unit part of an arrow along z from the origin (vkf_geometry's arrow: body and head lengths and radii), white (colored by its material), lit as frames' axes. Null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=c_double), | intent(in) | :: | body_length |
the shaft's length (0: none) |
||
| real(kind=c_double), | intent(in) | :: | head_length |
the head's length (0: a flat top) |
||
| real(kind=c_double), | intent(in) | :: | body_radius |
the shaft's radius |
||
| real(kind=c_double), | intent(in) | :: | head_radius |
the head's radius at its base |
function unit_part(body_length, head_length, body_radius, head_radius) result(mesh) real(c_double), intent(in) :: body_length !! the shaft's length (0: none) real(c_double), intent(in) :: head_length !! the head's length (0: a flat top) real(c_double), intent(in) :: body_radius !! the shaft's radius real(c_double), intent(in) :: head_radius !! the head's radius at its base type(c_ptr) :: mesh integer, parameter :: segments = 24 real(c_float), dimension(:,:), pointer :: xyz, normals, uv integer(c_int32_t), dimension(:), pointer :: indices integer :: n_vertices, n_indices call arrow_size(segments, n_vertices, n_indices) mesh = vkf_mesh_create(int(n_vertices, c_int), int(n_indices, c_int), & [1.0_c_float, 1.0_c_float, 1.0_c_float, 1.0_c_float], c_null_ptr, c_null_ptr, 2_c_int) if (.not. c_associated(mesh)) return call mesh_arrays(mesh, n_vertices, n_indices, xyz, normals, uv, indices) call arrow([0.0_c_double, 0.0_c_double, 0.0_c_double], [0.0_c_double, 0.0_c_double, 1.0_c_double], & body_length, head_length, body_radius, head_radius, segments, xyz, normals, uv, indices) end function unit_part