Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9762/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
A space can contain more than one transformation
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.149
retrieving revision 1.150
diff -C2 -d -r1.149 -r1.150
*** View.java 15 Sep 2006 13:28:27 -0000 1.149
--- View.java 18 Sep 2006 08:19:34 -0000 1.150
***************
*** 32,35 ****
--- 32,36 ----
import java.util.ArrayList;
+ import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
***************
*** 994,1010 ****
*/
private void drawSpace(Space space, GLDrawable gld) {
-
- Transform t = space.getTransform();
-
gl.glPushMatrix();
!
! if (t != null) {
! gl.glTranslated(t.tx(), t.ty(), t.tz());
! gl.glRotated(t.rx(), 1, 0, 0);
! gl.glRotated(t.ry(), 0, 1, 0);
! gl.glRotated(t.rz(), 0, 0, 1);
! gl.glScaled(t.sx(), t.sy(), t.sz());
}
-
Collection surfaces = space.getSurfaces();
switch (drawMode) {
--- 995,1014 ----
*/
private void drawSpace(Space space, GLDrawable gld) {
gl.glPushMatrix();
! {
! List transforms = new LinkedList(space.getTransformations());
! Collections.reverse(transforms);
! Iterator iter = transforms.iterator();
! while (iter.hasNext()) {
! Transform t = (Transform) iter.next();
! if (t != null) {
! gl.glTranslated(t.tx(), t.ty(), t.tz());
! gl.glRotated(t.rx(), 1, 0, 0);
! gl.glRotated(t.ry(), 0, 1, 0);
! gl.glRotated(t.rz(), 0, 0, 1);
! gl.glScaled(t.sx(), t.sy(), t.sz());
! }
! }
}
Collection surfaces = space.getSurfaces();
switch (drawMode) {
|