[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53621] trunk/blender/source/blender/ editors/space_view3d/view3d_draw.c: compare normalized vectors when calculating the view horizon

Campbell Barton ideasman42 at gmail.com
Mon Jan 7 04:29:07 CET 2013


Revision: 53621
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53621
Author:   campbellbarton
Date:     2013-01-07 03:29:03 +0000 (Mon, 07 Jan 2013)
Log Message:
-----------
compare normalized vectors when calculating the view horizon

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/view3d_draw.c

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2013-01-07 03:24:22 UTC (rev 53620)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2013-01-07 03:29:03 UTC (rev 53621)
@@ -3051,8 +3051,8 @@
 					const float xf = (float)x / (float)(XTOT - 1);
 					const float yf = (float)y / (float)(YTOT - 1);
 					const float mval[2] = {xf * (float)ar->winx, yf * ar->winy};
+					const float z_up[3] = {0.0f, 0.0f, 1.0f};
 					float out[3];
-					const float up[3] = {0.0f, 0.0f, 1.0f};
 					GLubyte *col_ub = grid_col[x][y];
 
 					float col_fac;
@@ -3070,10 +3070,10 @@
 					}
 					else {
 						if (scene->world->skytype & WO_SKYREAL) {
-							col_fac = fabsf((angle_v3v3(up, out) / (float)M_PI) - 0.5f) * 2.0f;
+							col_fac = fabsf((angle_normalized_v3v3(z_up, out) / (float)M_PI) - 0.5f) * 2.0f;
 						}
 						else {
-							col_fac = 1.0f - (angle_v3v3(up, out) / (float)M_PI);
+							col_fac = 1.0f - (angle_normalized_v3v3(z_up, out) / (float)M_PI);
 						}
 					}
 




More information about the Bf-blender-cvs mailing list