Esc

Gltf_Orthographic

structextensionsince 0.36.1Source
  • macOS: Gltf_Orthographic works on macOS
  • Linux: Gltf_Orthographic works on Linux
  • Windows: Gltf_Orthographic works on Windows
  • Wasm: Gltf_Orthographic works on Wasm

Declaration

Gltf_Orthographic :: struct @json(rename_all=camelCase) {
    xmag: float32;    ymag: float32;    zfar: float32;    znear: float32;    name: string; @json(default,skip_serializing_if=empty)    extensions: Json_Value; @json(default,skip_serializing_if=null)    extras: Json_Value; @json(default,skip_serializing_if=null)}

An orthographic projection with half-widths xmag and ymag.

Example↗
asset, error := gltf_load("{\"asset\":{\"version\":\"2.0\"},\"cameras\":[{\"type\":\"orthographic\",\"orthographic\":{\"xmag\":2,\"ymag\":1,\"zfar\":10,\"znear\":1}}]}");
assert(error.kind == .NONE);
defer gltf_free(*asset);
box := asset.document.cameras[0].orthographic;
assert(box.xmag == 2 && box.zfar == 10);

See also