From 3c9e3e69ed778b817975e91c4ea22ea94ffd094e Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Thu, 30 Apr 2009 11:47:35 +0000 Subject: 2.5 Transform helpline and experimental drawing code to indicate direction of motion for specific transformations. --- source/blender/editors/space_view3d/view3d_draw.c | 41 ++++++----------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'source/blender/editors/space_view3d/view3d_draw.c') diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 0a063182368..cb67a1fc9aa 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -232,27 +232,6 @@ static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, flo } -// not intern, called in editobject for constraint axis too -void make_axis_color(char *col, char *col2, char axis) -{ - if(axis=='x') { - col2[0]= col[0]>219?255:col[0]+36; - col2[1]= col[1]<26?0:col[1]-26; - col2[2]= col[2]<26?0:col[2]-26; - } - else if(axis=='y') { - col2[0]= col[0]<46?0:col[0]-36; - col2[1]= col[1]>189?255:col[1]+66; - col2[2]= col[2]<46?0:col[2]-36; - } - else { - col2[0]= col[0]<26?0:col[0]-26; - col2[1]= col[1]<26?0:col[1]-26; - col2[2]= col[2]>209?255:col[2]+46; - } - -} - static void drawgrid(ARegion *ar, View3D *v3d) { /* extern short bgpicmode; */ @@ -365,15 +344,15 @@ static void drawgrid(ARegion *ar, View3D *v3d) /* center cross */ if( ELEM(rv3d->view, V3D_VIEW_RIGHT, V3D_VIEW_LEFT)) - make_axis_color(col, col2, 'y'); - else make_axis_color(col, col2, 'x'); + UI_make_axis_color(col, col2, 'y'); + else UI_make_axis_color(col, col2, 'x'); glColor3ubv((GLubyte *)col2); fdrawline(0.0, y, (float)ar->winx, y); if( ELEM(rv3d->view, V3D_VIEW_TOP, V3D_VIEW_BOTTOM)) - make_axis_color(col, col2, 'y'); - else make_axis_color(col, col2, 'z'); + UI_make_axis_color(col, col2, 'y'); + else UI_make_axis_color(col, col2, 'z'); glColor3ubv((GLubyte *)col2); fdrawline(x, 0.0, x, (float)ar->winy); @@ -412,7 +391,7 @@ static void drawfloor(Scene *scene, View3D *v3d) if(a==0) { /* check for the 'show Y axis' preference */ if (v3d->gridflag & V3D_SHOW_Y) { - make_axis_color(col, col2, 'y'); + UI_make_axis_color(col, col2, 'y'); glColor3ubv((GLubyte *)col2); draw_line = 1; @@ -451,7 +430,7 @@ static void drawfloor(Scene *scene, View3D *v3d) if(a==0) { /* check for the 'show X axis' preference */ if (v3d->gridflag & V3D_SHOW_X) { - make_axis_color(col, col2, 'x'); + UI_make_axis_color(col, col2, 'x'); glColor3ubv((GLubyte *)col2); draw_line = 1; @@ -488,7 +467,7 @@ static void drawfloor(Scene *scene, View3D *v3d) /* draw the Z axis line */ /* check for the 'show Z axis' preference */ if (v3d->gridflag & V3D_SHOW_Z) { - make_axis_color(col, col2, 'z'); + UI_make_axis_color(col, col2, 'z'); glColor3ubv((GLubyte *)col2); glBegin(GL_LINE_STRIP); @@ -567,7 +546,7 @@ static void draw_view_axis(RegionView3D *rv3d) vec[1] = vec[2] = 0; QuatMulVecf(rv3d->viewquat, vec); - make_axis_color((char *)gridcol, (char *)col, 'x'); + UI_make_axis_color((char *)gridcol, (char *)col, 'x'); rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v); s = s<0.5 ? s+0.5 : 1.0; v = 0.3; @@ -588,7 +567,7 @@ static void draw_view_axis(RegionView3D *rv3d) vec[0] = vec[2] = 0; QuatMulVecf(rv3d->viewquat, vec); - make_axis_color((char *)gridcol, (char *)col, 'y'); + UI_make_axis_color((char *)gridcol, (char *)col, 'y'); rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v); s = s<0.5 ? s+0.5 : 1.0; v = 0.3; @@ -609,7 +588,7 @@ static void draw_view_axis(RegionView3D *rv3d) vec[1] = vec[0] = 0; QuatMulVecf(rv3d->viewquat, vec); - make_axis_color((char *)gridcol, (char *)col, 'z'); + UI_make_axis_color((char *)gridcol, (char *)col, 'z'); rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v); s = s<0.5 ? s+0.5 : 1.0; v = 0.5; -- cgit v1.2.3