---
name: "s3d_push_polygons"
section: "3"
platform: "linux"
package: "s3d-doc"
version: "0.2.2.1-7"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/s3d_push_polygons"
---

# s3d\_push\_polygons(3)

push many polygons

## NAME

s3d\_push\_polygons - push many polygons

## SYNOPSIS

```
#include <s3d.h>
```

**int s3d\_push\_polygons(int** *object***, const uint32\_t \****pbuf***, uint16\_t** *n***);**

## DESCRIPTION

As for vertices, you can push arrays of polygons to have greater performance. The pbuf should contain n polygons which consist of 4 uint32\_t values of 3 vertices indices and 1 material index.

```
 uint32_t pbuf[] = { 0, 1, 2, 0};
 int oid = s3d_new_object();   // create a new object
 s3d_push_vertex(oid, 0.0, 0.0, 0.0);
 s3d_push_vertex(oid, 0.0, 1.0, 0.0);
 s3d_push_vertex(oid, 1.0, 0.0, 0.0);
 s3d_push_material(oid, 0.3, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0);
 s3d_push_polygons(oid, pbuf, 1);
 // push one polygon with the pbuf data
```

## AUTHOR

**Simon Wunderlich**

Author of s3d
