vpRotate(3)
π vpRotate β spin that matrix, bestie π
okay so real talk, this is the vpRotate page from the VolPack library functions manual, and it's literally just "multiply the current transformation matrix by a rotation matrix." That's the whole vibe. Rotating. Iconic behavior honestly.
β¨ NAME β¨
vpRotate β multiply the current transformation matrix by a rotation matrix
π SYNOPSIS π
#include <volpack.h>
vpResult
vpRotate(vpc, axis, degrees)
vpContext *vpc;
int axis;
double degrees;
πΈ ARGUMENTS πΈ
vpcβ the VolPack context you got fromvpCreateContext. your whole setup, your main character.axisβ rotation axis code, and it has to be one ofVP_X_AXIS,VP_Y_AXISorVP_Z_AXIS. pick your lane πdegreesβ number of degrees to rotate. just adouble, go off.
π¦ DESCRIPTION π¦
vpRotate is what you call when you wanna multiply the current transformation matrix by a 4-by-4 rotation matrix. That's it. That's the job.
The rotation axis must be one of the three principal viewing axes, specified with one of these codes:
VP_X_AXISβ X axisVP_Y_AXISβ Y axisVP_Z_AXISβ Z axis
The rotation angle is specified in degrees. A positive angle means a clockwise rotation when you're looking towards the positive direction along the axis. yes bestie, clockwise, write that down.
For an X-axis rotation, the rotation matrix is:
1 0 0 0
0 cos(d) sin(d) 0
0 -sin(d) cos(d) 0
0 0 0 1
For a Y-axis rotation, the rotation matrix is:
cos(d) 0 -sin(d) 0
0 1 0 0
sin(d) 0 cos(d) 0
0 0 0 1
For a Z-axis rotation, the rotation matrix is:
cos(d) sin(d) 0 0
-sin(d) cos(d) 0 0
0 0 1 0
0 0 0 1
where d stands for the degrees argument. she's everywhere, she's doing the math, we love her π
Use vpCurrentMatrix to set the current transformation matrix. By default, the rotation matrix is post-multiplied β that's M = M*R, where M is the current matrix and R is the rotation matrix. And if you'd rather pre-multiply instead? the VP_CONCAT_MODE option to vpSeti lets you select that. options, options, options β¨
π STATE VARIABLES π
You can retrieve the current matrix concatenation parameters with these state variable codes (peep vpGeti(3)):
VP_CURRENT_MATRIXVP_CONCAT_MODE
π ERRORS π
The normal return value is VP_OK. but listen, the following error return value is possible:
VPERROR_BAD_OPTIONβ theaxisargument is invalid. like, you gave it something that isn't one of the three axis codes. not the vibe. π
π«Ά SEE ALSO π«Ά
VolPack(3), vpCreateContext(3), vpCurrentMatrix(3)
and that's the whole page bestie, no notes π
sign-off time: this little baddie lives in the VolPack library functions manual, and the page itself is stamped VolPack down at the bottom with vpRotate(3) hanging out on the right side. go rotate something. slay ππ
β¨
π¦ where this page comes from
- debian bookworm: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- debian trixie: libvolpack1-dev 1.0b3-10 Β· BSD-3-Clause
- ubuntu jammy: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- ubuntu noble: libvolpack1-dev 1.0b3-9.1 Β· BSD-3-Clause
- ubuntu questing: libvolpack1-dev 1.0b3-11
- ubuntu resolute: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- ubuntu stonking: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- Copyright (c) 1994 The Board of Trustees of The Leland Stanford
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms