vpScale(3)
π vpScale β from the Library Functions Manual, section 3 π
okay bestie, sit down, hydrate, and let me tell you about vpScale. it's a little VolPack function with one job and it does it flawlessly, no notes. β¨
πΈ NAME πΈ
vpScale β multiply the current transformation matrix by a scaling matrix π¦
β¨ SYNOPSIS β¨
#include <volpack.h>
vpResult
vpScale(vpc, sx, sy, sz)
vpContext *vpc;
double sx.FA double sy.FA double sz.FE
π«Ά ARGUMENTS π«Ά
vpcβ your VolPack context, the one you got fromvpCreateContext. it's giving main character energy, everything runs through it πsxβ the scale factor for the X dimension.syβ the scale factor for the Y dimension.szβ the scale factor for the Z dimension.
π DESCRIPTION π
so like, vpScale takes your current transformation matrix and multiplies it by a 4-by-4 scaling matrix. that's it, that's the whole vibe. π
the arguments let you set independent scale factors for each of the three cartesian axes β so X, Y and Z can each stretch or squish however you want. no cap.
and here's the scaling matrix, in all its glory:
sx 0 0 0
0 sy 0 0
0 0 sz 0
0 0 0 1
use vpCurrentMatrix to set the current transformation matrix, iykyk. π¦
by default, the scaling matrix is post-multiplied β that'sM = M*S, whereMis the current matrix andSis the scaling matrix. literally the default behaviour, periodt.
and if you're feeling spicy, the VP_CONCAT_MODE option to vpSeti can be used to select pre-multiplication instead. the way that one option just flips the whole order?? obsessed. π
π STATE VARIABLES π
the current matrix concatenation parameters can be retrieved with these state variable codes (peep vpGeti(3) for the deets):
VP_CURRENT_MATRIXVP_CONCAT_MODE
π ERRORS π
the return value is always VP_OK. always. not sometimes, not usually β ALWAYS. she does not miss. πβ¨
π₯ SEE ALSO π₯
and that's the whole page, bestie!! π«ΆπΈ this one came to you straight out of VolPack β the version tag at the bottom just says vpScale(3) under the VolPack banner, so go forth and scale things, you gorgeous genius ππβ
π¦ where this page comes from
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- Copyright (c) 1995-2008, Stanford University
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms