Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Draw3D Class Reference

Functions for drawing in 3D. More...

Public Member Functions

void BindVertexBuffer (integer vertexBufferIndex)
 Binds a vertex buffer.
void UnbindVertexBuffer ()
 Unbinds the currently bound vertex buffer.
void BindScene (integer scene3DIndex)
 Binds a 3D scene for drawing polygons in 3D space.
void Model (integer modelIndex, integer animation, decimal frame, matrix matrixModel, matrix matrixNormal)
 Draws a model.
void ModelSkinned (integer modelIndex, integer armatureIndex, matrix matrixModel, matrix matrixNormal)
 Draws a skinned model.
void ModelSimple (integer modelIndex, integer animation, integer frame, number x, number y, number scale, number rx, number ry, number rz)
 Draws a model without using matrices.
void Triangle (number x1, number y1, number z1, number x2, number y2, number z2, number x3, number y3, number z3, integer color1, integer color2, integer color3, matrix matrixModel, matrix matrixNormal)
 Draws a triangle in 3D space.
void Quad (number x1, number y1, number z1, number x2, number y2, number z2, number x3, number y3, number z3, number x4, number y4, number z4, integer color1, integer color2, integer color3, integer color4, matrix matrixModel, matrix matrixNormal)
 Draws a quadrilateral in 3D space.
void Sprite (integer sprite, integer animation, integer frame, number x, number y, number z, integer flipX, integer flipY, number scaleX, number scaleY, matrix matrixModel, matrix matrixNormal)
 Draws a sprite in 3D space.
void SpritePart (integer sprite, integer animation, integer frame, number x, number y, number z, integer partX, integer partY, integer partW, integer partH, integer flipX, integer flipY, number scaleX, number scaleY, matrix matrixModel, matrix matrixNormal)
 Draws part of a sprite in 3D space.
void Image (integer image, number x, number y, number z, matrix matrixModel, matrix matrixNormal)
 Draws an image in 3D space.
void ImagePart (integer image, number x, number y, number z, integer partX, integer partY, integer partW, integer partH, matrix matrixModel, matrix matrixNormal)
 Draws part of an image in 3D space.
void Tile (integer ID, number x, number y, number z, integer flipX, integer flipY, matrix matrixModel, matrix matrixNormal)
 Draws a tile in 3D space.
void TriangleTextured (integer image, number x1, number y1, number z1, number x2, number y2, number z2, number x3, number y3, number z3, integer color1, integer color2, integer color3, number u1, number v1, number u2, number v2, number u3, number v3, matrix matrixModel, matrix matrixNormal)
 Draws a textured triangle in 3D space. The texture source should be an image.
void QuadTextured (integer image, number x1, number y1, number z1, number x2, number y2, number z2, number x3, number y3, number z3, number x4, number y4, number z4, integer color1, integer color2, integer color3, integer color4, number u1, number v1, number u2, number v2, number u3, number v3, number u4, number v4, matrix matrixModel, matrix matrixNormal)
 Draws a textured quad in 3D space. The texture source should be an image.
void SpritePoints (integer sprite, integer animation, integer frame, integer flipX, integer flipY, number x1, number y1, number z1, number x2, number y2, number z2, number x3, number y3, number z3, number x4, number y4, number z4, integer color1, integer color2, integer color3, integer color4, matrix matrixModel, matrix matrixNormal)
 Draws a textured rectangle in 3D space. The texture source should be a sprite.
void TilePoints (integer ID, integer flipX, integer flipY, number x1, number y1, number z1, number x2, number y2, number z2, number x3, number y3, number z3, number x4, number y4, number z4, integer color1, integer color2, integer color3, integer color4, matrix matrixModel, matrix matrixNormal)
 Draws a textured rectangle in 3D space.
void SceneLayer (integer layer, matrix matrixModel, matrix matrixNormal)
 Draws a scene layer in 3D space.
void SceneLayerPart (integer layer, integer partX, integer partY, integer partW, integer partH, matrix matrixModel, matrix matrixNormal)
 Draws part of a scene layer in 3D space.
void VertexBuffer (integer vertexBufferIndex, matrix matrixModel, matrix matrixNormal)
 Draws a vertex buffer.
void RenderScene (integer scene3DIndex, integer drawMode)
 Draws everything in the 3D scene.

Detailed Description

Functions for drawing in 3D.

Member Function Documentation

◆ BindScene()

void Draw3D.BindScene ( integer scene3DIndex)

Binds a 3D scene for drawing polygons in 3D space.

Parameters
scene3DIndexSets the 3D scene to bind.

◆ BindVertexBuffer()

void Draw3D.BindVertexBuffer ( integer vertexBufferIndex)

Binds a vertex buffer.

Parameters
vertexBufferIndexSets the vertex buffer to bind.

◆ Image()

void Draw3D.Image ( integer image,
number x,
number y,
number z,
matrix matrixModel,
matrix matrixNormal )

Draws an image in 3D space.

Parameters
imageIndex of the loaded image.
xX position of where to draw the image.
yY position of where to draw the image.
zZ position of where to draw the image.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ ImagePart()

void Draw3D.ImagePart ( integer image,
number x,
number y,
number z,
integer partX,
integer partY,
integer partW,
integer partH,
matrix matrixModel,
matrix matrixNormal )

Draws part of an image in 3D space.

Parameters
imageIndex of the loaded image.
xX position of where to draw the image.
yY position of where to draw the image.
zZ position of where to draw the image.
partXX coordinate of part of image to draw.
partYY coordinate of part of image to draw.
partWWidth of part of image to draw.
partHHeight of part of image to draw.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ Model()

void Draw3D.Model ( integer modelIndex,
integer animation,
decimal frame,
matrix matrixModel,
matrix matrixNormal )

Draws a model.

Parameters
modelIndexIndex of loaded model.
animationAnimation of model to draw.
frameFrame of model to draw.
matrixModelMatrix for transforming model coordinates to world space.
matrixNormalMatrix for transforming model normals.

◆ ModelSimple()

void Draw3D.ModelSimple ( integer modelIndex,
integer animation,
integer frame,
number x,
number y,
number scale,
number rx,
number ry,
number rz )

Draws a model without using matrices.

Parameters
modelIndexIndex of loaded model.
animationAnimation of model to draw.
frameFrame of model to draw.
xX position
yY position
scaleModel scale
rxX rotation in radians
ryY rotation in radians
rzZ rotation in radians

◆ ModelSkinned()

void Draw3D.ModelSkinned ( integer modelIndex,
integer armatureIndex,
matrix matrixModel,
matrix matrixNormal )

Draws a skinned model.

Parameters
modelIndexIndex of loaded model.
armatureIndexArmature index to skin the model.
matrixModelMatrix for transforming model coordinates to world space.
matrixNormalMatrix for transforming model normals.

◆ Quad()

void Draw3D.Quad ( number x1,
number y1,
number z1,
number x2,
number y2,
number z2,
number x3,
number y3,
number z3,
number x4,
number y4,
number z4,
integer color1,
integer color2,
integer color3,
integer color4,
matrix matrixModel,
matrix matrixNormal )

Draws a quadrilateral in 3D space.

Parameters
x1X position of the first vertex.
y1Y position of the first vertex.
z1Z position of the first vertex.
x2X position of the second vertex.
y2Y position of the second vertex.
z2Z position of the second vertex.
x3X position of the third vertex.
y3Y position of the third vertex.
z3Z position of the third vertex.
x4X position of the fourth vertex.
y4Y position of the fourth vertex.
z4Z position of the fourth vertex.
color1Color of the first vertex.
color2Color of the second vertex.
color3Color of the third vertex.
color4Color of the fourth vertex.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ QuadTextured()

void Draw3D.QuadTextured ( integer image,
number x1,
number y1,
number z1,
number x2,
number y2,
number z2,
number x3,
number y3,
number z3,
number x4,
number y4,
number z4,
integer color1,
integer color2,
integer color3,
integer color4,
number u1,
number v1,
number u2,
number v2,
number u3,
number v3,
number u4,
number v4,
matrix matrixModel,
matrix matrixNormal )

Draws a textured quad in 3D space. The texture source should be an image.

Parameters
imageIndex of the loaded image.
x1X position of the first vertex.
y1Y position of the first vertex.
z1Z position of the first vertex.
x2X position of the second vertex.
y2Y position of the second vertex.
z2Z position of the second vertex.
x3X position of the third vertex.
y3Y position of the third vertex.
z3Z position of the third vertex.
x4X position of the fourth vertex.
y4Y position of the fourth vertex.
z4Z position of the fourth vertex.
color1Color of the first vertex.
color2Color of the second vertex.
color3Color of the third vertex.
color4Color of the fourth vertex.
u1Texture U of the first vertex.
v1Texture V of the first vertex.
u2Texture U of the second vertex.
v2Texture V of the second vertex.
u3Texture U of the third vertex.
v3Texture V of the third vertex.
u4Texture U of the fourth vertex.
v4Texture V of the fourth vertex.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ RenderScene()

void Draw3D.RenderScene ( integer scene3DIndex,
integer drawMode )

Draws everything in the 3D scene.

Parameters
scene3DIndexThe 3D scene at the index to draw.
drawModeThe type of drawing to use for the vertices in the 3D scene.

◆ SceneLayer()

void Draw3D.SceneLayer ( integer layer,
matrix matrixModel,
matrix matrixNormal )

Draws a scene layer in 3D space.

Parameters
layerIndex of the layer.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ SceneLayerPart()

void Draw3D.SceneLayerPart ( integer layer,
integer partX,
integer partY,
integer partW,
integer partH,
matrix matrixModel,
matrix matrixNormal )

Draws part of a scene layer in 3D space.

Parameters
layerIndex of the layer.
partXX coordinate (in tiles) of part of layer to draw.
partYY coordinate (in tiles) of part of layer to draw.
partWWidth (in tiles) of part of layer to draw.
partHHeight (in tiles) of part of layer to draw.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ Sprite()

void Draw3D.Sprite ( integer sprite,
integer animation,
integer frame,
number x,
number y,
number z,
integer flipX,
integer flipY,
number scaleX,
number scaleY,
matrix matrixModel,
matrix matrixNormal )

Draws a sprite in 3D space.

Parameters
spriteIndex of the loaded sprite.
animationIndex of the animation entry.
frameIndex of the frame in the animation entry.
xX position of where to draw the sprite.
yY position of where to draw the sprite.
zZ position of where to draw the sprite.
flipXWhether to flip the sprite horizontally.
flipYWhether to flip the sprite vertically.
scaleXScale multiplier of the sprite horizontally.
scaleYScale multiplier of the sprite vertically.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ SpritePart()

void Draw3D.SpritePart ( integer sprite,
integer animation,
integer frame,
number x,
number y,
number z,
integer partX,
integer partY,
integer partW,
integer partH,
integer flipX,
integer flipY,
number scaleX,
number scaleY,
matrix matrixModel,
matrix matrixNormal )

Draws part of a sprite in 3D space.

Parameters
spriteIndex of the loaded sprite.
animationIndex of the animation entry.
frameIndex of the frame in the animation entry.
xX position of where to draw the sprite.
yY position of where to draw the sprite.
zZ position of where to draw the sprite.
partXX coordinate of part of frame to draw.
partYY coordinate of part of frame to draw.
partWWidth of part of frame to draw.
partHHeight of part of frame to draw.
flipXWhether to flip the sprite horizontally.
flipYWhether to flip the sprite vertically.
scaleXScale multiplier of the sprite horizontally.
scaleYScale multiplier of the sprite vertically.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ SpritePoints()

void Draw3D.SpritePoints ( integer sprite,
integer animation,
integer frame,
integer flipX,
integer flipY,
number x1,
number y1,
number z1,
number x2,
number y2,
number z2,
number x3,
number y3,
number z3,
number x4,
number y4,
number z4,
integer color1,
integer color2,
integer color3,
integer color4,
matrix matrixModel,
matrix matrixNormal )

Draws a textured rectangle in 3D space. The texture source should be a sprite.

Parameters
spriteIndex of the loaded sprite.
animationIndex of the animation entry.
frameIndex of the frame in the animation entry.
flipXWhether to flip the sprite horizontally.
flipYWhether to flip the sprite vertically.
x1X position of the first vertex.
y1Y position of the first vertex.
z1Z position of the first vertex.
x2X position of the second vertex.
y2Y position of the second vertex.
z2Z position of the second vertex.
x3X position of the third vertex.
y3Y position of the third vertex.
z3Z position of the third vertex.
x4X position of the fourth vertex.
y4Y position of the fourth vertex.
z4Z position of the fourth vertex.
color1Color of the first vertex.
color2Color of the second vertex.
color3Color of the third vertex.
color4Color of the fourth vertex.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ Tile()

void Draw3D.Tile ( integer ID,
number x,
number y,
number z,
integer flipX,
integer flipY,
matrix matrixModel,
matrix matrixNormal )

Draws a tile in 3D space.

Parameters
IDID of the tile to draw.
xX position of where to draw the tile.
yY position of where to draw the tile.
zZ position of where to draw the tile.
flipXWhether to flip the tile horizontally.
flipYWhether to flip the tile vertically.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ TilePoints()

void Draw3D.TilePoints ( integer ID,
integer flipX,
integer flipY,
number x1,
number y1,
number z1,
number x2,
number y2,
number z2,
number x3,
number y3,
number z3,
number x4,
number y4,
number z4,
integer color1,
integer color2,
integer color3,
integer color4,
matrix matrixModel,
matrix matrixNormal )

Draws a textured rectangle in 3D space.

Parameters
IDID of the tile to draw.
flipXWhether to flip the tile horizontally.
flipYWhether to flip the tile vertically.
x1X position of the first vertex.
y1Y position of the first vertex.
z1Z position of the first vertex.
x2X position of the second vertex.
y2Y position of the second vertex.
z2Z position of the second vertex.
x3X position of the third vertex.
y3Y position of the third vertex.
z3Z position of the third vertex.
x4X position of the fourth vertex.
y4Y position of the fourth vertex.
z4Z position of the fourth vertex.
color1Color of the first vertex.
color2Color of the second vertex.
color3Color of the third vertex.
color4Color of the fourth vertex.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ Triangle()

void Draw3D.Triangle ( number x1,
number y1,
number z1,
number x2,
number y2,
number z2,
number x3,
number y3,
number z3,
integer color1,
integer color2,
integer color3,
matrix matrixModel,
matrix matrixNormal )

Draws a triangle in 3D space.

Parameters
x1X position of the first vertex.
y1Y position of the first vertex.
z1Z position of the first vertex.
x2X position of the second vertex.
y2Y position of the second vertex.
z2Z position of the second vertex.
x3X position of the third vertex.
y3Y position of the third vertex.
z3Z position of the third vertex.
color1Color of the first vertex.
color2Color of the second vertex.
color3Color of the third vertex.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ TriangleTextured()

void Draw3D.TriangleTextured ( integer image,
number x1,
number y1,
number z1,
number x2,
number y2,
number z2,
number x3,
number y3,
number z3,
integer color1,
integer color2,
integer color3,
number u1,
number v1,
number u2,
number v2,
number u3,
number v3,
matrix matrixModel,
matrix matrixNormal )

Draws a textured triangle in 3D space. The texture source should be an image.

Parameters
imageIndex of the loaded image.
x1X position of the first vertex.
y1Y position of the first vertex.
z1Z position of the first vertex.
x2X position of the second vertex.
y2Y position of the second vertex.
z2Z position of the second vertex.
x3X position of the third vertex.
y3Y position of the third vertex.
z3Z position of the third vertex.
color1Color of the first vertex.
color2Color of the second vertex.
color3Color of the third vertex.
u1Texture U of the first vertex.
v1Texture V of the first vertex.
u2Texture U of the second vertex.
v2Texture V of the second vertex.
u3Texture U of the third vertex.
v3Texture V of the third vertex.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.

◆ VertexBuffer()

void Draw3D.VertexBuffer ( integer vertexBufferIndex,
matrix matrixModel,
matrix matrixNormal )

Draws a vertex buffer.

Parameters
vertexBufferIndexThe vertex buffer to draw.
matrixModelMatrix for transforming coordinates to world space.
matrixNormalMatrix for transforming normals.