vpTranslate(3)

πŸ“¦ version 1.0c7, in fedora 43, fedora 44

πŸ’– vpTranslate(3) β€” the multiply-your-matrix-by-a-translation-matrix era πŸ’–

okay bestie, so this is a page from the Library Functions Manual for VolPack, and today's main character is a little function called vpTranslate. it does exactly one thing and it does it gorgeously. let's get into it 🫢


✨ NAME ✨

vpTranslate β€” multiply the current transformation matrix by a translation matrix


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <volpack.h>

vpResult
vpTranslate(vpc, tx, ty, tz)
    vpContext *vpc;
    double *tx, *ty, *tz;

πŸŽ€ ARGUMENTS πŸŽ€

  • vpc β€” the VolPack context you got from vpCreateContext. it's the whole vibe, you need it.
  • tx β€” X component of translation vector.
  • ty β€” Y component of translation vector.
  • tz β€” Z component of translation vector.

🌸 DESCRIPTION 🌸

so what does vpTranslate actually do? it multiplies the current transformation matrix by a 4-by-4 translation matrix. that's it. that's the whole plot. and the translation matrix is literally this:

1   0   0  tx
0   1   0  ty
0   0   1  tz
0   0   0   1

use vpCurrentMatrix to set the current transformation matrix, bestie β€” that's your setup step. πŸ’…

and here's the tea: by default, the transformation matrix is post-multiplied (M = M*T where M is the current matrix and T is the translation matrix). if you wanna switch it up and go for pre-multiplication instead, the VP_CONCAT_MODE option to vpSeti is right there for you. choose your own adventure, no cap. πŸ”₯


⭐ STATE VARIABLES ⭐

the current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)):

  • VP_CURRENT_MATRIX
  • VP_CONCAT_MODE

go peek at them whenever, they're not hiding. πŸ‘‘


πŸ’€ ERRORS πŸ’€

the return value is always VP_OK. literally always. it cannot fail on you. this function has never once been in a situationship with an error code. iconic behaviour, honestly. ✨


🌈 SEE ALSO 🌈


ngl this one's a short read, but every detail in it is doing its job. no skipping. periodt. πŸ’–

this cutie pie of a man page ships with VolPack, and it's vpTranslate(3)'s very own page β€” that's the version and the vibe, all in one. stay slaying, bestie πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from