Skip to content

Instantly share code, notes, and snippets.

@kaorun55
Created April 18, 2016 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaorun55/9d204509dc181c403891d1cf2110ac61 to your computer and use it in GitHub Desktop.
Save kaorun55/9d204509dc181c403891d1cf2110ac61 to your computer and use it in GitHub Desktop.
Eigen::Vector3f floor(floorClip.x, floorClip.y, floorClip.z);
Eigen::Quaternionf rotate = Eigen::Quaternionf::FromTwoVectors(floor, Eigen::Vector3f::UnitY());
Eigen::Translation<float, 3> translation(0, floorClip.w, 0);
Eigen::DiagonalMatrix<float, 3> scaling = Eigen::Scaling(1.0f, 1.0f, 1.0f);;
floorMatrix = translation * scaling * rotate;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment