---
name: "s3d_push_polygon"
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_polygon"
---

# s3d\_push\_polygon(3)

push polygon

## NAME

s3d\_push\_polygon - push polygon

## SYNOPSIS

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

**int s3d\_push\_polygon(int** *object***, uint32\_t** *v1***, uint32\_t** *v2***, uint32\_t** *v3***, uint32\_t** *material***);**

## DESCRIPTION

Push one polygon on the polygon stack of the object. It takes 3 vertex-index numbers and one material material-index-no. as argument.

```
 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_polygon(oid, 0, 1, 2, 0);
 // this will create a red polygon
```

## AUTHOR

**Simon Wunderlich**

Author of s3d
