render.DrawBox
render.DrawBox( Vector position, Angle angles, Vector mins, Vector maxs, table color = Color( 255, 255, 255 ) )
Description
Draws a box in 3D space.
This is a rendering function that requires a 3d rendering context.
This means that it will only work in 3d Rendering Hooks.
Arguments
Example
Draws a white box at the position you are looking.
local x = Vector( 5, 5, 5 )
hook.Add( "PostDrawTranslucentRenderables", "Boxxie", function()
local pos = LocalPlayer():GetEyeTrace().HitPos -- position to render box at
render.SetColorMaterial() -- white material for easy coloring
cam.IgnoreZ( true ) -- makes next draw calls ignore depth and draw on top
render.DrawBox( pos, angle_zero, x, -x, color_white ) -- draws the box
cam.IgnoreZ( false ) -- disables previous call
end )