From 16eafff705ea9b2f9f8e43fa4e473a72555eb448 Mon Sep 17 00:00:00 2001 From: ponchio Date: Sat, 15 Oct 2005 15:23:32 +0000 Subject: [PATCH] Fixed viewport<->window coordinate change for the z. (z = 2*z -1 now) Accordingly to gluUnproject documentation. --- wrap/gui/view.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wrap/gui/view.h b/wrap/gui/view.h index 7cdc4045..caa30f46 100644 --- a/wrap/gui/view.h +++ b/wrap/gui/view.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.13 2005/02/11 11:53:18 tommyfranken +changed pointf to point in ViewLineFromWindow + Revision 1.12 2005/02/10 20:09:11 tarini dispelled the mega-evil of GL_TRANSPOSE_*_MATRIX_ARB @@ -210,7 +213,7 @@ template Point3 View::NormDevCoordToWindowCoord(const Point3 a[0] = (p[0]+1)*(viewport[2]/(T)2.0)+viewport[0]; a[1] = (p[1]+1)*(viewport[3]/(T)2.0)+viewport[1]; //a[1] = viewport[3] - a[1]; - a[2] = p[2]; + a[2] = (p[2]+1)/2; return a; } @@ -220,7 +223,7 @@ template Point3 View::WindowCoordToNormDevCoord(const Point3 a[0] = (p[0]- viewport[0])/ (viewport[2]/(T)2.0) - 1; a[1] = (p[1]- viewport[1])/ (viewport[3]/(T)2.0) - 1; //a[1] = -a[1]; - a[2] = p[2]; + a[2] = 2*p[2] - 1; return a; }