summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/drawpath3.cc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-14 23:14:16 +0000
committerKarl Berry <karl@freefriends.org>2010-06-14 23:14:16 +0000
commitc2175edc7aa44ca0b526f008d473d6f8a8ac4933 (patch)
treed6c491676b413ad1922481f8c3fc7b64c3afc0a5 /Build/source/utils/asymptote/drawpath3.cc
parent5d08e9ff4fe5fc836d237ea08e82c82b27d558a2 (diff)
asy 1.98
git-svn-id: svn://tug.org/texlive/trunk@18982 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/drawpath3.cc')
-rw-r--r--Build/source/utils/asymptote/drawpath3.cc28
1 files changed, 22 insertions, 6 deletions
diff --git a/Build/source/utils/asymptote/drawpath3.cc b/Build/source/utils/asymptote/drawpath3.cc
index 699928b9b38..b41c69a1114 100644
--- a/Build/source/utils/asymptote/drawpath3.cc
+++ b/Build/source/utils/asymptote/drawpath3.cc
@@ -50,6 +50,8 @@ void drawPath3::render(GLUnurbs *nurb, double, const triple&, const triple&,
if(n == 0 || invisible || ((color.A < 1.0) ^ transparent))
return;
+ bool havebillboard=interaction == BILLBOARD;
+
GLfloat Diffuse[]={0.0,0.0,0.0,color.A};
glMaterialfv(GL_FRONT,GL_DIFFUSE,Diffuse);
@@ -63,22 +65,36 @@ void drawPath3::render(GLUnurbs *nurb, double, const triple&, const triple&,
glMaterialf(GL_FRONT,GL_SHININESS,128.0);
+ if(havebillboard) BB.init();
+
if(straight) {
glBegin(GL_LINE_STRIP);
for(Int i=0; i <= n; ++i) {
triple v=g.point(i);
- glVertex3f(v.getx(),v.gety(),v.getz());
+ if(havebillboard) {
+ static GLfloat controlpoints[3];
+ BB.store(controlpoints,v,center);
+ glVertex3fv(controlpoints);
+ } else
+ glVertex3f(v.getx(),v.gety(),v.getz());
}
glEnd();
} else {
for(Int i=0; i < n; ++i) {
static GLfloat knots[8]={0.0,0.0,0.0,0.0,1.0,1.0,1.0,1.0};
static GLfloat controlpoints[12];
- store(controlpoints,g.point(i));
- store(controlpoints+3,g.postcontrol(i));
- store(controlpoints+6,g.precontrol(i+1));
- store(controlpoints+9,g.point(i+1));
-
+ if(havebillboard) {
+ BB.store(controlpoints,g.point(i),center);
+ BB.store(controlpoints+3,g.postcontrol(i),center);
+ BB.store(controlpoints+6,g.precontrol(i+1),center);
+ BB.store(controlpoints+9,g.point(i+1),center);
+ } else {
+ store(controlpoints,g.point(i));
+ store(controlpoints+3,g.postcontrol(i));
+ store(controlpoints+6,g.precontrol(i+1));
+ store(controlpoints+9,g.point(i+1));
+ }
+
gluBeginCurve(nurb);
gluNurbsCurve(nurb,8,knots,3,controlpoints,4,GL_MAP1_VERTEX_3);
gluEndCurve(nurb);