Render a hand

This commit is contained in:
2026-09-27 00:18:16 -03:00
parent a2cf590315
commit 535bd36d91
5 changed files with 140 additions and 61 deletions
+15
View File
@@ -333,6 +333,21 @@ export function begin_mode_3d(new_camera: Camera) {
write_mvp();
}
// 3d drawing in front of the camera instead of in the world, for the item in the player's hand: x right, y up, looking
// down -z. depth is cleared first, so it's never hidden inside a wall, like minecraft's first person hand
export function begin_view_model(fov: number) {
flush_batch();
if (pass) {
pass.end();
pass = undefined;
}
pending_depth_clear = true;
mode3d = true;
mat4.perspectiveZO(mvp, fov, canvas.width / canvas.height, 0.01, 10);
write_mvp();
}
export function end_mode_3d() {
if (!mode3d) {
return;