vpScale(3)

πŸ’– vpScale β€” the glow-up your matrix deserves πŸ’–

okay bestie, so this is a page from the VolPack Library Functions Manual, and today's main character is vpScale(3). sit down, grab a strawberry πŸ“, and let's talk about multiplying your current transformation matrix by a scaling matrix. no cap, it's giving math but make it cute.


✨ 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 β€” the VolPack context, the one you got from vpCreateContext. your whole vibe lives in here πŸ’…
  • sx β€” scale factor for the X dimension.
  • sy β€” scale factor for the Y dimension.
  • sz β€” scale factor for the Z dimension.

πŸ‘‘ DESCRIPTION πŸ‘‘

vpScale multiplies the current transformation matrix by a 4-by-4 scaling matrix. the arguments let you set independent scale factors for each of the three cartesian axes β€” so yes, you can stretch X, squash Y, and leave Z alone. it's your world 🌈

the scaling matrix is literally this:

 sx   0   0   0
  0  sy   0   0
  0   0  sz   0
  0   0   0   1

use vpCurrentMatrix to set the current transformation matrix. by default, the scaling matrix is post-multiplied, which means M = M*S where M is the current matrix and S is the scaling matrix. the VP_CONCAT_MODE option to vpSeti can be used to select pre-multiplication instead. options? we love options ✨


πŸ¦‹ 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

iykyk 🫢


πŸ’€ ERRORS πŸ’€

the return value is always VP_OK. yes bestie, always. no drama, no plot twist, not a single jump scare. iconic behaviour honestly.


πŸ”₯ SEE ALSO πŸ”₯


okay that's the whole page, periodt πŸ’œ this one came from VolPack and it's the vpScale(3) page β€” go forth and scale your little heart out. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from