vpTranslate(3)

πŸ’… vpTranslate(3) β€” the Library Functions Manual bestie edition ✨

okay so. this is vpTranslate from the VolPack library, and if you're here it's because you want your 3D stuff to move and honestly? iconic. let's get into it πŸ¦‹


🌸 NAME 🌸

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

like... you're sliding your whole vibe over by tx, ty, tz. that's the whole thing. slay.


✨ SYNOPSIS ✨

#include <volpack.h>

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

πŸŽ€ ARGUMENTS πŸŽ€

  • vpc β€” your VolPack context, the one you got from vpCreateContext. your main character, basically.
  • tx β€” the X component of the translation vector.
  • ty β€” the Y component of the translation vector.
  • tz β€” the Z component of the translation vector.

πŸ’– DESCRIPTION πŸ’–

so vpTranslate multiplies the current transformation matrix by a 4-by-4 translation matrix. no cap, that's it. the translation matrix is giving:

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

use vpCurrentMatrix to set the current transformation matrix β€” that's how you decide which matrix is the matrix, yk?

by default, the transformation matrix is post-multiplied (M = M*T where M is the current matrix and T is the translation matrix). and if you'd rather pre-multiply? the VP_CONCAT_MODE option to vpSeti can be used to select pre-multiplication. your math, your rules πŸ’…


🫢 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.


😭 ERRORS 😭

the return value is always VP_OK. like. it cannot fail. it woke up and chose success. periodt.


πŸ”₯ SEE ALSO πŸ”₯

VolPack(3), vpCreateContext(3), vpCurrentMatrix(3)


and that's the tea bestie πŸ“ go forth and translate. this page came to you from the VolPack manual β€” version vpTranslate(3) β€” mwah, love that for you πŸ’œ

πŸ“¦ where this page comes from