/[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.24 by jvk, Thu Sep 12 18:44:11 2002 UTC revision 1.25 by jvk, Fri Sep 13 13:40:59 2002 UTC
# Line 512  rs = [ Line 512  rs = [
512  }    ,  }    ,
513    
514  {  {
515        "Type" : "2",
516        "Name": "BasisPaperQuad",
517        "Data": "Paper::Paper* paper; ",
518        "Params" : """
519                Paper paper
520            """,
521        "ParamCode" : """
522                this->paper = paper;
523            """,
524        "RenderCode" : """
525                DBG(dbg) << "Paper\\n";
526                GLERR
527    
528                ZPt c1orig = coords1.transform(Pt(0, 0));
529                ZVec c1x =  coords1.transform(Pt(1, 0)) - c1orig;
530                ZVec c1y =  coords1.transform(Pt(0, 1)) - c1orig;
531    
532                c1x = 1.0 / (c1x.x * c1x.x + c1x.y * c1x.y) * c1x;
533                c1y = 1.0 / (c1y.x * c1y.x + c1y.y * c1y.y) * c1y;
534    
535                ZPt c2orig = coords2.transform(Pt(0, 0));
536                ZVec c2x =  coords2.transform(Pt(1, 0)) - c2orig;
537                ZVec c2y =  coords2.transform(Pt(0, 1)) - c2orig;
538    
539                c2x = 1.0 / (c2x.x * c2x.x + c2x.y * c2x.y) * c2x;
540                c2y = 1.0 / (c2y.x * c2y.x + c2y.y * c2y.y) * c2y;
541    
542    
543                //cout << c1orig << c1x << c1y << "\\n";
544                //cout << c2orig << c2x << c2y << "\\n";
545    
546                for(Paper::Paper::iterator it = paper->begin(); it != paper->end(); ++it) {
547                    if (dbg) cout << "Pass\\n";
548                    (*it).setupcode();
549    
550                    GLERR
551    
552                    Pt p[] = { Pt(0,0), Pt(0,1), Pt(1,1), Pt(1,0) };
553    
554                    glBegin(GL_QUADS);
555    
556                    for (int i = 0; i < 4; i++) {
557                        ZPt v = coords1.transform(p[i]);
558                        glMultiTexCoord2fARB(0, p[i].x, p[i].y);
559                        glMultiTexCoord2fARB(1, c2x.dot(v - c2orig),
560                                                c2y.dot(v - c2orig));
561                        //cout << Pt(c2x.dot(v - c2orig),
562                        //           c2y.dot(v - c2orig)) << "\\n";
563                        coords1.vertex(p[i]);
564                    }
565    
566                     for (int i = 0; i < 4; i++) {
567                        ZPt v = coords2.transform(p[i]);
568                        glMultiTexCoord2fARB(1, p[i].x, p[i].y);
569                        glMultiTexCoord2fARB(0, c1x.dot(v - c1orig),
570                                                c1y.dot(v - c1orig));
571                        //cout << Pt(c1x.dot(v - c1orig),
572                        //           c1y.dot(v - c1orig)) << "\\n";
573                        coords2.vertex(p[i]);
574                    }
575    
576                    glEnd();
577    
578    
579    
580                    GLERR
581                    (*it).teardowncode();
582                    GLERR
583    
584                }
585    
586                GLERR
587            """,
588    }    ,
589    
590    {
591      "Type": "1",      "Type": "1",
592      "Name": "HorizText",      "Name": "HorizText",
593      "Data": """      "Data": """

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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