Skip to content

Vec3

Index · Français

Description

Three-component floating-point vector. Use with Shapes3D and Rasterizer3D.

gaspardos::graphics::Vec3 — bindings/cpp/raster3d.hpp, C++98.

Simple program example

#include "raster3d.hpp"
using namespace gaspardos::graphics;

int main()
{
    Vec3 value(1, 2, 3);
    return value.z == 3 ? 0 : 1;
}

Building from Windows

From the repository root, save the program as build/api-examples/Vec3.cpp.

New-Item -ItemType Directory -Force build/api-examples | Out-Null
& .\build-x64-install\bin\x86_64-gaspardos-g++.exe -std=c++98 -O2 -Ibindings/cpp build/api-examples/Vec3.cpp bindings/cpp/raster3d.cpp -o build/api-examples/Vec3.elf
if ($LASTEXITCODE -ne 0) { throw "C++ build failed" }

Executable for GaspardOS. Presentation requires WINDOW_BLIT=146 in the kernel; -38 means the extension is absent. Source files.

Methods and public data

Vec3(float x=0, float y=0, float z=0)

Initialize the three coordinates.

Public fields

x, y, z : float