xhookLua
Game

draw3d

World shapes that walls hide, like real geometry. Only works inside on_draw_3d.

Functions

draw3d.line

draw3d.line(a, b, color [, width])
NameTypeDescription
aVector
bVector
colorinteger | tabledraw.color() or {r,g,b,a}.
widthoptionalnumberDefault 1.

Line between two points.

draw3d.box

draw3d.box(min, max, color [, filled])
NameTypeDescription
minVector
maxVector
colorinteger | table
filledoptionalbooleanDefault false.

World-aligned box.

draw3d.obb

draw3d.obb(min, max, matrix, color [, filled])
NameTypeDescription
minVector
maxVector
matrixMatrix3x4Like ent:hitbox_matrix(i).
colorinteger | table
filledoptionalbooleanDefault false.

Box in a matrix's space, for hitboxes.

draw3d.triangle

draw3d.triangle(a, b, c, color)
NameType
aVector
bVector
cVector
colorinteger | table

Filled triangle.

draw3d.sphere

draw3d.sphere(center, radius, color [, segments])
NameTypeDescription
centerVector
radiusnumber
colorinteger | table
segmentsoptionalinteger6 to 48. Default 16.

Wire sphere.

draw3d.set_depth

draw3d.set_depth(on)
NameTypeDescription
onbooleanfalse draws through walls.

Depth test for the rest of this handler.

Depth turns back on at the start of each handler. Shapes never hide each other.

draw3d ยท Lua API ยท xhook