Skip to content

Instantly share code, notes, and snippets.

@seedzy
seedzy / AngleAxis3x3.hlsl
Created April 16, 2021 05:31 — forked from keijiro/AngleAxis3x3.hlsl
3x3 Rotation matrix with an angle and an arbitrary vector
// Rotation with angle (in radians) and axis
float3x3 AngleAxis3x3(float angle, float3 axis)
{
float c, s;
sincos(angle, s, c);
float t = 1 - c;
float x = axis.x;
float y = axis.y;
float z = axis.z;