Skip to content

Instantly share code, notes, and snippets.

@ibreathebsb
Last active May 9, 2025 04:43
Show Gist options
  • Save ibreathebsb/f768ae4ec301190b1bd7e46a1c81b0a0 to your computer and use it in GitHub Desktop.
Save ibreathebsb/f768ae4ec301190b1bd7e46a1c81b0a0 to your computer and use it in GitHub Desktop.
opengl cube map orientation
// new basis X Y Z to place the camera so that it's a left handed Y-UP Z-Forward system
const Eigen::Vector3f cubemapFaceDirections[6][3] = {
{{0, 0, 1}, {0, -1, 0}, {-1, 0, 0}}, // negx
{{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}, // posx
{{1, 0, 0}, {0, 0, -1}, {0, -1, 0}}, // negy
{{1, 0, 0}, {0, 0, 1}, {0, 1, 0}}, // posy
{{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}}, // negz
{{1, 0, 0}, {0, -1, 0}, {0, 0, 1}}, // posz
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment