---
name: "triangle3d"
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/triangle3d"
---

# triangle3d(3alleg)

Draws a 3d triangle onto the specified bitmap. Allegro game programming library.

## NAME

triangle3d, triangle3d\_f - Draws a 3d triangle onto the specified bitmap. Allegro game programming library.

## SYNOPSIS

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

**void triangle3d(BITMAP \*bmp, int type, BITMAP \*tex, V3D \*v1, \*v2, \*v3);**

**void triangle3d\_f(BITMAP \*bmp, int type, BITMAP \*tex, V3D\_f \*v1, \*v2, \*v3);**

## DESCRIPTION

Draw 3d triangles, using either fixed or floating point vertex structures. Unlike quad3d\[\_f\](), triangle3d\[\_f\]() functions are not wrappers of polygon3d\[\_f\](). The triangle3d\[\_f\]() functions use their own routines taking into account the constantness of the gradients. Therefore triangle3d\[\_f\](bmp, type, tex, v1, v2, v3) is faster than polygon3d\[\_f\](bmp, type, tex, 3, v\[\]).

Read the beginning of chapter "Polygon rendering" for a list of rendering types you can use with this function.

## SEE ALSO

[**polygon3d**(3alleg)](/polygon3d/3alleg.md), [**quad3d**(3alleg)](/quad3d/3alleg.md), [**triangle**(3alleg)](/triangle/3alleg.md)
