---
name: "scene_polygon3d"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/scene_polygon3d"
---

# scene\_polygon3d(3alleg)

Puts a polygon in the scene rendering list. Allegro game programming library.

## NAME

scene\_polygon3d, scene\_polygon3d\_f - Puts a polygon in the scene rendering list. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**int scene\_polygon3d(int type, BITMAP \*texture, int vc, V3D \*vtx\[\]);**

**int scene\_polygon3d\_f(int type, BITMAP \*texture, int vc, V3D\_f \*vtx\[\]);**

## DESCRIPTION

Puts a polygon in the rendering list. Nothing is really rendered at this moment. Should be called between clear\_scene() and render\_scene().

Arguments are the same as for polygon3d(), except the bitmap is missing. The one passed to clear\_scene() will be used.

Unlike polygon3d(), the polygon may be concave or self-intersecting. Shapes that penetrate one another may look OK, but they are not really handled by this code.

Note that the texture is stored as a pointer only, and you should keep the actual bitmap around until render\_scene(), where it is used.

Since the FLAT style is implemented with the low-level hline() function, the FLAT style is subject to DRAW\_MODEs. All these modes are valid. Along with the polygon, this mode will be stored for the rendering moment, and also all the other related variables (color\_map pointer, pattern pointer, anchor, blender values).

The settings of the CPU\_MMX and CPU\_3DNOW flags of the cpu\_capabilities  global variable on entry in this routine affect the choice of low-level  asm routine that will be used by render\_scene() for this polygon.

## RETURN VALUE

Returns zero on success, or a negative number if it won't be rendered for lack of a rendering routine.

## SEE ALSO

[**create\_scene**(3alleg)](/create_scene/3alleg.md), [**clear\_scene**(3alleg)](/clear_scene/3alleg.md), [**render\_scene**(3alleg)](/render_scene/3alleg.md), [**destroy\_scene**(3alleg)](/destroy_scene/3alleg.md), [**polygon3d**(3alleg)](/polygon3d/3alleg.md), [**cpu\_capabilities**(3alleg)](/cpu_capabilities/3alleg.md), [**exscn3d**(3alleg)](/exscn3d/3alleg.md)
