From 32b7ac3a60f995d7741fb426ae4602b032dbfaf0 Mon Sep 17 00:00:00 2001 From: ffreyer Date: Mon, 10 Feb 2025 16:38:57 +0100 Subject: [PATCH] update docs --- docs/src/reference/plots/voxels.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/src/reference/plots/voxels.md b/docs/src/reference/plots/voxels.md index 4937176f5ef..18244fd47e3 100644 --- a/docs/src/reference/plots/voxels.md +++ b/docs/src/reference/plots/voxels.md @@ -135,19 +135,21 @@ uvs = [ ] # Create uvmap with sides (-x -y -z x y z) in second dimension -uvt = Matrix{Any}(undef, 4, 6) +uvt = Matrix{Any}(undef, 5, 6) uvt[1, :] = [uvs[9], uvs[9], uvs[8], uvs[9], uvs[9], uvs[8]] # 1 -> birch uvt[2, :] = [uvs[11], uvs[11], uvs[10], uvs[11], uvs[11], uvs[10]] # 2 -> oak uvt[3, :] = [uvs[2], uvs[2], uvs[2], uvs[2], uvs[2], uvs[18]] # 3 -> crafting table uvt[4, :] = [uvs[1], uvs[1], uvs[1], uvs[1], uvs[1], uvs[1]] # 4 -> planks +uvt[5, :] = [uvs[75], uvs[75], uvs[76], uvs[75], uvs[75], uvs[62]] # 5 -> dirt/grass chunk = UInt8[ - 1 0 1; 0 0 0; 1 0 1;;; + 1 0 1; 0 0 0; 1 0 5;;; 0 0 0; 0 0 0; 0 0 0;;; 2 0 2; 0 0 0; 3 0 4;;; ] -voxels(chunk, uv_transform = uvt, color = texture) +# rotate 0..1 texture coordinates first because the texture is rotated relative to what OpenGL expects +voxels(chunk, uv_transform = (uvt, :rotr90), color = texture) ``` Note that `uv_transform` allows various input types.