t
Loading...
Searching...
No Matches
t Namespace Reference

The t software 3D graphics library namespace. More...

Classes

class  AmbientLight
 The ambient light, which illuminates all objects in the scene equally. More...
 
struct  Attributes
 The attributes of a vertex, available to vertex shaders. More...
 
class  BlinnPhong
 A shiny material that uses the Blinn-Phong reflection model. More...
 
class  Box
 The geometry of a cuboid (box). More...
 
class  BufferAttribute
 A class representing attributes, such as vertex positions, face indices, and vertex normals. More...
 
class  Camera
 The base camera class. More...
 
class  Color
 The color class. More...
 
class  EulerRotation
 The Euler rotation class. More...
 
struct  Fragment
 The fragment class. More...
 
class  Geometry
 The base 3D geometry class. More...
 
class  Light
 The base lighting class. More...
 
class  Material
 The base material class. More...
 
class  Matrix3x3
 The \(3 \times 3\) matrix class. More...
 
class  Matrix4x4
 The \(4 \times 4\) matrix class. More...
 
class  Mesh
 The triangular 3D mesh class. More...
 
class  NormalColor
 A material that maps the mesh's normal vectors to normalized RGB colors. More...
 
class  Object3D
 The 3D object class. More...
 
class  OrthographicCamera
 The orthographic projection camera. More...
 
class  PerspectiveCamera
 The perspective projection camera. More...
 
class  Plane
 The geometry of a flat, depth-less plane. More...
 
class  PointLight
 The point light, which gets emitted from a single point in all directions. More...
 
class  Rasterizer
 The most basic renderer that renders your beautiful 3D scene. More...
 
class  RenderTarget
 
class  Scene
 The 3D scene class. More...
 
class  SolidColor
 A material that appears in one single color and is unaffected by lights. More...
 
class  Texture
 The 2D texture class. More...
 
struct  Uniforms
 The uniforms available to vertex shaders and fragment shaders. More...
 
class  UtahTeapot
 The geometry of the original Utah teapot, triangulated at 3488 triangles. More...
 
struct  Varyings
 The varyings available to fragment shaders. More...
 
class  Vector3
 The 3D vector class. More...
 
class  Vector4
 The 4D vector class. More...
 

Typedefs

using Group = Object3D
 An alias for Object3D.
 

Enumerations

enum class  EulerRotationOrder {
  Xyz , Xzy , Yxz , Yzx ,
  Zxy , Zyx
}
 The Euler rotation order. More...
 
enum class  TextureFormat { RgbDouble = 3 , Depth = 1 }
 The texture format. More...
 
enum class  FrontFace { Clockwise = 1 , CounterClockwise = -1 }
 The winding order that determines the front face of a triangle.
 
enum class  CullMode { None = 0 , Front = 1 , Back = -1 }
 Which faces to cull in the render. More...
 

Functions

std::vector< std::pair< int, int > > bresenhamLow (int x0, int y0, int x1, int y1)
 Used internally by bresenham.
 
std::vector< std::pair< int, int > > bresenhamHigh (int x0, int y0, int x1, int y1)
 Used internally by bresenham.
 
std::vector< std::pair< int, int > > bresenham (int x0, int y0, int x1, int y1)
 Computes and returns the points of a line using the Bresenham's line algorithm.
 
Vector3 barycentric (Vector3 point, Vector3 vertexA, Vector3 vertexB, Vector3 vertexC)
 Computes and returns the barycentric coordinates of a point in a triangle.
 

Detailed Description

The t software 3D graphics library namespace.

#include "t.hpp"
The t 3D graphics library header file.

Enumeration Type Documentation

◆ CullMode

enum class t::CullMode
strong

Which faces to cull in the render.

Enumerator
None 

Renders both front and back faces.

Front 

Culls front faces.

Back 

Culls back faces.

◆ EulerRotationOrder

enum class t::EulerRotationOrder
strong

The Euler rotation order.

For example, EulerRotationOrder::Xyz means that the x rotation is applied first, then y, then z.

◆ TextureFormat

enum class t::TextureFormat
strong

The texture format.

The integer associated with the format is the number of components in the texture. For example, TextureFormat::RgbDouble = 3 because it has 3 components (RGB).

Enumerator
RgbDouble 

Stores RGB values in normalized floating-point values.

Depth 

Stores the depth in normalized floating-point values.

Function Documentation

◆ barycentric()

Vector3 t::barycentric ( Vector3 point,
Vector3 vertexA,
Vector3 vertexB,
Vector3 vertexC )

Computes and returns the barycentric coordinates of a point in a triangle.

Parameters
pointThe point to compute the barycentric coordinates of.
vertexAThe first vertex of the triangle.
vertexBThe second vertex of the triangle.
vertexCThe third vertex of the triangle.
Returns
The barycentric coordinates of the point.

◆ bresenham()

std::vector< std::pair< int, int > > t::bresenham ( int x0,
int y0,
int x1,
int y1 )

Computes and returns the points of a line using the Bresenham's line algorithm.

This implementation of the algorithm only uses integer arithmetic. As such, the input coordinates are expected to be integers.

Parameters
x0The x-coordinate of the first point.
y0The y-coordinate of the first point.
x1The x-coordinate of the second point.
y1The y-coordinate of the second point.
Returns
The list of points returned by the Bresenham's line algorithm.