S3d - Simple 3D Graphic Library
- v1.2.3 (16/AUG/2013)
- Tested on: Windows XP SP3
AutoIt v3.3.8.1, v3.3.9.17
- Requires GDIPlus.au3
Below is a complete list of the user defined functions available in S3d.
When using them you need to add a #include <S3d.au3>.
* This reference has yet to be completed.
_S3d_Arrow($nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2 [, $nLen = 30 [, $nAngle = 0.6 ]])
| $nX1, $nY1, $nZ1 | The coordinates of the starting point of the arrow |
| $nX2, $nY2, $nZ2 | The coordinates of the ending point of the arrow |
| $nLen | (Optional) The length of the arrow cap |
| $nAngle | (Optional) The width of the arrow cap in radians |
Success: 1
Failure: 0, @error = 1
This function failes if both of the two points are behind the camera.
_S3d_Box($nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2)
| $nX1, $nY1, $nZ1 | The coordinates of the starting point |
| $nX2, $nY2, $nZ2 | The coordinates of the ending point |
None.
_S3d_Circle($nX, $nY, $nZ, $nRad [, $fFill = False])
| $nX, $nY, $nZ | The coordinates of the center point of the circle |
| $nRad | Radius |
| $fFill | (Optional) If true, the circle is filled |
Success: 1
Failure: 0
@error = 0 : _GDIPlus_GraphicsFillEllipse or _GDIPlus_GraphicsDrawEllipse failed
@error = 1 : $nRad is negative or zero
@error = 2 : The center point of the circle is behind the camera
_S3d_Clear($nColor = 0xFF000000)
| $nColor | (Optional) Alpha, Red, Green and Blue components of color |
Success: True
Failure: False
_S3d_Dist([$nPos1X = 0 [, $nPos1Y = 0 [, $nPos1Z = 0 [, $nPos2X = 0 [, $nPos2Y = 0 [, $nPos2Z = 0 ]]]]]])
| $nPos1X | (Optional) The X coordinate of the point 1 |
| $nPos1Y | (Optional) The Y coordinate of the point 1 |
| $nPos1Z | (Optional) The Z coordinate of the point 2 |
| $nPos2X | (Optional) The X coordinate of the point 2 |
| $nPos2Y | (Optional) The Y coordinate of the point 2 |
| $nPos2Z | (Optional) The Z coordinate of the point 2 |
Calculated distance betwenn two points
_S3d_DistFromCamera([$nPosX = 0 [, $nPosY = 0 [, $nPosZ = 0 ]]])
| $nPosX | (Optional) The X coordinate of a specified point |
| $nPosY | (Optional) The Y coordinate of a specified point |
| $nPosZ | (Optional) The Z coordinate of a specified point |
Calculated distance betwenn the camera and a specified point
_S3d_GetLocalMatrix()
None.
Local matrix (2 dimensional array)
_S3d_GetPos($nX, $nY, $nZ)
| $nX, $nY, $nZ | 3D coordinates of a point |
Success: Returns a two-element array containing the 2D coordinates ([0] = X, [1] = Y)
Failure: 0, @error = 1
This function fails if the specified point is behind the camera.
_S3d_Line($nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2)
| $nX1, $nY1, $nZ1 | The coordinates of the starting point of the line |
| $nX2, $nY2, $nZ2 | The coordinates of the ending point of the line |
Success: True
Failure: 0, @error = 0 when _GDIPlus_GraphicsDrawLine failed; 1 when the line is behind the camera.
This function failes if both of the two points are behind the camera.
_S3d_LineTo($nX, $nY, $nZ)
| $nX, $nY, $nZ | The coordinates of the ending point of the line |
Success: 1
Failure: 0, @error = 1
If this function succeeds, the current position is set to the specified ending point. This function failes if the specified point is behind the camera.
_S3d_LocalRotateX($nAngle [, $fDeg = False])
| $nAngle | The angle of rotation along the X axis |
| $fDeg | (Optional) Degree flag, see remarks |
None.
$nAngle is radians if $fDeg is false, degrees if true.
_S3d_LocalRotateY($nAngle [, $fDeg = False])
| $nAngle | The angle of rotation along the Y axis |
| $fDeg | (Optional) Degree flag, see remarks |
None.
$nAngle is radians if $fDeg is false, degrees if true.
_S3d_LocalRotateZ($nAngle [, $fDeg = False])
| $nAngle | The angle of rotation along the Z axis |
| $fDeg | (Optional) Degree flag, see remarks |
None.
$nAngle is radians if $fDeg is false, degrees if true.
_S3d_LocalScale($nX, $nY, $nZ)
| $nX, $nY, $nZ | Scale values |
None.
_S3d_LocalTranslate($nX, $nY, $nZ)
| $nX, $nY, $nZ | The amount of a translation |
None.
_S3d_MoveTo($nX, $nY [, $nZ = Default])
| $nX, $nY, $nZ | New current position. see remarks |
Success: 1
Failure: 0, @error = 1
If $nZ is omitted, $nX and $nY the current position is ($nX, $nY). If $nZ is specified, this function converts ($nX, $nY, $nZ) into 2D and sets the current position.
This function fails if the specified point is behind the camera.
_S3d_MoveTo2($nXL, $nYL, $nZL, $nXR, $nYR, $nZR)
| $nXL, $nYL, $nZL, $nXR, $nYR, $nZR | The coordinates of the new current positions |
Success: 1
Failure: 0, @error = 1 if ($nXL, $nYL, $nZL) is behind the camera; 2 if ($nXR, $nYR, $nZR) is.
This function is a plane version of _S3d_MoveTo. This function failes if either of the specified point is behind the camera.
_S3d_MultiplyLocalMatrix([$n00 = 1 [, $n01 = 0 [, $n02 = 0 [, $n03 = 0 [, $n10 = 0 [, $n11 = 1 [, $n12 = 0 [, $n13 = 0 [, $n20 = 0 [, $n21 = 0 [, $n22 = 1 [, $n23 = 0 [, $n30 = 0 [, $n31 = 0 [, $n32 = 0 [, $n33 = 1]]]]]]]]]]]]]]]])
| $n00 - $n33 | (Optional) Values for a matrix that the Local Matrix is multiplied by |
None.
_S3d_Polygon($aPoints [, $fFill = False])
| $aPoints | Array that specify the vertices of the polygon, see remarks |
| $fFill | (Optional) If true, the polygon is filled |
Success: 1
Failure: 0
@error = 0 : _GDIPlus_GraphicsFillPolygon or _GDIPlus_GraphicsDrawPolygon failed
@error = 1 : $aPoints is not an array
@error = 2 : Failed to convert the coordinates of $aPoints[@extended][0] - $aPoints[@extended][2]
$aPoints must be in the following format:
$aPoints[0][0] : The number of points
$aPoints[n][0] : nth X
$aPoints[n][1] : nth Y
$aPoints[n][2] : nth Z
_S3d_RegPolygon($nX, $nY, $nZ, $nRad, $iNum [, $fFill = True])
| $nX, $nY, $nZ | The coordinates of the center point of the regular polygon |
| $nRad | Radius |
| $iNum | The number of the vertices |
| $fFill | (Optional) If true, the regular polygon is filled |
Success: 1
Failure: 0
This function draws or fills a regular polygon on the XY plane when called without changing the local matrix.
_S3d_RibbonTo($nXL, $nYL, $nZL, $nXR, $nYR, $nZR)
| $nXL, $nYL, $nZL, $nXR, $nYR, $nZR | The coordinates of the new positions |
Success: 1
Failure: 0, @error = 1 if ($nXL, $nYL, $nZL) is behind the camera; 2 if ($nXR, $nYR, $nZR) is.
This function is a plane version of _S3d_LineTo.
If this function succeeds, the current positions are set to the specified points. This function failes if either of the specified point is behind the camera.
_S3d_SelectBrush($hBrush)
| $hPen | Brush object to work with |
None.
_S3d_SelectFont($hFont)
| $hFont | Font object to work with |
None.
_S3d_SelectFormat($hFormat)
| $hFormat | String Format object to work with |
None.
_S3d_SelectGraphic($hGraphic, $iWidth, $iHeight, [$iSmooth = 2])
| $hGraphic | Graphics object to work with |
| $iWidth | Width in pixels |
| $iHeight | Height in pixels |
| $iSmooth | (Optional) Smoothing mode |
None.
_S3d_SelectPen($hPen)
| $hPen | Pen object to work with |
None.
_S3d_SetCamera($nCameraX, $nCameraY, $nCameraZ, $nTargetX, $nTargetY, $nTargetZ, [$nVAngle = 0 [, $nFAngle = 0.8 [, $nFScale = 1000 ]]])
| $nCameraX | The X coordinate of the camera |
| $nCameraY | The Y coordinate of the camera |
| $nCameraZ | The Z coordinate of the camera |
| $nTargetX | The X coordinate of the point that the camera looks at |
| $nTargetY | The Y coordinate of the point that the camera looks at |
| $nTargetZ | The Z coordinate of the point that the camera looks at |
| $nVAngle | (Optional) The angle between the camera top and the screen top |
| $nFAngle | (Optional) The view angle |
| $nFScale | (Optional) The base scale value (global) |
None.
_S3d_SetCameraEx($nCameraX, $nCameraY, $nCameraZ, [$nXYAngle = 0 [, $nXZAngle = 0 [, $nVAngle = 0 [, $nFAngle = 0.8 [, $nFScale = 1000 ]]]]])
| $nCameraX | The X coordinate of the camera |
| $nCameraY | The Y coordinate of the camera |
| $nCameraZ | The Z coordinate of the camera |
| $nXYAngle | (Optional) The camera angle (horizontal) |
| $nXZAngle | (Optional) The camera angle (vertical) |
| $nVAngle | (Optional) The angle between the camera top and the screen top |
| $nFAngle | (Optional) The view angle |
| $nFScale | (Optional) The base scale value (global) |
None.
_S3d_SetLocalMatrix([$n00 = 1 [, $n01 = 0 [, $n02 = 0 [, $n03 = 0 [, $n10 = 0 [, $n11 = 1 [, $n12 = 0 [, $n13 = 0 [, $n20 = 0 [, $n21 = 0 [, $n22 = 1 [, $n23 = 0 [, $n30 = 0 [, $n31 = 0 [, $n32 = 0 [, $n33 = 1]]]]]]]]]]]]]]]])
| $n00 - $n33 | (Optional) New values for the Local Matrix |
None.
If all the parameters are omitted, Local Matrix will be an identity matrix.
_S3d_SetLocalMatrixEx(ByRef $aMatrix)
| $aMatrix | New local matrix (2 dimensional array) |
None.
_S3d_Square($nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2, $nX3, $nY3, $nZ3, $nX4, $nY4, $nZ4 [, $fFill = True])
| $nX1, $nY1, $nZ1, $nX2, $nY2, $nZ2, $nX3, $nY3, $nZ3, $nX4, $nY4, $nZ4 | The coordinates of the vertices |
| $fFill | (Optional) If true, the square is filled |
Success: 1
Failure: 0, @error = 1
This function failes if all of the specified points are behind the camera.
_S3d_Star($nX, $nY, $nZ, $nRad1, $nRad2, $iNum [, $fFill = True])
| $nX, $nY, $nZ | The coordinates of the center point of the star |
| $nRad1 | Radius1 |
| $nRad2 | Radius2 |
| $iNum | $iNum * 2 is the number of the vertices |
| $fFill | (Optional) If true, the star is filled |
Success: 1
Failure: 0
This function draws or fills a star on the XY plane when called without changing the local matrix.
_S3d_String($sString, $nX, $nY, $nZ)
| $sString | String to be drawn |
| $nX, $nY, $nZ | The coordinate where the string will be drawn |
Success: 1
Failure: 0, @error = 0 if _GDIPlus_GraphicsDrawStringEx failed, 1 if ($nX, $nY, $nZ) is behind the camera.
Before calling this function, Font and String Format must be specified using _S3d_SelectFont and _S3d_SelectFormat.
Author: Starg