vpSetVolumeSize(3)

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

ok so bestie, welcome to the manual page for vpSetVolumeSize, straight out of the VolPack library functions manual. she's a little function with one job and she does it flawlessly. let's get into it πŸŽ€


✨ NAME ✨

vpSetVolumeSize β€” define the dimensions of a volume. that's it, that's the whole vibe. she sizes your volume. iconic behavior honestly πŸ’…


🌸 SYNOPSIS 🌸

#include <volpack.h>

vpResult
vpSetVolumeSize(vpc, xlen, ylen, zlen)
    vpContext *vpc;
    int xlen, ylen, zlen;

look at her. four args, returns a vpResult, includes <volpack.h>. no notes, she's perfect πŸ¦‹


🫢 ARGUMENTS 🫢

  • vpc β€” the VolPack context, and you get it from vpCreateContext. she needs her context bestie, don't leave home without it πŸ’œ
  • xlen β€” size of the first dimension of the volume, measured in voxels. voxels. say it with me. voxels ✨
  • ylen β€” size of the second dimension of the volume, in voxels.
  • zlen β€” size of the third dimension of the volume, in voxels. yes three of them. it's giving 3D. it's giving main character energy πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

okay so vpSetVolumeSize is the one you call to define the dimensions of a volume. that's her whole thing. she shows up, she sets the size, she leaves.

the important part though β€” and I cannot stress this enough β€” she must be called before volume data gets loaded into a rendering context. like, before. not after. if you do it in the wrong order, that's a you problem and the volume data is not gonna have a good time 😭

and one more thing, no cap: any existing precomputed volume data structures in the context get destroyed by this call. gone. deleted. they simply cease to exist. so if you had precious precomputed data in there, bestie, that's on you πŸ’€

fr fr, call this first, then load. do not load, then call. the ordering is the whole plot.

🌈 STATE VARIABLES 🌈

you can pull the current volume dimensions back out with these state variable codes β€” just pass them to vpGeti(3), iykyk:

  • VP_XLEN
  • VP_YLEN
  • VP_ZLEN

three codes for three dimensions. symmetry, we love to see it 🌸


πŸŽ€ ERRORS πŸŽ€

the return value is always VP_OK. always. every single time. she never fails you. not once. not ever. lowkey the most reliable function in the whole library πŸ₯Ή


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie πŸ’–

this one came to you from the VolPack crew β€” that's the source and version stamped on her, and the date line too, all wrapped up in this cute little sign-off instead of the boring footer. go forth and set those volume sizes. periodt. βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from