OpenGL-3.0.3.0: A binding for the OpenGL graphics system

Copyright(c) Sven Panne 2002-2019
LicenseBSD3
MaintainerSven Panne <svenpanne@gmail.com>
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.OpenGL.GLU.Tessellation

Contents

Description

This module corresponds to chapter 5 (Polygon Tessellation) of the GLU specs.

Synopsis

Polygon description

data AnnotatedVertex v Source #

The basic building block in tessellation is a 3D vertex with an associated property, e.g. color, texture coordinates, etc.

Constructors

AnnotatedVertex (Vertex3 GLdouble) v 

newtype ComplexContour v Source #

A complex contour, which can be self-intersecting and/or concave.

newtype ComplexPolygon v Source #

A complex (possibly concave) polygon, represented by one or more complex and possibly intersecting contours.

Constructors

ComplexPolygon [ComplexContour v] 

Combining vertices

type Combiner v = Vertex3 GLdouble -> WeightedProperties v -> v Source #

A function combining given vertex properties into a property for a newly generated vertex

Tessellation parameters

type Tolerance = GLdouble Source #

The relative tolerance under which two vertices can be combined (see Combiner). Multiplication with the largest coordinate magnitude of all polygon vertices yields the maximum distance between two mergeable vertices.

Note that merging is optional and the tolerance is only a hint.

Tessellator type

type Tessellator p v = TessWinding -> Tolerance -> Normal3 GLdouble -> Combiner v -> ComplexPolygon v -> IO (p v) Source #

A general tessellator type.

Before tessellation of a complex polygon, all its vertices are projected into a plane perpendicular to the given normal. If the given normal is Normal3 0 0 0, a fitting plane of all vertices is used.

Contour extraction

newtype PolygonContours v Source #

The contours of a complex polygon, represented by one or more non-intersecting simple contours

Constructors

PolygonContours [SimpleContour v] 

Triangulation

type TriangleVertex v = AnnotatedVertex (v, EdgeFlag) Source #

A triangle vertex with additional information about the edge it begins

data Triangle v Source #

A triangle, represented by three triangle vertices

Instances
Eq v => Eq (Triangle v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: Triangle v -> Triangle v -> Bool #

(/=) :: Triangle v -> Triangle v -> Bool #

Ord v => Ord (Triangle v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

compare :: Triangle v -> Triangle v -> Ordering #

(<) :: Triangle v -> Triangle v -> Bool #

(<=) :: Triangle v -> Triangle v -> Bool #

(>) :: Triangle v -> Triangle v -> Bool #

(>=) :: Triangle v -> Triangle v -> Bool #

max :: Triangle v -> Triangle v -> Triangle v #

min :: Triangle v -> Triangle v -> Triangle v #

Tessellation into primitives

data Primitive v Source #

Instances
Eq v => Eq (Primitive v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: Primitive v -> Primitive v -> Bool #

(/=) :: Primitive v -> Primitive v -> Bool #

Ord v => Ord (Primitive v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation