vpGetMatrix(3)

πŸ’– vpGetMatrix(3) β€” Library Functions Manual πŸ’–

okay bestie, gather round, because today we're talking about vpGetMatrix from the VolPack library β€” she's a library function, she's iconic, and she's here to hand you a transformation matrix. no cap. πŸŽ€


✨ NAME ✨

vpGetMatrix β€” retrieve the contents of a transformation matrix. that's it, that's the whole job, and she does it flawlessly. πŸ’…


🌸 SYNOPSIS 🌸

#include <volpack.h>

vpResult
vpGetMatrix(vpc, matrix_code, matrix)
    vpContext *vpc;
    int matrix_code;
    vpMatrix4 matrix;

like, look at her. three little arguments and a dream. πŸ¦‹


🫢 ARGUMENTS 🫢

  • vpc β€” the VolPack context, aka the one you got from vpCreateContext. she needs her context, okay, she's not gonna work without it.
  • matrix_code β€” a code that says which VolPack transformation matrix you want. your options are VP_MODEL, VP_VIEW, VP_PROJECT or VP_SCREEN. pick one, queen.
  • matrix β€” the matrix where the result gets stored. this is the vessel. the moment. the destination. πŸ’œ

🌈 DESCRIPTION 🌈

so here's the tea: vpGetMatrix retrieves the contents of one of the transformation matrices (peep vpCurrentMatrix(3) for the full lore on those). it's giving "hey, show me what's in there" energy.

and then there's the special code β€” VP_SCREEN β€” and the way that one is different: it makes the function compute the transformation from object coordinates to image coordinates, and then return a matrix describing that transformation. so not just a fetch, a whole little computation moment. main character behavior, honestly. πŸ‘‘


πŸ’€ ERRORS πŸ’€

the normal return value is VP_OK. that's the good ending. but the following error return value is possible:

  • VPERROR_BAD_OPTION β€” the matrix_code argument is invalid. yeah. you gave her a code she doesn't recognize. not her fault, bestie. 😭

πŸ‘€ SEE ALSO πŸ‘€

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


and that's the whole page, no notes. this one came to you courtesy of VolPack β€” the manual itself is literally titled vpGetMatrix(3), so like, she's the whole moment. thanks for reading, ily, go get those matrices. πŸ“βœ¨πŸ’–

πŸ“¦ where this page comes from