vpGetMaterial(3)
π vpGetMaterial(3) π
okay so bestie, welcome to the Library Functions Manual page for vpGetMaterial β yes she's a section 3 girlie, we love that for her π
β¨ NAME β¨
vpGetMaterial β get material properties π
πΈ SYNOPSIS πΈ
#include <volpack.h>
vpResult
vpGetMaterial(vpc, material, property, surface_side, r_ptr, g_ptr,
b_ptr)
vpContext *vpc;
int material;
int property;
int surface_side;
double *r_ptr, *g_ptr, *b_ptr;
π¦ ARGUMENTS π¦
vpcβ the VolPack context you got fromvpCreateContext. ur main character, fr fr π«Άmaterialβ a constant that says which material number we're talking about:VP_MATERIAL0,VP_MATERIAL1, ..., all the way up toVP_MATERIAL5. pick ur fave πpropertyβ a constant naming exactly one material property:VP_AMBIENT,VP_DIFFUSE,VP_SPECULARorVP_SHINYNESS. one (1) property only, no greedy behaviour πsurface_sideβ a constant picking one side of the material surface:VP_EXTERIORorVP_INTERIOR. (yes only one side, we'll get to that π)r_ptr,g_ptr,b_ptrβ the locations where we store the RGB components of the color that goes with the property. and lowkey important: forVP_SHINYNESS,g_ptrandb_ptrare not used. like at all. they're just vibing there unused π
π DESCRIPTION π
So vpGetMaterial is the function you call when you wanna get the properties of a material type. It's the read-only bestie to vpSetMaterial's write energy β¨
The arguments are exactly analogous to vpSetMaterial β same shape, same vibes β with two lil twists that you need to clock:
- the
surface_sideargument may not beVP_BOTH_SIDES. nope. not allowed. pick a side, bestie, we're not doing both π€ - the final three arguments are pointers to locations where the material properties get stored. so it's writing into ur variables, not reading out of them π₯
no cap: this is a getter, so those pointers are where the answers land. make sure they point somewhere real π
π ERRORS π
the normal return value is VP_OK. that's the slay, the ate, the iconic outcome π
but if things go sideways, here are the error return values that are possible:
VPERROR_BAD_VALUEβ the material number is invalid. like, that material does not exist, bestie, stop it πVPERROR_BAD_OPTIONβ either thesurface_sideorpropertyarguments are invalid. one of them is giving nonsense and we're not here for it π
π§ SEE ALSO π§
and that's the whole page, periodt π β¨
this one ships with VolPack (that's the source/version energy at the bottom of the original page) and it's filed under vpGetMaterial(3) β so go forth, grab ur material properties, and stay iconic πππΈπ¦π
π¦ 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