Some doc. fixes
This commit is contained in:
parent
e1db8d11ad
commit
7c2fcd4ad9
2 changed files with 13 additions and 11 deletions
|
|
@ -14,6 +14,7 @@ import strutils
|
||||||
## Basic 2d support with vectors, points, matrices and some basic utilities.
|
## Basic 2d support with vectors, points, matrices and some basic utilities.
|
||||||
## Vectors are implemented as direction vectors, ie. when transformed with a matrix
|
## Vectors are implemented as direction vectors, ie. when transformed with a matrix
|
||||||
## the translation part of matrix is ignored.
|
## the translation part of matrix is ignored.
|
||||||
|
## Operators `+` , `-` , `*` , `/` , `+=` , `-=` , `*=` and `/=` are implemented for vectors and scalars.
|
||||||
##
|
##
|
||||||
## Quick start example:
|
## Quick start example:
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ import times
|
||||||
## Vectors are implemented as direction vectors, ie. when transformed with a matrix
|
## Vectors are implemented as direction vectors, ie. when transformed with a matrix
|
||||||
## the translation part of matrix is ignored. The coordinate system used is
|
## the translation part of matrix is ignored. The coordinate system used is
|
||||||
## right handed, because its compatible with 2d coordinate system (rotation around
|
## right handed, because its compatible with 2d coordinate system (rotation around
|
||||||
## zaxis equals 2d rotation)
|
## zaxis equals 2d rotation).
|
||||||
|
## Operators `+` , `-` , `*` , `/` , `+=` , `-=` , `*=` and `/=` are implemented for vectors and scalars.
|
||||||
##
|
##
|
||||||
##
|
##
|
||||||
## Quick start example:
|
## Quick start example:
|
||||||
|
|
@ -66,9 +67,9 @@ type
|
||||||
# Some forward declarations
|
# Some forward declarations
|
||||||
proc matrix3d*(ax,ay,az,aw,bx,by,bz,bw,cx,cy,cz,cw,tx,ty,tz,tw:float):TMatrix3d {.noInit.}
|
proc matrix3d*(ax,ay,az,aw,bx,by,bz,bw,cx,cy,cz,cw,tx,ty,tz,tw:float):TMatrix3d {.noInit.}
|
||||||
## Creates a new 4x4 3d transformation matrix.
|
## Creates a new 4x4 3d transformation matrix.
|
||||||
## `ax`,`ay`,`az` is the local x axis
|
## `ax` , `ay` , `az` is the local x axis.
|
||||||
## `bx`,`by`,`bz` is the local y axis
|
## `bx` , `by` , `bz` is the local y axis.
|
||||||
## `tx`,`ty`,`tz` is the translation
|
## `tx` , `ty` , `tz` is the translation.
|
||||||
proc vector3d*(x,y,z:float):TVector3d {.noInit,inline.}
|
proc vector3d*(x,y,z:float):TVector3d {.noInit,inline.}
|
||||||
## Returns a new 3d vector (`x`,`y`,`z`)
|
## Returns a new 3d vector (`x`,`y`,`z`)
|
||||||
proc point3d*(x,y,z:float):TPoint3d {.noInit,inline.}
|
proc point3d*(x,y,z:float):TPoint3d {.noInit,inline.}
|
||||||
|
|
@ -185,12 +186,12 @@ proc scale*(s:float,org:TPoint3d):TMatrix3d {.noInit.} =
|
||||||
|
|
||||||
proc stretch*(sx,sy,sz:float):TMatrix3d {.noInit.} =
|
proc stretch*(sx,sy,sz:float):TMatrix3d {.noInit.} =
|
||||||
## Returns new a stretch matrix, which is a
|
## Returns new a stretch matrix, which is a
|
||||||
## scale matrix with non uniform scale in x and y.
|
## scale matrix with non uniform scale in x,y and z.
|
||||||
result.setElements(sx,0,0,0, 0,sy,0,0, 0,0,sz,0, 0,0,0,1)
|
result.setElements(sx,0,0,0, 0,sy,0,0, 0,0,sz,0, 0,0,0,1)
|
||||||
|
|
||||||
proc stretch*(sx,sy,sz:float,org:TPoint3d):TMatrix3d {.noInit.} =
|
proc stretch*(sx,sy,sz:float,org:TPoint3d):TMatrix3d {.noInit.} =
|
||||||
## Returns a new stretch matrix, which is a
|
## Returns a new stretch matrix, which is a
|
||||||
## scale matrix with non uniform scale in x and y.
|
## scale matrix with non uniform scale in x,y and z.
|
||||||
## `org` is used as stretch origin.
|
## `org` is used as stretch origin.
|
||||||
result.setElements(sx,0,0,0, 0,sy,0,0, 0,0,sz,0, org.x-sx*org.x,org.y-sy*org.y,org.z-sz*org.z,1)
|
result.setElements(sx,0,0,0, 0,sy,0,0, 0,0,sz,0, org.x-sx*org.x,org.y-sy*org.y,org.z-sz*org.z,1)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue