S3D_ROTATE(3)
β¨ S3D_ROTATE(3) β¨
okay bestie, welcome to the s3d manual, page three of the rotation saga π
this one lives in section 3 of the manual, and honestly? it's giving main character energy for a function that just spins stuff around.
π NAME π
s3d_rotate β rotate object π
πΈ SYNOPSIS πΈ
#include <s3d.h>
int s3d_rotate(int object, float x, float y, float z);
that's it. that's the whole vibe. three floats and an object, no cap π«Ά
π¦ DESCRIPTION π¦
So what does it do? It rotates an object around the x, y and z-axis respectively. The x, y, z values can be anywhere between [0,360] degrees. Slay.
Real talk though: you'll usually only rotate around one axis and just leave the unused fields chilling at 0, I guess. That's the norm, that's the move.
But if you wanna rotate around more than one axis at once, pay attention bestie, because the order matters and it's not negotiable: the order of the rotation applied is y-axis, then x-axis, and then z-axis. Periodt.
Here's the cute mental model the original author offers: think of it like earth position coordinates π
xis the longitudeyis the latitudezis the rotation at this point of the earth around your bodies axis
(and the author literally wrote "I wonder if that makes it any clearer ;)" and honestly? same, but we're rolling with it π)
β οΈ Warning β οΈ Rotate is absolute, not relative! This is the part where people get humbled, fr fr.
s3d_rotate(object, 90, 0, 0);
s3d_rotate(object, 180, 0, 0);
// object will be rotated 180 degrees around the x-axis, not 270 degress!
Likeβ¦ the second call doesn't add to the first one. It just sets it. 90 then 180 = 180, not 270. The math girlies are screaming but that's the rule π
π AUTHOR π
Simon Wunderlich Author of s3d π
and that's the whole page, bestie!! πβ¨ This was S3D_ROTATE(3) from the s3d manual β go forth and rotate responsibly, mwah π«Άπ
π¦ where this page comes from
- debian bookworm: s3d-doc 0.2.2.1-5 Β· GPL-2.0-or-later
- debian trixie: s3d-doc 0.2.2.1-7 Β· GPL-2.0-or-later
- ubuntu jammy: s3d-doc 0.2.2.1-3build1 Β· GPL-2.0-or-later
- ubuntu noble: s3d-doc 0.2.2.1-6build3 Β· GPL-2.0-or-later
- ubuntu questing: s3d-doc 0.2.2.1-7build1
- ubuntu resolute: s3d-doc 0.2.2.1-7build3 Β· GPL-2.0-or-later
- ubuntu stonking: s3d-doc 0.2.3-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms