gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz Documentation/Manuscripts/Irregu/irregu.tex...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz Documentation/Manuscripts/Irregu/irregu.tex...
Date: Wed, 20 Nov 2002 14:22:20 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/11/20 14:22:20

Modified files:
        Documentation/Manuscripts/Irregu: irregu.tex 
        gfx/demo/opengl: imaging.py 
        gfx/librenderables: renderables.py 

Log message:
        twid

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Documentation/Manuscripts/Irregu/irregu.tex.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/opengl/imaging.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.146&tr2=1.147&r1=text&r2=text

Patches:
Index: gzz/Documentation/Manuscripts/Irregu/irregu.tex
diff -u gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.63 
gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.64
--- gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.63        Wed Nov 20 
10:26:24 2002
+++ gzz/Documentation/Manuscripts/Irregu/irregu.tex     Wed Nov 20 14:22:20 2002
@@ -121,15 +121,6 @@
 in all cases, the irregular shape of the viewport matches the shape of an
 actual irregular object
 
----
-
-In diagrams and engineering drawings, tearing...
-has been used to show that an object extends beyond 
-the part that is drawn.
-
-
----
-
 Windowing systems usually non-photorealistic. Clearer, etc.
 However, the understanding of non-photorealism has been developing
 only recently... more photorealism could be distracting... too much
@@ -182,6 +173,7 @@
 \centering
 \fbox{\vbox{\vskip 3in}}
 \caption{
+\label{fig-breakout}
 a) Break out lines, b) a break out section.
 Freehand lines have been long used in engineering drawings
 to indicate that an object extends beyond the shown part.
@@ -190,6 +182,10 @@
 
 In this article, we apply {\em break lines} or {\em break out section}s
 from technical drawing to viewports.
+Break lines or break out sections (see Fig.~\ref{fig-breakout})
+are freehand lines drawn to indicate
+that an object extends beyond the drawn part.
+
 Instead of framing a part viewport to the canvas,
 we tear a part of the canvas non-photorealistically.
 In the following sections, we first describe the reasons and design issues and
Index: gzz/gfx/demo/opengl/imaging.py
diff -u gzz/gfx/demo/opengl/imaging.py:1.2 gzz/gfx/demo/opengl/imaging.py:1.3
--- gzz/gfx/demo/opengl/imaging.py:1.2  Sun Nov 10 04:40:22 2002
+++ gzz/gfx/demo/opengl/imaging.py      Wed Nov 20 14:22:20 2002
@@ -11,8 +11,8 @@
     def scene(self, vs):
        vs.map.put(background((0, .1, 0)))
 
-       sx = 600
-       sy = 600
+       sx = 300
+       sy = 300
 
 
        f1cs = vs.orthoCS(0, "X", 50, 100*c.nextDouble(), 100*c.nextDouble(), 
200, 100)
@@ -30,7 +30,8 @@
            Disable ALPHA_TEST
            Disable BLEND
            ReadBuffer BACK
-           SeparableFilter2D SEPARABLE_2D LUMINANCE 3 3 LUMINANCE 1 -2 1 .5 -1 
.5
+           SeparableFilter2D SEPARABLE_2D RGB 3 3 LUMINANCE 1 -2 1 .5 -1 .5
+
            ConvolutionParameter SEPARABLE_2D CONVOLUTION_BORDER_MODE 
REPLICATE_BORDER
            ConvolutionFilter2D CONVOLUTION_2D LUMINANCE 2 2 LUMINANCE .5 -.6 
-.3 .4
            ConvolutionParameter CONVOLUTION_2D CONVOLUTION_BORDER_MODE 
REPLICATE_BORDER
@@ -40,8 +41,8 @@
                    -.2 .9 -.5 \
                    -.4 -.4 .3
 
