An arrow mesh node (see arrow) of color rgba, with 24 segments by
default. Null on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=c_double), | intent(in) | :: | base(3) |
the arrow's base, and its axis (need not be unit length) |
||
| real(kind=c_double), | intent(in) | :: | direction(3) |
the arrow's base, and its axis (need not be unit length) |
||
| real(kind=c_double), | intent(in) | :: | body_length |
lengths along the axis, and radii |
||
| real(kind=c_double), | intent(in) | :: | head_length |
lengths along the axis, and radii |
||
| real(kind=c_double), | intent(in) | :: | body_radius |
lengths along the axis, and radii |
||
| real(kind=c_double), | intent(in) | :: | head_radius |
lengths along the axis, and radii |
||
| real(kind=c_float), | intent(in), | dimension(4) | :: | rgba |
color [r, g, b, a] (0 to 1) |
|
| integer, | intent(in), | optional | :: | n_segments |
segments around (default 24, at least 3) |
function arrow_create(base, direction, body_length, head_length, body_radius, head_radius, rgba, n_segments) & result(mesh) real(c_double), intent(in) :: base(3), direction(3) !! the arrow's base, and its axis (need not be unit length) real(c_double), intent(in) :: body_length, head_length, body_radius, head_radius !! lengths along the axis, and radii real(c_float), dimension(4), intent(in) :: rgba !! color [r, g, b, a] (0 to 1) integer, intent(in), optional :: n_segments !! segments around (default 24, at least 3) type(c_ptr) :: mesh real(c_float), dimension(:,:), pointer :: xyz, normals, uv integer(c_int32_t), dimension(:), pointer :: indices integer :: n, n_vertices, n_indices n = 24 if (present(n_segments)) n = max(3, n_segments) call arrow_size(n, n_vertices, n_indices) ! view lighting: the same from any side, whatever the scene's lights (axes) mesh = vkf_mesh_create(int(n_vertices, c_int), int(n_indices, c_int), rgba, 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(base, direction, body_length, head_length, body_radius, head_radius, n, xyz, normals, uv, indices) end function arrow_create