> For the complete documentation index, see [llms.txt](https://docs.quickclient.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quickclient.cc/en/ui/render-3d.md).

# 3D render

Lines, boxes, tracers and meshes right in the world with Render3D.

Boxes around players, tracers, icons above heads and everything else drawn right in the world goes through `Render3D`.

It is passed to `onRender3D(Render3D)` every frame while the script is enabled and the player is in a world. You pass world coordinates, and Quick subtracts the camera position itself. The last argument of almost every method is `throughWalls`: if it is `true`, the shape is visible through blocks.

```java
@Override
public void onRender3D(Render3D render) {
    Entity target = entities().target();
    if (target == null) return;
    render.entityBox(target, 0xFFFF3B30, true);
    Point p = target.position(render.delta());
    render.tracer(p.x(), p.y() + target.height() / 2, p.z(), 0x80FF3B30, true);
}
```

How it works:

* The current target is taken. If there is none, there is nothing to draw.
* Its hitbox is outlined in red and stays visible through walls.
* A semi-transparent tracer goes to the middle of its body. The position is taken with `render.delta()` so the line does not jitter.

## Shapes

| Method                                                               | Description                                                              |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `line(x1, y1, z1, x2, y2, z2, color, throughWalls)`                  | line segment                                                             |
| `box(minX, minY, minZ, maxX, maxY, maxZ, color, throughWalls)`       | box, edges only                                                          |
| `filledBox(minX, minY, minZ, maxX, maxY, maxZ, color, throughWalls)` | filled box                                                               |
| `entityBox(entity, color, throughWalls)`                             | hitbox edges at the smoothed position of the entity                      |
| `filledEntityBox(entity, color, throughWalls)`                       | filled hitbox                                                            |
| `tracer(x, y, z, color, throughWalls)`                               | line from the center of the screen to a point in the world               |
| `triangle(points, color, throughWalls)`                              | filled triangle; `points` is nine numbers                                |
| `polygon(points, color, throughWalls)`                               | triangle fan from the first point; points come in triples `x, y, z`      |
| `additive(additive)`                                                 | turns on additive colors for all following shapes, so they start to glow |

With additive blending, the color multiplied by alpha is added. That is why transparent areas do not glow, and you control how soft the glow is with alpha.

## Meshes in the world

A mesh is built once with `gpu()`, and then you can draw it every frame without rebuilding. More on the [Your own geometry](/en/ui/gpu.md) page.

| Method                                                                                | Description                                                           |
| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `billboard(mesh, x, y, z, scale, tint, throughWalls)`                                 | a mesh that always faces the camera, for example an icon above a head |
| `billboard(mesh, texture, x, y, z, scale, tint, throughWalls)`                        | billboard with a texture from `resources/`                            |
| `mesh(mesh, x, y, z, scale, tint, throughWalls)`                                      | mesh aligned to the world axes                                        |
| `mesh(mesh, texture, x, y, z, scale, tint, throughWalls)`                             | the same with a texture                                               |
| `mesh(mesh, x, y, z, scale, yaw, pitch, tint, throughWalls)`                          | mesh with rotation                                                    |
| `mesh(mesh, [shader,] texture, x, y, z, scale, yaw, pitch, tint, blend, depth, cull)` | you set everything yourself: blending, depth test, face culling       |
| `billboard(mesh, [shader,] texture, x, y, z, scale, tint, blend, depth, cull)`        | the same for a billboard                                              |

`tint` is a `0xAARRGGBB` color multiplier, `-1` means "as is". `scale` is in blocks.

| Group   | Values                                                                                                        |
| ------- | ------------------------------------------------------------------------------------------------------------- |
| `blend` | `NORMAL`, `ADDITIVE`, `OVERWRITE`                                                                             |
| `depth` | `NO_DEPTH` visible through everything, `DEPTH` with depth test, `DEPTH_WRITE` with depth test and depth write |

## Camera

| Method                                | Type     | Description                                                      |
| ------------------------------------- | -------- | ---------------------------------------------------------------- |
| `delta()`                             | `float`  | fraction of the tick by this frame, pass it to `position(delta)` |
| `cameraX()`, `cameraY()`, `cameraZ()` | `double` | where the camera is                                              |
| `cameraYaw()`, `cameraPitch()`        | `float`  | where the camera is looking                                      |

Take the entity position with `entity.position(render.delta())`. With the plain position the shape will jump from tick to tick.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.quickclient.cc/en/ui/render-3d.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
