vpCurrentMatrix(3)
β¨ vpCurrentMatrix β¨ β it's giving "pick your matrix, bestie"
okay so real quick, this is a page from the Library Functions Manual, and the star of the show is vpCurrentMatrix(3). buckle up π
πΈ NAME πΈ
vpCurrentMatrix β choose the current transformation matrix
π SYNOPSIS π
#include <volpack.h>
vpResult
vpCurrentMatrix(vpc, option)
vpContext *vpc;
int option;
π¦ ARGUMENTS π¦
vpcβ the VolPack context, which you get fromvpCreateContext. she's your girl, your whole world, your context πoptionβ a code that says which of the VolPack transformation matrices we're talking about. your choices areVP_MODEL,VP_VIEWorVP_PROJECT. pick one, bestie, you got this.
π DESCRIPTION π
vpCurrentMatrix is literally just here to choose the current transformation matrix. that's the whole job. iconic behaviour, honestly.
the option parameter has to be one of these three:
VP_MODELβ the modeling transformationVP_VIEWβ the viewing transformation- **`VP_PROJECT`` β the projection transformation
and after you call this, all the matrix transformation functions you hit up next β vpIdentityMatrix, vpTranslate, vpRotate, vpScale, vpMultMatrix and vpSetMatrix β get applied to whichever matrix is now the current one. no cap. β¨
π§ the modeling transformation (VP_MODEL)
typically you use the modeling transformation to specify a transformation from object coordinates to world coordinates. and in object coordinates, the volume data is chillin' inside a unit cube centered at the origin β corners at (-0.5, -0.5, -0.5) and (0.5, 0.5, 0.5). π§
the default modeling transformation is the identity, so at first the volume is sitting inside the unit cube in world coordinates too. also, by default, the current matrix is VP_MODEL. and heads up: the modeling transformation is also applied to light direction vectors (peep vpSetLight(3)) π
π¦ the viewing transformation (VP_VIEW)
the viewing transformation is the one that takes world coordinates and turns them into eye coordinates. in eye coordinates, the viewer is looking down the Z axis in the negative direction. π
the default value of this matrix is also the identity, so the viewer is looking down the Z axis in world coordinates as well. wild, right? typically you'd use this transformation matrix to specify the location and direction of the viewer.
and listen β it's also possible to combine the modeling and viewing matrices (like in the OpenGL viewing model). in that case you can store the composite transformation in either the model or the view matrix, and set the other matrix to the identity. your call, main character π
π the projection transformation (VP_PROJECT)
the projection transformation specifies the transformation from eye coordinates to clip coordinates. in the clip coordinate system, the entire viewing frustum lies inside a cube defined by the planes X=1, X=-1, Y=1, Y=-1, Z=1 and Z=-1. π¦
this transformation also specifies the type of projection used to produce a 2D image. the 2D image is computed by projecting along the Z axis in the clip coordinate system, and then scaling in the X and Y dimensions to the final image size.
and if you need help computing projection transformations? the routines vpWindow and vpWindowPHIGS are useful for that. slay. π₯
π STATE VARIABLES π
you can retrieve the current transformation matrix code with the following state variable code (see vpGeti(3)): VP_CURRENT_MATRIX. yes bestie, go get her π«Ά
π ERRORS π
the normal return value is VP_OK. love that for us.
but the following error return value is possible:
VPERROR_BAD_OPTIONβ theoptionargument is invalid. π (we've all been there, no judgement)
π SEE ALSO π
VolPack(3), vpCreateContext(3), vpGetMatrix(3)
okay that's the whole page, go forth and transform your matrices π¦β¨
this masterpiece came to you courtesy of VolPack, in all her vpCurrentMatrix(3) glory β stay iconic, stay transformed, mwah πππΈ
π¦ where this page comes from
- debian bookworm: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- debian trixie: libvolpack1-dev 1.0b3-10 Β· BSD-3-Clause
- ubuntu jammy: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- ubuntu noble: libvolpack1-dev 1.0b3-9.1 Β· BSD-3-Clause
- ubuntu questing: libvolpack1-dev 1.0b3-11
- ubuntu resolute: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- ubuntu stonking: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- Copyright (c) 1994 The Board of Trustees of The Leland Stanford
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms