[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gzz/vob VobScene.java
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz/gzz/vob VobScene.java |
Date: |
Fri, 22 Nov 2002 10:31:11 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/11/22 10:31:11
Modified files:
gzz/vob : VobScene.java
Log message:
more Vob tutorial
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/VobScene.java.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Patches:
Index: gzz/gzz/vob/VobScene.java
diff -u gzz/gzz/vob/VobScene.java:1.17 gzz/gzz/vob/VobScene.java:1.18
--- gzz/gzz/vob/VobScene.java:1.17 Fri Nov 22 10:23:11 2002
+++ gzz/gzz/vob/VobScene.java Fri Nov 22 10:31:11 2002
@@ -80,8 +80,34 @@
// A translation RELATIVE to cs: the origin of cs_t is at (150, 125) on
screen.
int cs_t = vs.coords.translate(0, .5, .5, 0);
-
+ vs.matcher.add(cs, "V1");
+ // Sub key
+ vs.matcher.add(cs, cs_t, "X");
</pre>
+ Now, cs_t will only be interpolated to a coordinate system whose parent is
interpolated
+ to cs, and whose key is "X".
+ Here, both hierarchies were parallel, and indeed, usually they are. But
sometimes
+ non-parallel hierarchies are useful. For example, if we are placing images
next to a map
+ and markers on the map about where those images are, it's easier to do
+ <pre>
+ void placeImage(int imageCS, int mapCS, String param) {
+ // Place image into the image coordsys
+ // ...
+ int marker_cs = vs.coords.ortho(mapCS, 0, markx, marky, w, h);
+ vs.matcher.add(imageCS, marker_cs, "MARK");
+ }
+ </pre>
+ Here, the marker <i>transformation</i> is a child of the map
transformation, but
+ as a <i>keyframe object,</i> for matching, its parent is imageCS.
+ This allows us to use the constant key "MARK" for all the marks.
+ <p>
+ However, you'll probably see this situation pretty rarely; most often the
hierarchies
+ are indeed parallel, and for that case VobScene provides a shortcut:
+ <pre>
+ int cs = vs.orthoCS(0, "V1", 0, 100, 100, 100, 50);
+ int cs_t = vs.translateCS(cs, "X", .5, .5, 0);
+ </pre>
+ has the same effect as the earlier code.
* <p>
*
*/
- [Gzz-commits] gzz/gzz/vob VobScene.java,
Tuomas J. Lukka <=