---
name: "GetMaterial"
section: "3"
platform: "linux"
package: "libvolpack1-dev"
version: "1.0b3-10"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/GetMaterial"
---

# GetMaterial(3)

get material properties

## 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*

  VolPack context from **vpCreateContext.**

- *material*

  A constant specifying a particular material number (VP\_MATERIAL0, VP\_MATERIAL1, ..., VP\_MATERIAL5).

- *property*

  A constant specifying one material property (VP\_AMBIENT, VP\_DIFFUSE, VP\_SPECULAR or VP\_SHINYNESS).

- *surface\_side*

  A constant specifying one side of the material surface (VP\_EXTERIOR or VP\_INTERIOR).

- *r\_ptr, g\_ptr, b\_ptr*

  Locations to store the RGB components of the color associated with the property.  For VP\_SHINYNESS, *g\_ptr* and *b\_ptr* are not used.

## DESCRIPTION

**vpGetMaterial** is used to get the properties of a material type. The arguments are exactly analogous to **vpSetMaterial** except that the *surface\_side* argument may not be VP\_BOTH\_SIDES, and the final three arguments are pointers to locations for storing the material properties.

## ERRORS

The normal return value is VP\_OK.  The following error return values are possible:

- VPERROR\_BAD\_VALUE

  The material number is invalid.

- VPERROR\_BAD\_OPTION

  Either the *surface\_side* or *property* arguments are invalid.

## SEE ALSO

[VolPack(3)](/VolPack/3.md), vpCreateContext(3), vpSetMaterial(3)
