gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz gfx/librenderables/renderables.py gzz/view/...


From: Matti Katila
Subject: [Gzz-commits] gzz gfx/librenderables/renderables.py gzz/view/...
Date: Thu, 13 Feb 2003 11:29:05 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   03/02/13 11:29:05

Modified files:
        gfx/librenderables: renderables.py 
        gzz/view/buoy  : buoymanager.py 

Log message:
        line connector + sq

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.176&tr2=1.177&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/buoy/buoymanager.py.diff?tr1=1.37&tr2=1.38&r1=text&r2=text

Patches:
Index: gzz/gfx/librenderables/renderables.py
diff -u gzz/gfx/librenderables/renderables.py:1.176 
gzz/gfx/librenderables/renderables.py:1.177
--- gzz/gfx/librenderables/renderables.py:1.176 Thu Feb 13 10:28:09 2003
+++ gzz/gfx/librenderables/renderables.py       Thu Feb 13 11:29:04 2003
@@ -591,6 +591,72 @@
 
 {
     "Type": "2",
+    "Name": "SqAndLineConnector",
+    "Data": "float px1, py1, px2, py2, dz1, dz2, red, green, blue, alpha, 
sqAlpha, lineWidth, sqLineWidth;",
+    "Params": """float px1, float py1, float px2, float py2, float dz1, float 
dz2,
+                 float red, float green, float blue, float alpha, float 
sqAlpha, float lineWidth, float sqLineWidth""",
+    "ParamCode": """ this->px1 = px1; this->py1 = py1;
+                     this->px2 = px2; this->py2 = py2;
+                     this->dz1 = dz1; this->dz2 = dz2;
+                     this->red = red; this->green = green;
+                     this->blue = blue; this->alpha = alpha;
+                     this->sqAlpha = sqAlpha;
+                     this->lineWidth = lineWidth; this->sqLineWidth = 
sqLineWidth;""",
+    "RenderCode": """
+            bool colored = true;
+            if (red < 0 || green < 0 || blue < 0 || alpha < 0) colored = false;
+            Pt box1 = coords1.getSqSize();
+            Pt box2 = coords2.getSqSize();
+           ZPt p1 = coords1.transform(ZPt(box1.x*px1,box1.y*py1,0));
+           ZPt p2 = coords2.transform(ZPt(box2.x*px2,box2.y*py2,0));
+           p1.z += dz1;
+           p2.z += dz2;
+            if (colored) glPushAttrib(GL_CURRENT_BIT);
+            glPushAttrib(GL_ENABLE_BIT);
+            glDisable(GL_TEXTURE_2D);
+            if (colored) glColor4f(red, green, blue, alpha);
+
+            glLineWidth(lineWidth);
+
+           glBegin(GL_LINE_STRIP);
+           glVertex3f(p1.x, p1.y, p1.z);
+           glVertex3f(p2.x, p2.y, p2.z);
+           glEnd();
+
+            glLineWidth(sqLineWidth);
+            
+            // square box 1
+            glBegin(GL_LINE_LOOP);
+               p1 = coords1.transform(ZPt(0,0,0));
+               glVertex3f(p1.x, p1.y, p1.z);
+               p1 = coords1.transform(ZPt(box1.x, 0, 0));
+               glVertex3f(p1.x, p1.y, p1.z);
+               p1 = coords1.transform(ZPt(box1.x, box1.y,0));
+               glVertex3f(p1.x, p1.y, p1.z);
+               p1 = coords1.transform(ZPt(0, box1.y, 0));
+               glVertex3f(p1.x, p1.y, p1.z);
+            glEnd();
+
+            // square box 2
+            glBegin(GL_LINE_LOOP);
+               p2 = coords2.transform(ZPt(0,0,0));
+               glVertex3f(p2.x, p2.y, p2.z);
+               p2 = coords2.transform(ZPt(box2.x, 0,0));
+               glVertex3f(p2.x, p2.y, p2.z);
+               p2 = coords2.transform(ZPt(box2.x, box2.y, 0));
+               glVertex3f(p2.x, p2.y, p2.z);
+               p2 = coords2.transform(ZPt(0, box2.y, 0));
+               glVertex3f(p2.x, p2.y, p2.z);
+            glEnd();
+
+
+            if (colored) glPopAttrib();
+            glPopAttrib();
+       """
+},
+
+{
+    "Type": "2",
     "Name": "SqFilletConnection",
     "Data": "float width;int flags; float blendw; int power;",
     "Params": "float width, int flags, float blendw, int power",
Index: gzz/gzz/view/buoy/buoymanager.py
diff -u gzz/gzz/view/buoy/buoymanager.py:1.37 
gzz/gzz/view/buoy/buoymanager.py:1.38
--- gzz/gzz/view/buoy/buoymanager.py:1.37       Thu Feb 13 10:46:23 2003
+++ gzz/gzz/view/buoy/buoymanager.py    Thu Feb 13 11:29:05 2003
@@ -17,8 +17,8 @@
 
 print "LOADING BUOYMANAGER"
 
-#lineconn = GLRen.createLineConnector(.5, .5, .5, .5, 0, 0, 0, 0, 0, 1)
-lineconn = GLRen.createSqFilletConnection(30, 1, .125, 6)
+lineconn = GLRen.createSqAndLineConnector(.5, .5, .5, .5, 0, 0, 0, 0, 0, 1, 
.3,  2,1)
+#lineconn = GLRen.createSqFilletConnection(30, 1, .125, 6)
 
 size = jarray.zeros(2, 'f')
 
@@ -81,7 +81,7 @@
        anchorUnit = self.vs.unitSqCS(anchorCS, "UN")
        anchorCenter = self.vs.translateCS(anchorUnit, "TR55", .5, .5)
        x = self.ctrx
-       r = self.ctry * 1.2
+       r = self.ctry * 1.125
        print "Linkreally: ",direction, otherNode
        if direction > 0:
            buoy = self.vs.coords.buoyOnCircle(0, anchorCenter,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]