Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2006-10-01 22:28:46 +0400
committerMartin Poirier <theeth@yahoo.com>2006-10-01 22:28:46 +0400
commited2560488b78df46158d4283f17259f5dd241767 (patch)
treeda4809db263a9083faea50dfa98a764f6ad8755b /source
parenta88807b6dd3d67c3706bf69a9811b30702bb531a (diff)
As discussed during meeting, Changed curve length/tilt markers to indicate direction.
That is, a 3D curve now displays as ->->->-> instead of -|-|-|-|. Comparing the two, I didn't find the arrow display any more confusing then the straight lines when dealing with loops and tilt variations. Sharp turns are more likely to display crossed lines though. Others should feel free to disagree and make it better.
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/drawobject.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index ddd1f3053db..dd82be68af4 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -3052,7 +3052,6 @@ static void drawnurb(Base *base, Nurb *nurb, int dt)
/* direction vectors for 3d curve paths */
if(cu->flag & CU_3D) {
BIF_ThemeColor(TH_WIRE);
- glBegin(GL_LINES);
for (bl=cu->bev.first,nu=nurb; nu && bl; bl=bl->next,nu=nu->next) {
BevPoint *bevp= (BevPoint *)(bl+1);
int nr= bl->nr;
@@ -3060,20 +3059,29 @@ static void drawnurb(Base *base, Nurb *nurb, int dt)
float fac;
while (nr-->0) {
- float ox,oy,oz;
- fac = calc_curve_subdiv_radius(cu, nu, (bl->nr - nr));
- ox = G.scene->editbutsize*fac*bevp->mat[0][0];
- oy = G.scene->editbutsize*fac*bevp->mat[0][1];
- oz = G.scene->editbutsize*fac*bevp->mat[0][2];
-
- glVertex3f(bevp->x - ox, bevp->y - oy, bevp->z - oz);
- glVertex3f(bevp->x + ox, bevp->y + oy, bevp->z + oz);
+ float ox,oy,oz; // Offset perpendicular to the curve
+ float dx,dy,dz; // Delta along the curve
+
+ fac = calc_curve_subdiv_radius(cu, nu, (bl->nr - nr)) * G.scene->editbutsize;
+
+ ox = fac*bevp->mat[0][0];
+ oy = fac*bevp->mat[0][1];
+ oz = fac*bevp->mat[0][2];
+
+ dx = fac*bevp->mat[2][0];
+ dy = fac*bevp->mat[2][1];
+ dz = fac*bevp->mat[2][2];
+
+ glBegin(GL_LINE_STRIP);
+ glVertex3f(bevp->x - ox - dx, bevp->y - oy - dy, bevp->z - oz - dz);
+ glVertex3f(bevp->x, bevp->y, bevp->z);
+ glVertex3f(bevp->x + ox - dx, bevp->y + oy - dy, bevp->z + oz - dz);
+ glEnd();
bevp += skip+1;
nr -= skip;
}
}
- glEnd();
}
if(G.vd->zbuf) glDisable(GL_DEPTH_TEST);