|
From: <axl...@us...> - 2009-03-03 21:42:04
|
Revision: 173
http://hgengine.svn.sourceforge.net/hgengine/?rev=173&view=rev
Author: axlecrusher
Date: 2009-03-03 21:41:55 +0000 (Tue, 03 Mar 2009)
Log Message:
-----------
fix far and near plane calculations
Modified Paths:
--------------
Mercury2/src/Viewport.cpp
Modified: Mercury2/src/Viewport.cpp
===================================================================
--- Mercury2/src/Viewport.cpp 2009-03-03 21:36:47 UTC (rev 172)
+++ Mercury2/src/Viewport.cpp 2009-03-03 21:41:55 UTC (rev 173)
@@ -92,15 +92,16 @@
MercuryVector X,Y,Z;
Z = (eye - look).Normalize(); //direction behind camera
- X = (up * Z).Normalize(); //X axis
+ X = (up.CrossProduct(Z)).Normalize(); //X axis
Y = Z.CrossProduct( X ); //real up
- m_nc = up - Z * m_zNear;
- m_fc = up - Z * m_zFar;
+ m_nc = (eye - Z) * m_zNear;
+ m_fc = (eye - Z) * m_zFar;
- m_planes[PNEAR].Setup(m_nc, Z*-1);
+ m_planes[PNEAR].Setup(m_nc, Z*(-1));
m_planes[PFAR].Setup(m_fc, Z);
-
+// m_fc.Print();
+// Z.Print();
MercuryVector aux,normal;
aux = (m_nc + Y*m_nh) - eye;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|