flaw-visual-0.1.0.0

LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Flaw.Visual.Geometry.Basic

Description

 
Synopsis

Documentation

patchTopology :: (Vector v a, Vector v Int) => v a -> Int -> Int -> v a Source #

Permute and duplicate vertices to produce a patch.

planeVertices Source #

Arguments

:: (Vector v a, Vector v Int) 
=> (Float -> Float -> a)

Function producing vertex for specified coordinates (from 0 to 1).

-> Int

Width in cells (i.e. 1 for a simple quad).

-> Int

Height in cells (i.e. 1 for a simple quad).

-> v a 

Raw vertices for a plane.

sphereVertices Source #

Arguments

:: (Vector v a, Vector v Int) 
=> (Float -> Float -> a)

Function producing vertex for specified longitude (from 0 to pi * 2) and latitude (from -pi 2 to pi 2).

-> Int

Meridians count.

-> Int

Parallels half-count.

-> v a 

Raw vertices for a sphere. For 0th meridian it produces double vertices (with longitude = 0 and pi * 2), giving a chance for different vertices (for example, to use different texture coordinates).

twoHemispheresVertices Source #

Arguments

:: (Vector v a, Vector v Int) 
=> (Float -> Float -> a) 
-> Int

Meridians count.

-> Int

Top parallels count.

-> Int

Bottom parallels count.

-> v a 

Raw vertices for sphere with different number of parallels for top and bottom hemispheres.

openCylinderVertices Source #

Arguments

:: (Vector v a, Vector v Int) 
=> (Float -> Float -> a)

Function producing vertex for specified longitude (from 0 to pi * 2) and parallel (from 0 to 1).

-> Int

Meridians count.

-> Int

Parallels count.

-> v a 

Raw vertices for an open cylinder.