brick-3d-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Brick3D.Rasterization

Synopsis

Documentation

type PixelAttr = (Char, Attr) Source #

Represents one Pixel

mergeAttr :: Map (Int, Int) (Float, PixelAttr) -> Map (Int, Int) (Float, PixelAttr) -> Map (Int, Int) (Float, PixelAttr) Source #

Merge two Map of Pixels into one by comparing zBuffer

toCanvasPixels :: Map (Int, Int) (Char, Attr) -> [((Int, Int), Char, Attr)] Source #

Convert Map to list so that canvasSetMany can treat

rasterizeMany :: (Foldable t, Functor t) => (Int, Int) -> t DCPrimitive -> [((Int, Int), Char, Attr)] Source #

Rasterize many of DCPrimitives

rasterizeLine :: SCVertex -> SCVertex -> Vector SCVertex Source #

DCVertexs which constructs line begin at begin and end at end

JP: 与えられた beginend を両端に持つ線分を構成する DCVertex を返します

fillTriangle :: SCVertex -> SCVertex -> SCVertex -> Vector SCVertex Source #

Returns DCVertexs that constructs one filled-triangle

Note that depth of those DCVertexs are not calculated properly. Currently it inherits depth of v1 I want to fix this later.

isInsideOfTri :: SCPosition -> (SCPosition, SCPosition, SCPosition) -> Bool Source #

True if given coordinate is within given Triangle

It doesn't care if the triangle is formed well. (e.g. one vertex is on the line made of other two vertex, two of them are the same.) This is because projection could

JP: この関数は「三角形がきちんと三角形であるか」を考慮しません。 (例えば: 頂点が一直線上に並んでしまっている, 複数の頂点が同じ位置にあるなど)