-           Enable SEPARABLE_2D
-           Enable CONVOLUTION_2D
+           Disable SEPARABLE_2D
+           Disable CONVOLUTION_2D
            PixelTransfer POST_CONVOLUTION_RED_BIAS .5
            PixelTransfer POST_CONVOLUTION_RED_SCALE 3000
            PixelTransfer POST_CONVOLUTION_GREEN_BIAS .5
@@ -49,20 +50,30 @@
            PixelTransfer POST_CONVOLUTION_BLUE_BIAS .5
            PixelTransfer POST_CONVOLUTION_BLUE_SCALE 3000
 
+           Disable ALPHA_TEST
+           Disable BLEND
+
            ColorTableEXT POST_CONVOLUTION_COLOR_TABLE LUMINANCE 4 LUMINANCE \
                1 0 0 1
-           Disable POST_CONVOLUTION_COLOR_TABLE
            Enable POST_CONVOLUTION_COLOR_TABLE
+           Disable POST_CONVOLUTION_COLOR_TABLE
        """))
 
-       getp = GLRen.createReadPixels(sx, sy,
-                   "DEPTH_COMPONENT", "UNSIGNED_INT", self.bv)
-       putp = GLRen.createDrawPixels(sx, sy,
-                   "LUMINANCE", "UNSIGNED_INT", self.bv)
-
-       cs = vs.orthoCS(0, "dp", 0, 20, sy-20, 1, 1)
-       vs.map.put(getp, cs)
-       vs.map.put(putp, cs)
+       cs = vs.orthoCS(0, "dp", 0, 20, sy+10, 1, 1)
+       cs2 = vs.orthoCS(0, "dp2", 300, 300, sy+10, 1, 1)
+       if 1:
+           getp = GLRen.createReadPixels(sx, sy,
+                       "RGBA", "UNSIGNED_BYTE", self.bv)
+           putp = GLRen.createDrawPixels(sx, sy,
+                       "RGBA", "UNSIGNED_BYTE", self.bv)
+
+           vs.map.put(getp, cs)
+           vs.map.put(putp, cs2)
+       else:
+
+           copyp = GLRen.createCopyPixels(sx, sy, "DEPTH_STENCIL_TO_BGRA_NV")
+           copyp = GLRen.createCopyPixels(sx, sy, "COLOR")
+           vs.map.put(copyp, cs, cs2)
 
        vs.map.put(getDListNocoords("""
            PopAttrib
Index: gzz/gfx/librenderables/renderables.py
diff -u gzz/gfx/librenderables/renderables.py:1.146 
gzz/gfx/librenderables/renderables.py:1.147
--- gzz/gfx/librenderables/renderables.py:1.146 Wed Nov 13 15:52:12 2002
+++ gzz/gfx/librenderables/renderables.py       Wed Nov 20 14:22:20 2002
@@ -172,6 +172,38 @@
 },
 
 {
+    "Type": "2",
+    "Name": "CopyPixels",
+    "Data" : "GLenum type; int w,h; ",
+    "Params" : "int w, int h,  GLToken type",
+    "ParamCode" : """
+       this->w = w;
+       this->h = h;
+       this->type = type;
+    """,
+    "RenderCode" : """
+       glPushAttrib(GL_PIXEL_MODE_BIT);
+       glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+       glPixelStorei(GL_PACK_ROW_LENGTH, 0);
+       glPixelStorei(GL_PACK_ALIGNMENT, 1);
+
+       ZPt pfrom = coords1.transform(ZPt(0,0,0));
+       glRasterPos3f(pfrom.x, pfrom.y, pfrom.z);
+       float ras[4];
+       glGetFloatv(GL_CURRENT_RASTER_POSITION, ras);
+
+       ZPt p = coords2.transform(ZPt(0,0,0));
+       glRasterPos3f(p.x, p.y, p.z);
+
+       glCopyPixels((int)ras[0], (int)ras[1], w, h, type);
+       GLERR
+       glPopClientAttrib();
+       glPopAttrib();
+    """,
+},
+
+
+{
     "Type": "1",
     "Name" : "TextureMatrix",
     "RenderCode" : """




reply via email to

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