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