/[gzz]/gzz/gfx/librenderables/renderables.py
ViewVC logotype

Diff of /gzz/gfx/librenderables/renderables.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.110 by jvk, Tue Oct 22 13:23:17 2002 UTC revision 1.111 by tjl, Tue Oct 22 16:28:22 2002 UTC
# Line 103  rs = [ Line 103  rs = [
103              """,              """,
104  },  },
105    
106    
107    
108  {  {
109      "Type": "1",      "Type": "1",
110      "Name" : "TextureMatrix",      "Name" : "TextureMatrix",
# Line 290  rs = [ Line 292  rs = [
292    
293  {  {
294      "Type": "2",      "Type": "2",
295        "Name": "SqFilletConnection",
296        "Data": "float width;",
297        "Params": "float width",
298        "ParamCode": "this->width = width;",
299        "RenderCode" : """
300                vector<ZPt> sq1;
301                vector<ZPt> sq2;
302                Fillet::transformOutline(
303                    unitsquare + 0, unitsquare + 4,
304                    back_inserter(sq1),
305                    coords1);
306                Fillet::transformOutline(
307                    unitsquare + 0, unitsquare + 4,
308                    back_inserter(sq2),
309                    coords2);
310                ZPt ctr1 = coords1.transform(ZPt(.5, .5, 0));
311                ZPt ctr2 = coords2.transform(ZPt(.5, .5, 0));
312                ZPt mid = 0.5*(ctr1 + ctr2);
313    
314                Fillet::FilletDistort d1(ctr1, mid, width);
315                Fillet::FilletDistort d2(ctr2, mid, width);
316    
317                vector<ZPt> o1;
318                if(!Fillet::blendEdge(sq1.begin(), sq1.end(),
319                            back_inserter(o1), ctr1, mid, d1)) {
320                    DBG(dbg) << "Blendedge failed! 1" <<ctr1<<" "<<mid<<"\\n";
321                    return;
322                }
323    
324                vector<ZPt> o2;
325                if(!Fillet::blendEdge(sq2.begin(), sq2.end(),
326                            back_inserter(o2), ctr2, mid, d2)) {
327                    DBG(dbg) << "Blendedge failed! 2" <<ctr2<<" "<<mid<<"\\n";
328                    return;
329                }
330    
331                glBegin(GL_LINE_STRIP);
332                for(unsigned i=0; i<o1.size(); i++)
333                    glVertex(o1[i]);
334                glEnd();
335                GLERR
336    
337                glBegin(GL_LINE_STRIP);
338                for(unsigned i=0; i<o2.size(); i++)
339                    glVertex(o2[i]);
340                glEnd();
341                GLERR
342    
343            """
344    },
345    
346    
347    {
348        "Type": "2",
349      "Name": "BevelConnection",      "Name": "BevelConnection",
350      "Data": "int objid, profile, drawConn; float profw;",      "Data": "int objid, profile, drawConn; float profw;",
351      "Params": "int objid, int profile, int drawConn, float profw",      "Params": "int objid, int profile, int drawConn, float profw",

Legend:
Removed from v.1.110  
changed lines
  Added in v.1.111

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26