/[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.99 by tjl, Mon Oct 7 08:07:51 2002 UTC revision 1.100 by tjl, Mon Oct 7 09:36:17 2002 UTC
# Line 140  rs = [ Line 140  rs = [
140              """,              """,
141  },  },
142    
143    # Clip to unit square with clip planes 0..3
144  {  {
145      "Type" : "2",      "Type" : "1",
146      "Name" : "Viewport",      "Name" : "ClipSquare",
147      "Data" : "",      "Data" : "",
148      "Params" : "",      "Params" : "",
149      "ParamCode" : "",      "ParamCode" : "",
150      "RenderCode" : """      "RenderCode" : """
         DBG(dbg) << "OpenViewport!!\\n";  
         STKS  
         glPushAttrib(GL_ENABLE_BIT);  
         STKS  
         glPushMatrix();  
151          STKS          STKS
152    
153          MATR          MATR
# Line 164  rs = [ Line 160  rs = [
160    
161    
162              double clip[4][4] = {              double clip[4][4] = {
163                  { 1, 0, 0, 1 },                  { 1, 0, 0, 0 }, // Clip to unit square
164                  { 0, 1, 0, 1 },                  { 0, 1, 0, 0 },
165                  { -1, 0, 0, 1 },                  { -1, 0, 0, 1 },
166                  { 0, -1, 0, 1 }                  { 0, -1, 0, 1 }
167              };              };
# Line 179  rs = [ Line 175  rs = [
175              glEnable(GL_CLIP_PLANE2);              glEnable(GL_CLIP_PLANE2);
176              glEnable(GL_CLIP_PLANE3);              glEnable(GL_CLIP_PLANE3);
177    
   
178          glPopMatrix();          glPopMatrix();
179          STKS          STKS
   
         // Then, go into the second coordinate system.  
         MATR  
         if(dbg) coords2.dump();  
         coords2.performGL();  
         MATR  
         ZPt zp = coords1.transform(ZPt(0,0,0));  
         glTranslatef(0, 0, -zp.z-1);  
         glScalef(1, 1, 0.01);  
         MATR  
         glTranslatef(0, 0, zp.z-1);  
         MATR  
         STKS  
   
             GLERR  
   
180          """,          """,
181  },  },
182    
183  {  {
184      "Type": "2", # Needs to be 2, to make sure interpolation works the same      "Type": "1", # Needs to be 1, to make sure interpolation works the same
185                  # as open...                      # as open...
186      "Name" : "CloseViewport",      "Name" : "StopClipSquare",
187      "Data" : "",      "Data" : "",
188      "Params" : "",      "Params" : "",
189      "ParamCode" : "",      "ParamCode" : "",
190      "RenderCode" : """      "RenderCode" : """
         DBG(dbg) << "CloseViewport!\\n";  
191          STKS          STKS
192              GLERR          GLERR
193          glPopAttrib();  
194              GLERR          glDisable(GL_CLIP_PLANE0);
195          glPopMatrix();          glDisable(GL_CLIP_PLANE1);
196              GLERR          glDisable(GL_CLIP_PLANE2);
197            glDisable(GL_CLIP_PLANE3);
198    
199            GLERR
200          """,          """,
201  },  },
202    

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.100

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