[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java,1.48,1.49
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-01-19 10:57:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27954/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Added capabillity for orthographic view and converted all the 2D views to orthographic. It is a type modifier in Camera Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** View.java 18 Jan 2006 09:43:36 -0000 1.48 --- View.java 19 Jan 2006 10:57:22 -0000 1.49 *************** *** 2140,2147 **** double focalwidth = camera.getFocalwidth(); if (aspect < 1.0) { ! // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(aspect * focalwidth, 1.0, near, far); } else { ! glu.gluPerspective(focalwidth, aspect, near, far); } --- 2140,2157 ---- double focalwidth = camera.getFocalwidth(); if (aspect < 1.0) { ! if (camera.getType() == Camera.ORTHOGRAPHIC) { ! double tal = Math.tan(focalwidth) * length; ! gl.glOrtho(tal, -tal, tal, -tal, near, far); //TODO find the best pararms ! } else if (camera.getType() == Camera.PERSPECTIVE) { ! // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(aspect * focalwidth, 1.0, near, far); ! } } else { ! if (camera.getType() == Camera.ORTHOGRAPHIC) { ! double tal = Math.tan(focalwidth) * length; ! gl.glOrtho(tal, -tal, tal, -tal, near, far); ! } else if (camera.getType() == Camera.PERSPECTIVE) { ! glu.gluPerspective(focalwidth, aspect, near, far); ! } } |