[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz gfx/librenderables/renderables.py gzz/modul...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz gfx/librenderables/renderables.py gzz/modul... |
Date: |
Mon, 07 Oct 2002 05:36:18 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/07 05:36:17
Modified files:
gfx/librenderables: renderables.py
gzz/modules/pp : PlaneView.java demotest.py
gzz/modules/pp/vob: BgVob.java
Log message:
Clipping
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.99&tr2=1.100&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/PlaneView.java.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/demotest.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp/vob/BgVob.java.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
Patches:
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.99
gzz/gfx/librenderables/renderables.py:1.100
*** gzz/gfx/librenderables/renderables.py:1.99 Mon Oct 7 04:07:51 2002
--- gzz/gfx/librenderables/renderables.py Mon Oct 7 05:36:17 2002
***************
*** 140,157 ****
""",
},
{
! "Type" : "2",
! "Name" : "Viewport",
"Data" : "",
"Params" : "",
"ParamCode" : "",
"RenderCode" : """
- DBG(dbg) << "OpenViewport!!\\n";
- STKS
- glPushAttrib(GL_ENABLE_BIT);
- STKS
- glPushMatrix();
STKS
MATR
--- 140,153 ----
""",
},
+ # Clip to unit square with clip planes 0..3
{
! "Type" : "1",
! "Name" : "ClipSquare",
"Data" : "",
"Params" : "",
"ParamCode" : "",
"RenderCode" : """
STKS
MATR
***************
*** 164,171 ****
double clip[4][4] = {
! { 1, 0, 0, 1 },
! { 0, 1, 0, 1 },
{ -1, 0, 0, 1 },
{ 0, -1, 0, 1 }
};
--- 160,167 ----
double clip[4][4] = {
! { 1, 0, 0, 0 }, // Clip to unit square
! { 0, 1, 0, 0 },
{ -1, 0, 0, 1 },
{ 0, -1, 0, 1 }
};
***************
*** 179,220 ****
glEnable(GL_CLIP_PLANE2);
glEnable(GL_CLIP_PLANE3);
-
glPopMatrix();
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
-
""",
},
{
! "Type": "2", # Needs to be 2, to make sure interpolation works the same
! # as open...
! "Name" : "CloseViewport",
"Data" : "",
"Params" : "",
"ParamCode" : "",
"RenderCode" : """
- DBG(dbg) << "CloseViewport!\\n";
STKS
! GLERR
! glPopAttrib();
! GLERR
! glPopMatrix();
! GLERR
""",
},
--- 175,202 ----
glEnable(GL_CLIP_PLANE2);
glEnable(GL_CLIP_PLANE3);
glPopMatrix();
STKS
""",
},
+
{
! "Type": "1", # Needs to be 1, to make sure interpolation works the same
! # as open...
! "Name" : "StopClipSquare",
"Data" : "",
"Params" : "",
"ParamCode" : "",
"RenderCode" : """
STKS
! GLERR
!
! glDisable(GL_CLIP_PLANE0);
! glDisable(GL_CLIP_PLANE1);
! glDisable(GL_CLIP_PLANE2);
! glDisable(GL_CLIP_PLANE3);
!
! GLERR
""",
},
Index: gzz/gzz/modules/pp/PlaneView.java
diff -c gzz/gzz/modules/pp/PlaneView.java:1.48
gzz/gzz/modules/pp/PlaneView.java:1.49
*** gzz/gzz/modules/pp/PlaneView.java:1.48 Mon Oct 7 02:21:10 2002
--- gzz/gzz/modules/pp/PlaneView.java Mon Oct 7 05:36:17 2002
***************
*** 33,45 ****
import java.util.*;
import java.util.List;
import java.awt.*;
/** A scrollable plane with notes and a background. Can be integrated into a
* composite view to show associations.
*/
public class PlaneView {
! public static final String rcsid = "$Id: PlaneView.java,v 1.48 2002/10/07
06:21:10 tjl Exp $";
public static boolean dbg = true;
private static void pa(String s) { System.err.println(s); }
--- 33,46 ----
import java.util.*;
import java.util.List;
import java.awt.*;
+ import gzz.gfx.gl.GLVobCoorder;
/** A scrollable plane with notes and a background. Can be integrated into a
* composite view to show associations.
*/
public class PlaneView {
! public static final String rcsid = "$Id: PlaneView.java,v 1.49 2002/10/07
09:36:17 tjl Exp $";
public static boolean dbg = true;
private static void pa(String s) { System.err.println(s); }
***************
*** 62,68 ****
* @param into The coordinate system which has the paper coordinates to
*/
public VobScene renderPaper(VobScene vs, Cell cursor, int offsetInCell,
! int into, List leftBuoys, List rightBuoys) {
if(dbg) pa("GetPaperscene: "+cursor);
--- 63,69 ----
* @param into The coordinate system which has the paper coordinates to
*/
public VobScene renderPaper(VobScene vs, Cell cursor, int offsetInCell,
! int viewport2screen, int paper2viewport, List leftBuoys,
List rightBuoys) {
if(dbg) pa("GetPaperscene: "+cursor);
***************
*** 70,75 ****
--- 71,82 ----
Cell note = plane.s(Win.d_contains);
BgVob bg = BgVob.create(plane);
+ int bginto = vs.coords.coordsys(viewport2screen, 500, 0, 0, 1, 1);
+ int bgpap = vs.coords.coordsys(paper2viewport, 0, 0, 0, 100, 100);
+ vs.matcher.add(bginto, "BGTRANS");
+ vs.map.put(bg, bginto, bgpap);
+
+ int into = ((GLVobCoorder)vs.coords).concat(viewport2screen,
paper2viewport);
Space space = cursor.space;
Dim d_1 = space.getDim(Ids.d_1);
Index: gzz/gzz/modules/pp/demotest.py
diff -c gzz/gzz/modules/pp/demotest.py:1.3 gzz/gzz/modules/pp/demotest.py:1.4
*** gzz/gzz/modules/pp/demotest.py:1.3 Mon Oct 7 02:21:10 2002
--- gzz/gzz/modules/pp/demotest.py Mon Oct 7 05:36:17 2002
***************
*** 28,43 ****
ppactions.newNote(id, 0, 0, "Abksefvu21249")
class PlaneViewScene:
def __init__(self):
self.pv = PlaneView(VobKeyer())
! self.scale = 1
def scene(self, vs):
vs.map.put(background((0.4,0.5,0.8)))
! self.cs1 = vs.coords.affineCoordsys(0, 0, 100, 100, self.scale, 0, 0,
self.scale)
vs.matcher.add(self.cs1, "Global")
! self.pv.renderPaper(vs, cursor, -1, self.cs1, None, None)
self.currentvs = vs
def key(self, key):
pass
--- 28,55 ----
ppactions.newNote(id, 0, 0, "Abksefvu21249")
+ clip = GLRen.createClipSquare()
+ stopclip = GLRen.createStopClipSquare()
class PlaneViewScene:
def __init__(self):
self.pv = PlaneView(VobKeyer())
! self.scale = 0.01
def scene(self, vs):
vs.map.put(background((0.4,0.5,0.8)))
! self.clip = vs.coords.affineCoordsys(0, 0, 100, 100, 500, 0, 0, 300)
! vs.matcher.add(self.clip, "clip")
! # Viewport
! self.cs1 = vs.coords.affineCoordsys(0, 0, 100, 100, 600, 0, 0, 600)
! # Paper to viewport
! self.cs2 = vs.coords.affineCoordsys(0, 0, 0, 0, self.scale, 0, 0,
self.scale)
vs.matcher.add(self.cs1, "Global")
! vs.matcher.add(self.cs2, "p")
! vs.map.put(clip, self.cs1)
! self.pv.renderPaper(vs, cursor, -1, self.cs1, self.cs2, None, None)
! # vs.map.put(getDListNocoords("""Disable TEXTURE_2D"""))
! # vs.map.put(coloredQuad((1,0,0)), self.cs1)
! vs.map.put(stopclip, self.clip)
self.currentvs = vs
def key(self, key):
pass
***************
*** 49,56 ****
self.pscale = self.scale
elif ev.getID() == ev.MOUSE_DRAGGED:
self.scale = self.pscale * math.exp((self.press[1] -
ev.getY())/150.0)
! self.currentvs.coords.setAffineParams(self.cs1,
! 0, 100, 100, self.scale, 0, 0, self.scale)
replaceNewScene(self.currentvs)
AbstractUpdateManager.setNoAnimation()
AbstractUpdateManager.chg()
--- 61,68 ----
self.pscale = self.scale
elif ev.getID() == ev.MOUSE_DRAGGED:
self.scale = self.pscale * math.exp((self.press[1] -
ev.getY())/150.0)
! self.currentvs.coords.setAffineParams(self.cs2,
! 0, 0, 0, self.scale, 0, 0, self.scale)
replaceNewScene(self.currentvs)
AbstractUpdateManager.setNoAnimation()
AbstractUpdateManager.chg()
Index: gzz/gzz/modules/pp/vob/BgVob.java
diff -c gzz/gzz/modules/pp/vob/BgVob.java:1.26
gzz/gzz/modules/pp/vob/BgVob.java:1.27
*** gzz/gzz/modules/pp/vob/BgVob.java:1.26 Mon Oct 7 02:21:10 2002
--- gzz/gzz/modules/pp/vob/BgVob.java Mon Oct 7 05:36:17 2002
***************
*** 36,42 ****
* used to pan pretty easily.
*/
public class BgVob extends gzz.vob.Vob {
! public static final String rcsid = "$Id: BgVob.java,v 1.26 2002/10/07
06:21:10 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 36,42 ----
* used to pan pretty easily.
*/
public class BgVob extends gzz.vob.Vob {
! public static final String rcsid = "$Id: BgVob.java,v 1.27 2002/10/07
09:36:17 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 84,90 ****
Paper pap;
GLRen.PaperQuad pq;
pap = PaperMill.getInstance().getPaper(c.hashCode());
! ret = GLRen.createPaperQuad(pap, -1, -1, 1, 1, 0);
papers.put(c, ret);
list = GL.createDisplayList(
--- 84,90 ----
Paper pap;
GLRen.PaperQuad pq;
pap = PaperMill.getInstance().getPaper(c.hashCode());
! ret = GLRen.createPaperQuad(pap, 0, 0, 1, 1, 0);
papers.put(c, ret);
list = GL.createDisplayList(
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz gfx/librenderables/renderables.py gzz/modul...,
Tuomas J. Lukka <=