Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6689/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
Refactored transform into scale, translate and rotate
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.150
retrieving revision 1.151
diff -C2 -d -r1.150 -r1.151
*** View.java 18 Sep 2006 08:19:34 -0000 1.150
--- View.java 19 Sep 2006 10:00:18 -0000 1.151
***************
*** 24,29 ****
--- 24,32 ----
import net.sourceforge.bprocessor.model.Point;
import net.sourceforge.bprocessor.model.Project;
+ import net.sourceforge.bprocessor.model.Rotate;
+ import net.sourceforge.bprocessor.model.Scale;
import net.sourceforge.bprocessor.model.Selection;
import net.sourceforge.bprocessor.model.Space;
+ import net.sourceforge.bprocessor.model.Translate;
import net.sourceforge.bprocessor.model.Vertex;
import net.sourceforge.bprocessor.model.Surface;
***************
*** 1001,1011 ****
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());
}
}
--- 1004,1021 ----
Iterator iter = transforms.iterator();
while (iter.hasNext()) {
! Transform current = (Transform) iter.next();
! if (current instanceof Translate) {
! Translate translate = (Translate) current;
! gl.glTranslated(translate.tx(), translate.ty(), translate.tz());
! }
! if (current instanceof Scale) {
! Scale scale = (Scale) current;
! gl.glScaled(scale.sx(), scale.sy(), scale.sz());
! }
! if (current instanceof Rotate) {
! Rotate rotate = (Rotate) current;
! gl.glRotated(rotate.rx(), 1, 0, 0);
! gl.glRotated(rotate.ry(), 0, 1, 0);
! gl.glRotated(rotate.rz(), 0, 0, 1);
}
}
|