vkf_geometry Module

Geometry generation for vkframes: meshes and lines computed in Fortran and written into the rendering layer's buffers.


Uses

  • module~~vkf_geometry~~UsesGraph module~vkf_geometry vkf_geometry iso_c_binding iso_c_binding module~vkf_geometry->iso_c_binding module~vkf_layer vkf_layer module~vkf_geometry->module~vkf_layer module~vkf_math vkf_math module~vkf_geometry->module~vkf_math module~vkf_layer->iso_c_binding iso_fortran_env iso_fortran_env module~vkf_math->iso_fortran_env

Used by

  • module~~vkf_geometry~~UsedByGraph module~vkf_geometry vkf_geometry module~vkf_frames vkf_frames module~vkf_frames->module~vkf_geometry module~vkf_handles vkf_handles module~vkf_handles->module~vkf_geometry module~vkf_handles->module~vkf_frames module~vkf_artists vkf_artists module~vkf_handles->module~vkf_artists module~vkf_sphere vkf_sphere module~vkf_sphere->module~vkf_geometry module~vkf_sphere->module~vkf_frames module~vkf_artists->module~vkf_frames module~vkf_hud vkf_hud module~vkf_hud->module~vkf_frames module~vkf_line_segments vkf_line_segments module~vkf_line_segments->module~vkf_frames module~vkf_model vkf_model module~vkf_model->module~vkf_frames module~vkf_shadow vkf_shadow module~vkf_shadow->module~vkf_frames module~vkf_shadow->module~vkf_sphere module~vkf_terrain vkf_terrain module~vkf_shadow->module~vkf_terrain module~vkf_shapes vkf_shapes module~vkf_shapes->module~vkf_frames module~vkf_shapes->module~vkf_artists module~vkf_terrain->module~vkf_frames module~vkf_view vkf_view module~vkf_view->module~vkf_frames module~vkf_window vkf_window module~vkf_window->module~vkf_frames module~vkf_window->module~vkf_handles module~vkf_window->module~vkf_hud module~vkf_window->module~vkf_view module~vkframes vkframes module~vkframes->module~vkf_frames module~vkframes->module~vkf_handles module~vkframes->module~vkf_sphere module~vkframes->module~vkf_artists module~vkframes->module~vkf_hud module~vkframes->module~vkf_line_segments module~vkframes->module~vkf_model module~vkframes->module~vkf_shadow module~vkframes->module~vkf_shapes module~vkframes->module~vkf_terrain module~vkframes->module~vkf_view module~vkframes->module~vkf_window

Functions

public function arrow_create(base, direction, body_length, head_length, body_radius, head_radius, rgba, n_segments) result(mesh)

An arrow mesh node (see arrow) of color rgba, with 24 segments by default. Null on failure.

Arguments

Type IntentOptional 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)

Return Value type(c_ptr)

public function ellipsoid_create(radii, rgba, texture, n_lon, n_lat, night_texture, translucent) result(mesh)

An ellipsoid mesh node with semi-axes radii (x, y, z) and color (rgba, multiplying the texture), with an optional equirectangular texture and night texture (image handles; the night texture shows where the light is weak). n_lon and n_lat default to 128 and 64 segments. With translucent, a translucent surface (its material's alpha; drawn after the opaque scene, sorted by depth). Null on failure.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in), dimension(3) :: radii

semi-axes along x, y, z

real(kind=c_float), intent(in), dimension(4) :: rgba

color [r, g, b, a] (0 to 1)

type(c_ptr), intent(in), optional :: texture

image handle of the (day) texture

integer, intent(in), optional :: n_lon

segments in longitude (default 128)

integer, intent(in), optional :: n_lat

segments in latitude (default 64)

type(c_ptr), intent(in), optional :: night_texture

image handle of the night texture

logical, intent(in), optional :: translucent

a translucent surface (default false)

Return Value type(c_ptr)

public function sphere_create(radius, rgba, texture, n_lon, n_lat) result(mesh)

A sphere mesh node: ellipsoid_create with equal semi-axes.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: radius

the sphere's radius

real(kind=c_float), intent(in), dimension(4) :: rgba

color [r, g, b, a] (0 to 1)

type(c_ptr), intent(in), optional :: texture

image handle of the texture

integer, intent(in), optional :: n_lon

segments in longitude (default 128)

integer, intent(in), optional :: n_lat

segments in latitude (default 64)

Return Value type(c_ptr)


Subroutines

public subroutine arrow(base, direction, body_length, head_length, body_radius, head_radius, n_segments, xyz, normals, uv, indices)

An arrow (OpenFrames' Vector: a cylinder body and a cone head) from base along direction: body of length body_length and radius body_radius, then a head of length head_length and base radius head_radius, closed at the bottom of the body and of the head, with n_segments around. Triangles are counter-clockwise seen from outside; indices are 0-based; uv is zero. Sizes are given by arrow_size.

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: base(3)

the arrow's base (start of the body)

real(kind=c_double), intent(in) :: direction(3)

the arrow's 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

integer, intent(in) :: n_segments

segments around

real(kind=c_float), intent(out), dimension(:,:) :: xyz

(3, n_vertices)

real(kind=c_float), intent(out), dimension(:,:) :: normals

(3, n_vertices)

real(kind=c_float), intent(out), dimension(:,:) :: uv

(2, n_vertices): zero

integer(kind=c_int32_t), intent(out), dimension(:) :: indices

(n_indices)

public pure subroutine arrow_size(n_segments, n_vertices, n_indices)

Number of vertices and triangle indices of arrow(..., n_segments, ...).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n_segments

segments around

integer, intent(out) :: n_vertices

number of vertices

integer, intent(out) :: n_indices

number of triangle indices (3 per triangle)

public pure subroutine ellipsoid(radii, n_lon, n_lat, xyz, normals, uv, indices)

A triaxial ellipsoid with semi-axes radii (x, y, z) centered at the origin, for an equirectangular texture in geodetic coordinates.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in), dimension(3) :: radii

semi-axes along x, y, z

integer, intent(in) :: n_lon

segments in longitude (>= 3)

integer, intent(in) :: n_lat

segments in latitude (>= 2)

real(kind=c_float), intent(out), dimension(:,:) :: xyz

(3, n_vertices)

real(kind=c_float), intent(out), dimension(:,:) :: normals

(3, n_vertices)

real(kind=c_float), intent(out), dimension(:,:) :: uv

(2, n_vertices)

integer(kind=c_int32_t), intent(out), dimension(:) :: indices

(n_indices)

public pure subroutine ellipsoid_size(n_lon, n_lat, n_vertices, n_indices)

Number of vertices and triangle indices of ellipsoid(radii, n_lon, n_lat, ...).

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n_lon

segments in longitude

integer, intent(in) :: n_lat

segments in latitude

integer, intent(out) :: n_vertices

number of vertices

integer, intent(out) :: n_indices

number of triangle indices (3 per triangle)