From 5fdfe7c90f2f352c77a214cda7b3f9a3c4b79571 Mon Sep 17 00:00:00 2001 From: Petr <60181770+xdanca01@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:27:31 +0200 Subject: [PATCH] Update SZP08_modelovani_a_projekce.ad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nejdříve se musí provést depth mapping a až teprve můžeme provést perspective division. Je to napsáno i v citaci: http://learnwebgl.brown37.net/08_projections/projections_perspective.html Translate the apex of the frustum to the origin. (Yellow matrix) Scale the depth values (z) into a normalized range (-1,+1) (and setup for division by (-z)). (Purple matrix) Perform the perspective calculation. (Gray matrix) Scale the 2D (x’,y’) values in the viewing window to a 2-by-2 unit square; (-1,-1) to (+1,+1). (Cyan matrix) --- szmgr/SZP08_modelovani_a_projekce.ad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/szmgr/SZP08_modelovani_a_projekce.ad b/szmgr/SZP08_modelovani_a_projekce.ad index 5f100ce..5f13a25 100644 --- a/szmgr/SZP08_modelovani_a_projekce.ad +++ b/szmgr/SZP08_modelovani_a_projekce.ad @@ -292,7 +292,7 @@ Výsledná matice je: [stem] ++++ -P_\text{persp} = M_\text{depth} \cdot S \cdot D \cdot T = +P_\text{persp} = S \cdot D \cdot M_\text{depth} \cdot T = \begin{bmatrix} \textcolor{green}{\frac{2 \cdot \text{near}}{\text{right} - \text{left}}}