vpScale(3)

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

πŸ’… 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 from vpCreateContext. 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's M = M*S, where M is the current matrix and S is 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_MATRIX
  • VP_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