You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(116) |
May
(220) |
Jun
(52) |
Jul
(30) |
Aug
(35) |
Sep
(24) |
Oct
(49) |
Nov
(44) |
Dec
(70) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(21) |
Feb
(30) |
Mar
(9) |
Apr
(44) |
May
(2) |
Jun
|
Jul
(10) |
Aug
(20) |
Sep
(25) |
Oct
(12) |
Nov
(16) |
Dec
(4) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(10) |
2006 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(33) |
2007 |
Jan
(4) |
Feb
(57) |
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ma...@us...> - 2003-04-12 01:57:33
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv9929/src/org/jrman/parser Modified Files: Parser.java Log Message: Fixed comment.... Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Parser.java 12 Apr 2003 01:55:45 -0000 1.18 --- Parser.java 12 Apr 2003 01:57:28 -0000 1.19 *************** *** 341,345 **** public void worldBegin() { pushState(State.WORLD); ! saveCurrentTransformAs("camera"); // from "world" to "raster" setIdentity(); } --- 341,345 ---- public void worldBegin() { pushState(State.WORLD); ! saveCurrentTransformAs("camera"); // from "world" to "camera" setIdentity(); } |
From: <ma...@us...> - 2003-04-12 01:55:49
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv9571/src/org/jrman/parser Modified Files: Parser.java Log Message: Implemented all basic transforms. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Parser.java 12 Apr 2003 00:13:49 -0000 1.17 --- Parser.java 12 Apr 2003 01:55:45 -0000 1.18 *************** *** 341,345 **** public void worldBegin() { pushState(State.WORLD); ! saveCurrentTransformAs("camera"); setIdentity(); } --- 341,345 ---- public void worldBegin() { pushState(State.WORLD); ! saveCurrentTransformAs("camera"); // from "world" to "raster" setIdentity(); } *************** *** 447,452 **** options.getFarClipping())); } ! saveCurrentTransformAs("screen"); ! currentAttributes.setTransform(AffineTransform.IDENTITY); } --- 447,454 ---- options.getFarClipping())); } ! saveCurrentTransformAs("screen"); // from "camera" to "screen" ! setIdentity(); ! scene.setTransform("raster", options.getRasterTransform()); // from "screen" to "raster" ! scene.setTransform("NDC", options.getNDCTransform()); // from "raster" to "NDC" } |
From: <ma...@us...> - 2003-04-12 01:55:48
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv9571/src/org/jrman/geom Modified Files: AffineTransform.java Log Message: Implemented all basic transforms. Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AffineTransform.java 11 Apr 2003 04:22:32 -0000 1.3 --- AffineTransform.java 12 Apr 2003 01:55:45 -0000 1.4 *************** *** 21,24 **** --- 21,25 ---- import javax.vecmath.Matrix4f; + import javax.vecmath.Point2f; import javax.vecmath.Point3f; import javax.vecmath.Point4f; *************** *** 179,182 **** --- 180,238 ---- } return inverseNormalsMatrix; + } + + public static Transform createRaster( + Bounds2f screenWindow, + float frameAspectRatio, + int horizontalResolution, + int verticalResolution, + float pixelAspectRatio) { + float imageAspectRatio = + (horizontalResolution * pixelAspectRatio) / verticalResolution; + if (imageAspectRatio < frameAspectRatio) + verticalResolution = + (int) ((horizontalResolution * pixelAspectRatio) / frameAspectRatio); + else if (imageAspectRatio > frameAspectRatio) + horizontalResolution = + (int) ((verticalResolution * frameAspectRatio) / pixelAspectRatio); + // Doesn't handle "flipped" screen window + Point2f min = screenWindow.getMin(); + Point2f max = screenWindow.getMax(); + Matrix4f m = new Matrix4f(); + Matrix4f tmp = + new Matrix4f( + horizontalResolution / (max.x - min.x), + 0f, + 0f, + 0f, + 0f, + verticalResolution / (max.y - min.y), + 0f, + 0f, + 0f, + 0f, + 1f, + 0f, + 0f, + 0f, + 0f, + 1f); + m.mul(tmp); + tmp = new Matrix4f(); + tmp.setTranslation(new Vector3f(0f, max.y - min.y, 0f)); + m.mul(tmp); + tmp = new Matrix4f(1f, 0f, 0f, 0f, 0f, -1f, 0f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f, 1f); + m.mul(tmp); + tmp.setTranslation(new Vector3f(-min.x, -min.y, 0f)); + m.mul(tmp); + return new AffineTransform(m); + } + + public static Transform createNDC(int horizontalResolution, int verticalResolution) { + Matrix4f m = new Matrix4f(1f / horizontalResolution, 0f, 0f, 0f, + 0f, 1f / verticalResolution, 0f, 0f, + 0f, 0f, 1f, 0f, + 0f, 0f, 0f, 1f); + return new AffineTransform(m); } |
From: <ma...@us...> - 2003-04-12 01:55:48
|
Update of /cvsroot/jrman/drafts/src/org/jrman/options In directory sc8-pr-cvs1:/tmp/cvs-serv9571/src/org/jrman/options Modified Files: Options.java Log Message: Implemented all basic transforms. Index: Options.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/Options.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Options.java 12 Apr 2003 00:13:48 -0000 1.4 --- Options.java 12 Apr 2003 01:55:45 -0000 1.5 *************** *** 22,26 **** --- 22,30 ---- import java.util.Map; + import javax.vecmath.Point2f; + + import org.jrman.geom.AffineTransform; import org.jrman.geom.Bounds2f; + import org.jrman.geom.Transform; import org.jrman.shaders.*; *************** *** 132,135 **** --- 136,146 ---- screenWindow = new Bounds2f(-h, h, -h / frameAspectRatio, h / frameAspectRatio); + } else { + Point2f min = screenWindow.getMin(); + Point2f max = screenWindow.getMax(); + // Doesn't handle "flipped" screen window + float width = max.x - min.x; + float height = max.y - min.y; + frameAspectRatio = width / height; } } *************** *** 411,414 **** --- 422,438 ---- public void setHiderParameters(Map map) { hiderParameters = map; + } + + public Transform getRasterTransform() { + return AffineTransform.createRaster( + screenWindow, + frameAspectRatio, + horizontalResolution, + verticalResolution, + pixelAspectRatio); + } + + public Transform getNDCTransform() { + return AffineTransform.createNDC(horizontalResolution, verticalResolution); } |
From: <ma...@us...> - 2003-04-12 00:13:53
|
Update of /cvsroot/jrman/drafts/src/org/jrman/options In directory sc8-pr-cvs1:/tmp/cvs-serv14509/src/org/jrman/options Modified Files: Options.java Log Message: Implemented attributes keyword. Index: Options.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/Options.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Options.java 11 Apr 2003 22:23:10 -0000 1.3 --- Options.java 12 Apr 2003 00:13:48 -0000 1.4 *************** *** 20,23 **** --- 20,25 ---- package org.jrman.options; + import java.util.Map; + import org.jrman.geom.Bounds2f; import org.jrman.shaders.*; *************** *** 83,86 **** --- 85,90 ---- private Hider hider; + private Map hiderParameters; + private int colorSamples; *************** *** 123,127 **** float h = (float) Math.tan(Math.PI * fieldOfView / 360f); if (frameAspectRatio >= 1f) ! screenWindow = new Bounds2f(-frameAspectRatio * h, frameAspectRatio * h, -h, h); else screenWindow = --- 127,132 ---- float h = (float) Math.tan(Math.PI * fieldOfView / 360f); if (frameAspectRatio >= 1f) ! screenWindow = ! new Bounds2f(-frameAspectRatio * h, frameAspectRatio * h, -h, h); else screenWindow = *************** *** 355,364 **** } - public float[] getTimes() { - float[] result = new float[times.length]; - System.arraycopy(times, 0, result, 0, times.length); - return result; - } - public void setFieldOfView(float f) { fieldOfView = f; --- 360,363 ---- *************** *** 366,373 **** } - public void setTimes(float[] fs) { - times = fs; - } - public int getOriginX() { return originX; --- 365,368 ---- *************** *** 408,411 **** --- 403,414 ---- public void setGridSize(int i) { gridSize = i; + } + + public Map getHiderParameters() { + return hiderParameters; + } + + public void setHiderParameters(Map map) { + hiderParameters = map; } |
From: <ma...@us...> - 2003-04-12 00:13:53
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv14509/src/org/jrman/parser Modified Files: Parser.java Log Message: Implemented attributes keyword. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Parser.java 11 Apr 2003 22:50:10 -0000 1.16 --- Parser.java 12 Apr 2003 00:13:49 -0000 1.17 *************** *** 508,511 **** --- 508,512 ---- public void setHider(String type, Map parameters) { options.setHider(Hider.getNamed(type)); + options.setHiderParameters(parameters); } *************** *** 528,533 **** public void setAttribute(String name, Map parameters) { ! // TODO Auto-generated method stub ! } --- 529,548 ---- public void setAttribute(String name, Map parameters) { ! if (name.equals("displacementbound")) { ! float[][] sphere = (float[][]) parameters.get("sphere"); ! if (sphere != null) ! currentAttributes.setDisplacementBound(sphere[0][0]); ! String[][] coordinatesystem = (String[][]) parameters.get("coordinatesystem"); ! if (coordinatesystem != null) ! currentAttributes.setDisplacementBoundCoordinateSystem(coordinatesystem[0][0]); ! } else if (name.equals("identifier")) { ! String[][] oname = (String[][]) parameters.get("name"); ! if (oname != null) ! currentAttributes.setObjectIdentifer(oname[0][0]); ! } else if (name.equals("trimcurve")) { ! String[][] sense = (String[][]) parameters.get("sense"); ! if (sense != null) ! currentAttributes.setTrimCurveSense(TrimCurveSense.getNamed(sense[0][0])); ! } } |
From: <ma...@us...> - 2003-04-11 22:50:16
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv15338/src/org/jrman/parser Modified Files: Parser.java Log Message: Fixed bugs in parsing parameter lists and area light source (detected parsing illum2.rib) Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Parser.java 11 Apr 2003 22:23:09 -0000 1.15 --- Parser.java 11 Apr 2003 22:50:10 -0000 1.16 *************** *** 527,529 **** --- 527,534 ---- } + public void setAttribute(String name, Map parameters) { + // TODO Auto-generated method stub + + } + } |
From: <ma...@us...> - 2003-04-11 22:50:16
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv15338/src/org/jrman/parser/keywords Modified Files: KeywordAttribute.java KeywordAreaLightSource.java AbstractKeywordParser.java Log Message: Fixed bugs in parsing parameter lists and area light source (detected parsing illum2.rib) Index: KeywordAttribute.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordAttribute.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordAttribute.java 7 Apr 2003 08:24:26 -0000 1.2 --- KeywordAttribute.java 11 Apr 2003 22:50:09 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- package org.jrman.parser.keywords; + import java.util.Map; + import org.jrman.parser.Tokenizer; *************** *** 27,33 **** // Expect sname match(st, TK_STRING); ! // Expect parameter list ! parseParameterList(st); } --- 29,36 ---- // Expect sname match(st, TK_STRING); ! String name = st.sval; // Expect parameter list ! Map parameters = parseParameterList(st); ! parser.setAttribute(name, parameters); } Index: KeywordAreaLightSource.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordAreaLightSource.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordAreaLightSource.java 7 Apr 2003 08:24:20 -0000 1.2 --- KeywordAreaLightSource.java 11 Apr 2003 22:50:10 -0000 1.3 *************** *** 26,30 **** public void parse(Tokenizer st) throws Exception { // Expect name ! match(st, TK_NUMBER); // Expect sequence number --- 26,30 ---- public void parse(Tokenizer st) throws Exception { // Expect name ! match(st, TK_STRING); // Expect sequence number Index: AbstractKeywordParser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/AbstractKeywordParser.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractKeywordParser.java 9 Apr 2003 05:04:58 -0000 1.5 --- AbstractKeywordParser.java 11 Apr 2003 22:50:10 -0000 1.6 *************** *** 255,261 **** while (st.nextToken() == TK_STRING) { list.add(st.sval); ! if (st.nextToken() == TK_LBRACE) { st.pushBack(); list.add(parseArray(st)); } } --- 255,270 ---- while (st.nextToken() == TK_STRING) { list.add(st.sval); ! int token = st.nextToken(); ! if (token == TK_LBRACE) { st.pushBack(); list.add(parseArray(st)); + } else if (token == TK_NUMBER) { + List array = new ArrayList(); + array.add(new Float((float) st.nval)); + list.add(array); + } else if (token == TK_STRING) { + List array = new ArrayList(); + array.add(st.sval); + list.add(array); } } |
From: <ma...@us...> - 2003-04-11 22:23:43
|
Update of /cvsroot/jrman/drafts/src/org/jrman/options In directory sc8-pr-cvs1:/tmp/cvs-serv2197/src/org/jrman/options Modified Files: Display.java Options.java Removed Files: Imager.java Log Message: Now parses and handles almost all option keywords. Index: Display.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/Display.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Display.java 9 Apr 2003 05:04:58 -0000 1.1 --- Display.java 11 Apr 2003 22:23:10 -0000 1.2 *************** *** 105,108 **** --- 105,113 ---- this.mode = mode; } + + public Display(String name, String type, String mode){ + this(name, Type.getNamed(type), Mode.getNamed(mode)); + } + public Mode getMode() { return mode; Index: Options.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/Options.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Options.java 11 Apr 2003 04:22:32 -0000 1.2 --- Options.java 11 Apr 2003 22:23:10 -0000 1.3 *************** *** 21,28 **** import org.jrman.geom.Bounds2f; public class Options { ! private float[] times; // Just now to avoid compiler warnings... private int frameNumber; // just now to avoid compiler warnings... --- 21,29 ---- import org.jrman.geom.Bounds2f; + import org.jrman.shaders.*; public class Options { ! private float[] times; // Just now to avoid compiler warnings... private int frameNumber; // just now to avoid compiler warnings... *************** *** 38,45 **** private float frameAspectRatio; ! private Bounds2f screenWindows; private CameraProjection cameraProjection; ! private float fieldOfView; --- 39,46 ---- private float frameAspectRatio; ! private Bounds2f screenWindow; private CameraProjection cameraProjection; ! private float fieldOfView; *************** *** 65,69 **** private Filter filter; ! private Exposure exposure; --- 66,70 ---- private Filter filter; ! private Exposure exposure; *************** *** 76,79 **** --- 77,84 ---- private Display display; + private int originX; + + private int originY; + private Hider hider; *************** *** 82,92 **** private float relativeDetail; public Options() { horizontalResolution = 640; verticalResolution = 480; pixelAspectRatio = 1f; cropWindow = new Bounds2f(0f, 1f, 0f, 1f); - frameAspectRatio = 4f / 3f; - screenWindows = new Bounds2f(-4f / 3f, 4f / 3f, -1f, 1f); cameraProjection = CameraProjection.ORTHOGRAPHIC; nearClipping = Float.MIN_VALUE; --- 87,102 ---- private float relativeDetail; + private int gridSize; + + private int bucketSizeX; + + private int bucketSizeY; + public Options() { horizontalResolution = 640; verticalResolution = 480; pixelAspectRatio = 1f; + fieldOfView = 90f; cropWindow = new Bounds2f(0f, 1f, 0f, 1f); cameraProjection = CameraProjection.ORTHOGRAPHIC; nearClipping = Float.MIN_VALUE; *************** *** 107,110 **** --- 117,133 ---- } + public void defineScreen() { + if (frameAspectRatio == 0) + frameAspectRatio = (horizontalResolution * pixelAspectRatio) / verticalResolution; + if (screenWindow == null) { + float h = (float) Math.tan(Math.PI * fieldOfView / 360f); + if (frameAspectRatio >= 1f) + screenWindow = new Bounds2f(-frameAspectRatio * h, frameAspectRatio * h, -h, h); + else + screenWindow = + new Bounds2f(-h, h, -h / frameAspectRatio, h / frameAspectRatio); + } + } + public CameraProjection getCameraProjection() { return cameraProjection; *************** *** 163,167 **** } - public int getHorizontalResolution() { return horizontalResolution; --- 186,189 ---- *************** *** 192,197 **** } ! public Bounds2f getScreenWindows() { ! return screenWindows; } --- 214,219 ---- } ! public Bounds2f getScreenWindow() { ! return screenWindow; } *************** *** 296,301 **** } ! public void setScreenWindows(Bounds2f bounds2f) { ! screenWindows = bounds2f; } --- 318,323 ---- } ! public void setScreenWindow(Bounds2f bounds2f) { ! screenWindow = bounds2f; } *************** *** 322,326 **** public void setMotionTimes(float[] times) { this.times = new float[times.length]; ! System.arraycopy(times, 0, this.times, 0, times.length); } --- 344,348 ---- public void setMotionTimes(float[] times) { this.times = new float[times.length]; ! System.arraycopy(times, 0, this.times, 0, times.length); } *************** *** 341,348 **** --- 363,411 ---- public void setFieldOfView(float f) { fieldOfView = f; + screenWindow = null; } public void setTimes(float[] fs) { times = fs; + } + + public int getOriginX() { + return originX; + } + + public int getOriginY() { + return originY; + } + + public void setOriginX(int i) { + originX = i; + } + + public void setOriginY(int i) { + originY = i; + } + + public int getBucketSizeX() { + return bucketSizeX; + } + + public int getBucketSizeY() { + return bucketSizeY; + } + + public int getGridSize() { + return gridSize; + } + + public void setBucketSizeX(int i) { + bucketSizeX = i; + } + + public void setBucketSizeY(int i) { + bucketSizeY = i; + } + + public void setGridSize(int i) { + gridSize = i; } --- Imager.java DELETED --- |
From: <ma...@us...> - 2003-04-11 22:23:43
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv2197/src/org/jrman/parser Modified Files: Scene.java Parser.java Log Message: Now parses and handles almost all option keywords. Index: Scene.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Scene.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Scene.java 9 Apr 2003 05:04:58 -0000 1.8 --- Scene.java 11 Apr 2003 22:23:08 -0000 1.9 *************** *** 34,37 **** --- 34,40 ---- public Scene() { declarations.put("fov", new Declaration("fov", "float")); + declarations.put("origin", new Declaration("origin", "integer[2]")); + declarations.put("gridsize", new Declaration("gridsize", "integer")); + declarations.put("bucketsize", new Declaration("bucketsize", "integer[2]")); declarations.put("intensity", new Declaration("intensity", "float")); declarations.put("lightcolor", new Declaration("lightcolor", "color")); Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Parser.java 11 Apr 2003 04:22:33 -0000 1.14 --- Parser.java 11 Apr 2003 22:23:09 -0000 1.15 *************** *** 31,34 **** --- 31,35 ---- import javax.vecmath.Color3f; import javax.vecmath.Matrix4f; + import javax.vecmath.Point2f; import javax.vecmath.Vector3f; *************** *** 392,398 **** public void setFormat(int xResolution, int yResolution, float pixelAspectRatio) { ! options.setHorizontalResolution(xResolution); ! options.setVerticalResolution(yResolution); ! options.setPixelAspectRatio(pixelAspectRatio); } --- 393,402 ---- public void setFormat(int xResolution, int yResolution, float pixelAspectRatio) { ! if (xResolution > 0) ! options.setHorizontalResolution(xResolution); ! if (yResolution > 0) ! options.setVerticalResolution(yResolution); ! if (pixelAspectRatio > 0) ! options.setPixelAspectRatio(pixelAspectRatio); } *************** *** 402,406 **** public void setScreenWindow(float left, float right, float bottom, float top) { ! options.setScreenWindows(new Bounds2f(left, right, bottom, top)); } --- 406,410 ---- public void setScreenWindow(float left, float right, float bottom, float top) { ! options.setScreenWindow(new Bounds2f(left, right, bottom, top)); } *************** *** 414,425 **** if (cameraProjection == CameraProjection.PERSPECTIVE) { float[][] fovParam = (float[][]) parameters.get("fov"); ! if (fovParam != null) ! options.setFieldOfView(fovParam[0][1]); ! currentAttributes.setTransform( ! PerspectiveTransform.createWithFOV( ! options.getFieldOfView(), ! options.getNearClipping(), ! options.getFarClipping())); } else if (cameraProjection == CameraProjection.ORTHOGRAPHIC) { currentAttributes.setTransform( AffineTransform.createOrthographic( --- 418,445 ---- if (cameraProjection == CameraProjection.PERSPECTIVE) { float[][] fovParam = (float[][]) parameters.get("fov"); ! if (fovParam != null) { ! options.setFieldOfView(fovParam[0][0]); ! options.defineScreen(); ! currentAttributes.setTransform( ! PerspectiveTransform.createWithFOV( ! options.getFieldOfView(), ! options.getNearClipping(), ! options.getFarClipping())); ! } else { ! options.defineScreen(); ! Bounds2f screenWindow = options.getScreenWindow(); ! Point2f min = screenWindow.getMin(); ! Point2f max = screenWindow.getMax(); ! float deltaX = Math.abs(max.x - (max.x + min.x) / 2f); ! float deltaY = Math.abs(max.y - (max.y + min.y) / 2f); ! float h = Math.min(deltaX, deltaY); ! currentAttributes.setTransform( ! PerspectiveTransform.createWithH( ! h, ! options.getNearClipping(), ! options.getFarClipping())); ! } } else if (cameraProjection == CameraProjection.ORTHOGRAPHIC) { + options.defineScreen(); currentAttributes.setTransform( AffineTransform.createOrthographic( *************** *** 433,437 **** public void setClipping(float near, float far) { options.setNearClipping(near); ! options.setFarClipping(far); } --- 453,457 ---- public void setClipping(float near, float far) { options.setNearClipping(near); ! options.setFarClipping(far); } *************** *** 439,447 **** options.setFStop(fstop); options.setFocalLength(focalLength); ! options.setFocalDistance(focalDistance); } public void setDepthOfField(float fstop) { options.setFStop(fstop); } --- 459,528 ---- options.setFStop(fstop); options.setFocalLength(focalLength); ! options.setFocalDistance(focalDistance); } public void setDepthOfField(float fstop) { options.setFStop(fstop); + } + + public void setShutter(float min, float max) { + options.setShutterOpen(min); + options.setShutterClose(max); + } + + public void setPixelVariance(float variation) { + options.setPixelVariance(variation); + } + + public void setPixelSamples(float xSamples, float ySamples) { + options.setHorizontalSamplingRate(xSamples); + options.setVerticalSamplingRate(ySamples); + } + + public void setPixelFilter(String type, float xWidth, float yWidth) { + options.setFilter(new Filter(Filter.Type.getNamed(type), xWidth, yWidth)); + } + + public void setExposure(float gain, float gamma) { + options.setExposure(new Exposure(gain, gamma)); + } + + public void setQuantize(String type, int one, int min, int max, float ditherAmplitude) { + if (type.equals("rgba")) { + options.setColorQuantizer(new Quantizer(one, min, max, ditherAmplitude)); + } else if (type.equals("z")) { + options.setDepthQuantizer(new Quantizer(one, min, max, ditherAmplitude)); + } else + throw new IllegalArgumentException("no such quantizer: " + type); + } + + public void setDisplay(String name, String type, String mode, Map parameters) { + options.setDisplay(new Display(name, type, mode)); + int[][] origin = (int[][]) parameters.get("origin"); + if (origin != null) { + options.setOriginX(origin[0][0]); + options.setOriginY(origin[0][1]); + } + } + + public void setHider(String type, Map parameters) { + options.setHider(Hider.getNamed(type)); + } + + public void setRelativeDetail(float relativeDetail) { + options.setRelativeDetail(relativeDetail); + } + + public void setOption(String name, Map parameters) { + if (name.equals("limits")) { + int[][] gridsize = (int[][]) parameters.get("gridsize"); + if (gridsize != null) + options.setGridSize(gridsize[0][0]); + int[][] bucketsize = (int[][]) parameters.get("bucketsize"); + if (bucketsize != null) { + options.setBucketSizeX(bucketsize[0][0]); + options.setBucketSizeY(bucketsize[0][1]); + } + } } |
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv2197/src/org/jrman/parser/keywords Modified Files: KeywordOption.java KeywordExposure.java KeywordRelativeDetail.java KeywordPixelFilter.java KeywordImager.java KeywordQuantize.java KeywordShutter.java KeywordPixelSamples.java KeywordHider.java KeywordPixelVariance.java KeywordDisplay.java Log Message: Now parses and handles almost all option keywords. Index: KeywordOption.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordOption.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordOption.java 7 Apr 2003 08:24:31 -0000 1.2 --- KeywordOption.java 11 Apr 2003 22:23:10 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- package org.jrman.parser.keywords; + import java.util.Map; + import org.jrman.parser.Tokenizer; *************** *** 27,34 **** // Expect name match(st, TK_STRING); ! // Expect parameter list ! parseParameterList(st); ! } --- 29,36 ---- // Expect name match(st, TK_STRING); ! String name = st.sval; // Expect parameter list ! Map parameters = parseParameterList(st); ! parser.setOption(name, parameters); } Index: KeywordExposure.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordExposure.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordExposure.java 7 Apr 2003 08:24:29 -0000 1.2 --- KeywordExposure.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 29,35 **** // Expect gain match(st, TK_NUMBER); ! // Expect gamma match(st, TK_NUMBER); } --- 29,37 ---- // Expect gain match(st, TK_NUMBER); ! float gain = (float) st.nval; // Expect gamma match(st, TK_NUMBER); + float gamma = (float) st.nval; + parser.setExposure(gain, gamma); } Index: KeywordRelativeDetail.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordRelativeDetail.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordRelativeDetail.java 7 Apr 2003 08:24:20 -0000 1.2 --- KeywordRelativeDetail.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 27,30 **** --- 27,32 ---- // Expect relative detail match(st, TK_NUMBER); + float relativeDetail = (float) st.nval; + parser.setRelativeDetail(relativeDetail); } Index: KeywordPixelFilter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPixelFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordPixelFilter.java 7 Apr 2003 08:24:31 -0000 1.2 --- KeywordPixelFilter.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 27,37 **** // Expect type match(st, TK_STRING); ! // Expect x width match(st, TK_NUMBER); ! // Expect y width match(st, TK_NUMBER); ! } --- 27,38 ---- // Expect type match(st, TK_STRING); ! String type = st.sval; // Expect x width match(st, TK_NUMBER); ! float xWidth = (float) st.nval; // Expect y width match(st, TK_NUMBER); ! float yWidth = (float) st.nval; ! parser.setPixelFilter(type, xWidth, yWidth); } Index: KeywordImager.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordImager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordImager.java 7 Apr 2003 08:24:24 -0000 1.2 --- KeywordImager.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 27,31 **** // Expect name match(st, TK_STRING); ! // Expect parameter list parseParameterList(st); --- 27,31 ---- // Expect name match(st, TK_STRING); ! // Expect parameter list parseParameterList(st); Index: KeywordQuantize.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordQuantize.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordQuantize.java 7 Apr 2003 08:24:30 -0000 1.2 --- KeywordQuantize.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 27,42 **** // Expect type match(st, TK_STRING); ! // Expect one match(st, TK_NUMBER); ! // Expect min match(st, TK_NUMBER); ! // Expect max match(st, TK_NUMBER); ! // Expect dither amplitude match(st, TK_NUMBER); } --- 27,44 ---- // Expect type match(st, TK_STRING); ! String type = st.sval; // Expect one match(st, TK_NUMBER); ! int one = (int) st.nval; // Expect min match(st, TK_NUMBER); ! int min = (int) st.nval; // Expect max match(st, TK_NUMBER); ! int max = (int) st.nval; // Expect dither amplitude match(st, TK_NUMBER); + float ditherAmplitude = (float) st.nval; + parser.setQuantize(type, one, min, max, ditherAmplitude); } Index: KeywordShutter.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordShutter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordShutter.java 7 Apr 2003 08:24:24 -0000 1.2 --- KeywordShutter.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 27,34 **** // Expect min match(st, TK_NUMBER); ! // Expect max match(st, TK_NUMBER); ! } --- 27,35 ---- // Expect min match(st, TK_NUMBER); ! float min = (float) st.nval; // Expect max match(st, TK_NUMBER); ! float max = (float) st.nval; ! parser.setShutter(min, max); } Index: KeywordPixelSamples.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPixelSamples.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordPixelSamples.java 7 Apr 2003 08:24:31 -0000 1.2 --- KeywordPixelSamples.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 27,33 **** // Expect x samples match(st, TK_NUMBER); ! // Expect y samples match(st, TK_NUMBER); } --- 27,35 ---- // Expect x samples match(st, TK_NUMBER); ! float xSamples = (float) st.nval; // Expect y samples match(st, TK_NUMBER); + float ySamples = (float) st.nval; + parser.setPixelSamples(xSamples, ySamples); } Index: KeywordHider.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordHider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordHider.java 7 Apr 2003 08:24:30 -0000 1.2 --- KeywordHider.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- package org.jrman.parser.keywords; + import java.util.Map; + import org.jrman.parser.Tokenizer; *************** *** 27,33 **** // Expect type match(st, TK_STRING); ! // Expect parameter list ! parseParameterList(st); } --- 29,36 ---- // Expect type match(st, TK_STRING); ! String type = st.sval; // Expect parameter list ! Map parameters = parseParameterList(st); ! parser.setHider(type, parameters); } Index: KeywordPixelVariance.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPixelVariance.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordPixelVariance.java 7 Apr 2003 08:24:24 -0000 1.2 --- KeywordPixelVariance.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 27,30 **** --- 27,32 ---- // Expect variation match(st, TK_NUMBER); + float variation = (float) st.nval; + parser.setPixelVariance(variation); } Index: KeywordDisplay.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordDisplay.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordDisplay.java 7 Apr 2003 08:24:28 -0000 1.2 --- KeywordDisplay.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- package org.jrman.parser.keywords; + import java.util.Map; + import org.jrman.parser.Tokenizer; *************** *** 27,39 **** // Expect name match(st, TK_STRING); ! // Expect type match(st, TK_STRING); ! // Expect mode match(st, TK_STRING); ! // Expect parameter list ! parseParameterList(st); } --- 29,42 ---- // Expect name match(st, TK_STRING); ! String name = st.sval; // Expect type match(st, TK_STRING); ! String type = st.sval; // Expect mode match(st, TK_STRING); ! String mode = st.sval; // Expect parameter list ! Map parameters = parseParameterList(st); ! parser.setDisplay(name, type, mode, parameters); } |
From: <ma...@us...> - 2003-04-11 22:23:16
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1:/tmp/cvs-serv2197/src/org/jrman/shaders Added Files: Imager.java Log Message: Now parses and handles almost all option keywords. --- NEW FILE: Imager.java --- /* Imager.java Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.shaders; public interface Imager { } |
From: <ma...@us...> - 2003-04-11 22:23:15
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv2197/src/org/jrman/geom Modified Files: PerspectiveTransform.java Log Message: Now parses and handles almost all option keywords. Index: PerspectiveTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/PerspectiveTransform.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PerspectiveTransform.java 9 Apr 2003 16:05:07 -0000 1.2 --- PerspectiveTransform.java 11 Apr 2003 22:23:11 -0000 1.3 *************** *** 44,47 **** --- 44,48 ---- private PerspectiveTransform(float h, float near, float far) { + // Assumes centered screen window.... super( new Matrix4f( |
From: <ma...@us...> - 2003-04-11 04:22:36
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv17383/src/org/jrman/parser Modified Files: Parser.java Log Message: Implemented some option keywords. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Parser.java 9 Apr 2003 16:05:08 -0000 1.13 --- Parser.java 11 Apr 2003 04:22:33 -0000 1.14 *************** *** 391,393 **** --- 391,448 ---- } + public void setFormat(int xResolution, int yResolution, float pixelAspectRatio) { + options.setHorizontalResolution(xResolution); + options.setVerticalResolution(yResolution); + options.setPixelAspectRatio(pixelAspectRatio); + } + + public void setFrameAspectRatio(float frameAspectRatio) { + options.setFrameAspectRatio(frameAspectRatio); + } + + public void setScreenWindow(float left, float right, float bottom, float top) { + options.setScreenWindows(new Bounds2f(left, right, bottom, top)); + } + + public void setCropWindow(float xmin, float xmax, float ymin, float ymax) { + options.setCropWindow(new Bounds2f(xmin, xmax, ymin, ymax)); + } + + public void setProjection(String name, Map parameters) { + CameraProjection cameraProjection = CameraProjection.getNamed(name); + options.setCameraProjection(cameraProjection); + if (cameraProjection == CameraProjection.PERSPECTIVE) { + float[][] fovParam = (float[][]) parameters.get("fov"); + if (fovParam != null) + options.setFieldOfView(fovParam[0][1]); + currentAttributes.setTransform( + PerspectiveTransform.createWithFOV( + options.getFieldOfView(), + options.getNearClipping(), + options.getFarClipping())); + } else if (cameraProjection == CameraProjection.ORTHOGRAPHIC) { + currentAttributes.setTransform( + AffineTransform.createOrthographic( + options.getNearClipping(), + options.getFarClipping())); + } + saveCurrentTransformAs("screen"); + currentAttributes.setTransform(AffineTransform.IDENTITY); + } + + public void setClipping(float near, float far) { + options.setNearClipping(near); + options.setFarClipping(far); + } + + public void setDepthOfField(float fstop, float focalLength, float focalDistance) { + options.setFStop(fstop); + options.setFocalLength(focalLength); + options.setFocalDistance(focalDistance); + } + + public void setDepthOfField(float fstop) { + options.setFStop(fstop); + } + } |
From: <ma...@us...> - 2003-04-11 04:22:36
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv17383/src/org/jrman/parser/keywords Modified Files: KeywordDepthOfField.java KeywordScreenWindow.java KeywordClipping.java KeywordFormat.java KeywordProjection.java KeywordCropWindow.java KeywordFrameAspectRatio.java Log Message: Implemented some option keywords. Index: KeywordDepthOfField.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordDepthOfField.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordDepthOfField.java 7 Apr 2003 08:24:30 -0000 1.2 --- KeywordDepthOfField.java 11 Apr 2003 04:22:33 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- import org.jrman.parser.Tokenizer; + import org.jrman.util.Constants; public class KeywordDepthOfField extends FrameKeywordParser { *************** *** 28,42 **** int token = st.nextToken(); st.pushBack(); ! if (token != TK_KEYWORD) // Is not a pin-hole camera ! { // Expect fstop match(st, TK_NUMBER); ! // Expect focal length match(st, TK_NUMBER); ! // Expect focal distance match(st, TK_NUMBER); ! } } --- 29,45 ---- int token = st.nextToken(); st.pushBack(); ! if (token != TK_KEYWORD) { // Is not a pin-hole camera // Expect fstop match(st, TK_NUMBER); ! float fstop = (float) st.nval; // Expect focal length match(st, TK_NUMBER); ! float focalLength = (float) st.nval; // Expect focal distance match(st, TK_NUMBER); ! float focalDistance = (float) st.nval; ! parser.setDepthOfField(fstop, focalLength, focalDistance); ! } else ! parser.setDepthOfField(Constants.INFINITY); } Index: KeywordScreenWindow.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordScreenWindow.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordScreenWindow.java 7 Apr 2003 08:24:31 -0000 1.2 --- KeywordScreenWindow.java 11 Apr 2003 04:22:33 -0000 1.3 *************** *** 32,50 **** else st.pushBack(); - // Expect left match(st, TK_NUMBER); ! // Expect right match(st, TK_NUMBER); ! // Expect bottom match(st, TK_NUMBER); ! // Expect top match(st, TK_NUMBER); ! if (array) match(st, TK_RBRACE); } --- 32,50 ---- else st.pushBack(); // Expect left match(st, TK_NUMBER); ! float left = (float) st.nval; // Expect right match(st, TK_NUMBER); ! float right = (float) st.nval; // Expect bottom match(st, TK_NUMBER); ! float bottom = (float) st.nval; // Expect top match(st, TK_NUMBER); ! float top = (float) st.nval; if (array) match(st, TK_RBRACE); + parser.setScreenWindow(left, right, bottom, top); } Index: KeywordClipping.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordClipping.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordClipping.java 7 Apr 2003 08:24:31 -0000 1.2 --- KeywordClipping.java 11 Apr 2003 04:22:33 -0000 1.3 *************** *** 27,33 **** // Expect near match(st, TK_NUMBER); ! // Expect far match(st, TK_NUMBER); } --- 27,35 ---- // Expect near match(st, TK_NUMBER); ! float near = (float) st.nval; // Expect far match(st, TK_NUMBER); + float far = (float) st.nval; + parser.setClipping(near, far); } Index: KeywordFormat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordFormat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordFormat.java 7 Apr 2003 08:24:25 -0000 1.2 --- KeywordFormat.java 11 Apr 2003 04:22:33 -0000 1.3 *************** *** 27,36 **** // Expect x resolution match(st, TK_NUMBER); ! // Expect y resolution match(st, TK_NUMBER); ! // Expect pixel aspect ratio match(st, TK_NUMBER); } --- 27,38 ---- // Expect x resolution match(st, TK_NUMBER); ! int xResolution = (int) st.nval; // Expect y resolution match(st, TK_NUMBER); ! int yResolution = (int) st.nval; // Expect pixel aspect ratio match(st, TK_NUMBER); + float pixelAspectRatio = (float) st.nval; + parser.setFormat(xResolution, yResolution, pixelAspectRatio); } Index: KeywordProjection.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordProjection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordProjection.java 7 Apr 2003 08:24:24 -0000 1.2 --- KeywordProjection.java 11 Apr 2003 04:22:33 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- package org.jrman.parser.keywords; + import java.util.Map; + import org.jrman.parser.Tokenizer; *************** *** 27,33 **** // Expect name match(st, TK_STRING); ! // Expect parameter list ! parseParameterList(st); } --- 29,36 ---- // Expect name match(st, TK_STRING); ! String name = st.sval; // Expect parameter list ! Map parameters = parseParameterList(st); ! parser.setProjection(name, parameters); } Index: KeywordCropWindow.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordCropWindow.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordCropWindow.java 7 Apr 2003 08:24:25 -0000 1.2 --- KeywordCropWindow.java 11 Apr 2003 04:22:33 -0000 1.3 *************** *** 35,50 **** // Expect xmin match(st, TK_NUMBER); ! // Expect xmax match(st, TK_NUMBER); ! // Expect ymin match(st, TK_NUMBER); ! // Expect ymax match(st, TK_NUMBER); ! if (array) match(st, TK_RBRACE); } --- 35,51 ---- // Expect xmin match(st, TK_NUMBER); ! float xmin = (float) st.nval; // Expect xmax match(st, TK_NUMBER); ! float xmax = (float) st.nval; // Expect ymin match(st, TK_NUMBER); ! float ymin = (float) st.nval; // Expect ymax match(st, TK_NUMBER); ! float ymax = (float) st.nval; if (array) match(st, TK_RBRACE); + parser.setCropWindow(xmin, xmax, ymin, ymax); } Index: KeywordFrameAspectRatio.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordFrameAspectRatio.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordFrameAspectRatio.java 7 Apr 2003 08:24:24 -0000 1.2 --- KeywordFrameAspectRatio.java 11 Apr 2003 04:22:33 -0000 1.3 *************** *** 27,30 **** --- 27,32 ---- // Expect frame aspect ratio match(st, TK_NUMBER); + float frameAspectRatio = (float) st.nval; + parser.setFrameAspectRatio(frameAspectRatio); } |
From: <ma...@us...> - 2003-04-11 04:22:35
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv17383/src/org/jrman/geom Modified Files: AffineTransform.java Log Message: Implemented some option keywords. Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AffineTransform.java 9 Apr 2003 16:05:07 -0000 1.2 --- AffineTransform.java 11 Apr 2003 04:22:32 -0000 1.3 *************** *** 25,33 **** import javax.vecmath.Vector3f; - public class AffineTransform implements Transform { ! public static final AffineTransform IDENTITY; ! static { Matrix4f identity = new Matrix4f(); --- 25,32 ---- import javax.vecmath.Vector3f; public class AffineTransform implements Transform { ! public static final AffineTransform IDENTITY; ! static { Matrix4f identity = new Matrix4f(); *************** *** 44,47 **** --- 43,68 ---- private Matrix4f inverseNormalsMatrix; + public static Transform createOrthographic(float near, float far) { + Matrix4f m = + new Matrix4f( + 1f, + 0f, + 0f, + 0f, + 0f, + 1f, + 0f, + 0f, + 0f, + 0f, + 1f / (far - near), + -near / (far - near), + 0f, + 0f, + 0f, + 1f); + return new AffineTransform(m); + } + protected AffineTransform(Matrix4f matrix) { this.matrix = new Matrix4f(matrix); *************** *** 51,59 **** this(transform.getMatrix()); } ! ! public Transform getCopy(){ return new AffineTransform(this); } ! public Transform concat(Transform transform) { Matrix4f matrix = getMatrix(); --- 72,80 ---- this(transform.getMatrix()); } ! ! public Transform getCopy() { return new AffineTransform(this); } ! public Transform concat(Transform transform) { Matrix4f matrix = getMatrix(); *************** *** 62,66 **** } ! public Transform concat(Matrix4f m){ Matrix4f matrix = getMatrix(); matrix.mul(m); --- 83,87 ---- } ! public Transform concat(Matrix4f m) { Matrix4f matrix = getMatrix(); matrix.mul(m); *************** *** 135,139 **** return new Matrix4f(matrix); } ! protected Matrix4f getInverseMatrix() { if (inverseMatrix == null) { --- 156,160 ---- return new Matrix4f(matrix); } ! protected Matrix4f getInverseMatrix() { if (inverseMatrix == null) { |
From: <ma...@us...> - 2003-04-11 04:22:35
|
Update of /cvsroot/jrman/drafts/src/org/jrman/options In directory sc8-pr-cvs1:/tmp/cvs-serv17383/src/org/jrman/options Modified Files: Options.java CameraProjection.java Log Message: Implemented some option keywords. Index: Options.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/Options.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Options.java 9 Apr 2003 05:04:58 -0000 1.1 --- Options.java 11 Apr 2003 04:22:32 -0000 1.2 *************** *** 41,44 **** --- 41,46 ---- private CameraProjection cameraProjection; + + private float fieldOfView; private float nearClipping; *************** *** 321,324 **** --- 323,348 ---- this.times = new float[times.length]; System.arraycopy(times, 0, this.times, 0, times.length); + } + + public float getFieldOfView() { + return fieldOfView; + } + + public int getFrameNumber() { + return frameNumber; + } + + public float[] getTimes() { + float[] result = new float[times.length]; + System.arraycopy(times, 0, result, 0, times.length); + return result; + } + + public void setFieldOfView(float f) { + fieldOfView = f; + } + + public void setTimes(float[] fs) { + times = fs; } Index: CameraProjection.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/options/CameraProjection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CameraProjection.java 9 Apr 2003 05:04:58 -0000 1.1 --- CameraProjection.java 11 Apr 2003 04:22:32 -0000 1.2 *************** *** 29,32 **** --- 29,34 ---- public final static CameraProjection PERSPECTIVE = new CameraProjection("perspective"); + public final static CameraProjection UNKNOWN = new CameraProjection("unknown"); + private static Map map = new HashMap(); *************** *** 45,49 **** CameraProjection result = (CameraProjection) map.get(name); if (result == null) ! throw new IllegalArgumentException("no such projection: " + name); return result; } --- 47,51 ---- CameraProjection result = (CameraProjection) map.get(name); if (result == null) ! result = UNKNOWN; return result; } |
From: <ma...@us...> - 2003-04-09 16:05:13
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv32254/src/org/jrman/geom Modified Files: AffineTransform.java Transform.java PerspectiveTransform.java Log Message: Added new transform methods to Transform. Created factory methods for PerspectiveTransform. Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AffineTransform.java 9 Apr 2003 05:04:59 -0000 1.1 --- AffineTransform.java 9 Apr 2003 16:05:07 -0000 1.2 *************** *** 72,101 **** --- 72,133 ---- } + public void transformPoint(Point3f point, Point3f out) { + matrix.transform(point, out); + } + public void transformHPoint(Point4f hpoint) { matrix.transform(hpoint); } + public void transformHPoint(Point4f hpoint, Point4f out) { + matrix.transform(hpoint, out); + } + public void transformVector(Vector3f vector) { matrix.transform(vector); } + public void transformVector(Vector3f vector, Vector3f out) { + matrix.transform(vector, out); + } + public void transformNormal(Vector3f normal) { getNormalsMatrix().transform(normal); } + public void transformNormal(Vector3f normal, Vector3f out) { + getNormalsMatrix().transform(normal, out); + } + public void untransformPoint(Point3f point) { getInverseMatrix().transform(point); } + public void untransformPoint(Point3f point, Point3f out) { + getInverseMatrix().transform(point, out); + } + public void untransformHPoint(Point4f hpoint) { getInverseMatrix().transform(hpoint); } + public void untransformHPoint(Point4f hpoint, Point4f out) { + getInverseMatrix().transform(hpoint, out); + } + public void untransformVector(Vector3f vector) { getInverseMatrix().transform(vector); } + public void untransformVector(Vector3f vector, Vector3f out) { + getInverseMatrix().transform(vector, out); + } + public void untransformNormal(Vector3f normal) { getInverseNormalsMatrix().transform(normal); + } + + public void untransformNormal(Vector3f normal, Vector3f out) { + getInverseNormalsMatrix().transform(normal, out); } Index: Transform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Transform.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Transform.java 9 Apr 2003 05:04:59 -0000 1.1 --- Transform.java 9 Apr 2003 16:05:07 -0000 1.2 *************** *** 35,51 **** --- 35,67 ---- void transformPoint(Point3f point); + void transformPoint(Point3f point, Point3f out); + void transformHPoint(Point4f hpoint); + void transformHPoint(Point4f hpoint, Point4f out); + void transformVector(Vector3f vector); + void transformVector(Vector3f vector, Vector3f out); + void transformNormal(Vector3f normal); + void transformNormal(Vector3f normal, Vector3f out); + void untransformPoint(Point3f point); + void untransformPoint(Point3f point, Point3f out); + void untransformHPoint(Point4f hpoint); + void untransformHPoint(Point4f hpoint, Point4f out); + void untransformVector(Vector3f vector); + void untransformVector(Vector3f vector, Vector3f out); + void untransformNormal(Vector3f normal); + + void untransformNormal(Vector3f normal, Vector3f out); Matrix4f getMatrix(); Index: PerspectiveTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/PerspectiveTransform.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PerspectiveTransform.java 9 Apr 2003 05:04:59 -0000 1.1 --- PerspectiveTransform.java 9 Apr 2003 16:05:07 -0000 1.2 *************** *** 27,35 **** public class PerspectiveTransform extends AffineTransform { ! protected PerspectiveTransform(Matrix4f matrix) { super(matrix); } ! public PerspectiveTransform(float fov, float near, float far) { super( new Matrix4f( --- 27,47 ---- public class PerspectiveTransform extends AffineTransform { ! public static PerspectiveTransform createWithFOV(float fov, float near, float far) { ! return createWithH(fovToH(fov), near, far); ! } ! ! public static PerspectiveTransform createWithH(float h, float near, float far) { ! return new PerspectiveTransform(h, near, far); ! } ! ! private static float fovToH(float fov) { ! return (float) Math.tan(fov * Math.PI / 360f); ! } ! ! private PerspectiveTransform(Matrix4f matrix) { super(matrix); } ! private PerspectiveTransform(float h, float near, float far) { super( new Matrix4f( *************** *** 44,59 **** 0f, 0f, ! (fovToH(fov) * far) / (near * (far - near)), ! fovToH(fov) / near, 0f, 0f, ! - (fovToH(fov) * far) / (far - near), 0f)); } - private static float fovToH(float fov) { - return (float) Math.tan(fov * Math.PI / 360f); - } - public Transform getCopy() { return new PerspectiveTransform(getMatrix()); --- 56,67 ---- 0f, 0f, ! (h * far) / (near * (far - near)), ! h / near, 0f, 0f, ! - (h * far) / (far - near), 0f)); } public Transform getCopy() { return new PerspectiveTransform(getMatrix()); *************** *** 81,84 **** --- 89,98 ---- transformHPoint(hpoint); point.project(hpoint); + } + + public void transformPoint(Point3f point, Point3f out) { + Point4f hpoint = new Point4f(point); + transformHPoint(hpoint); + out.project(hpoint); } |
From: <ma...@us...> - 2003-04-09 16:05:13
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv32254/src/org/jrman/parser Modified Files: Parser.java Log Message: Added new transform methods to Transform. Created factory methods for PerspectiveTransform. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Parser.java 9 Apr 2003 15:50:11 -0000 1.12 --- Parser.java 9 Apr 2003 16:05:08 -0000 1.13 *************** *** 230,234 **** public void perspective(float fov) { PerspectiveTransform perspective = ! new PerspectiveTransform(fov, 1f, Constants.INFINITY); Transform current = currentAttributes.getTransform(); currentAttributes.setTransform(perspective.preConcat(current)); --- 230,234 ---- public void perspective(float fov) { PerspectiveTransform perspective = ! PerspectiveTransform.createWithFOV(fov, 1f, Constants.INFINITY); Transform current = currentAttributes.getTransform(); currentAttributes.setTransform(perspective.preConcat(current)); |
From: <ma...@us...> - 2003-04-09 15:50:39
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv25798/src/org/jrman/geom Modified Files: Bounds3f.java Bounds2f.java Log Message: Defined Constants class to concentrate all constants in a single file. Index: Bounds3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds3f.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Bounds3f.java 9 Apr 2003 05:04:59 -0000 1.1 --- Bounds3f.java 9 Apr 2003 15:50:01 -0000 1.2 *************** *** 23,26 **** --- 23,28 ---- import javax.vecmath.Point3f; + import org.jrman.util.Constants; + public class Bounds3f { *************** *** 31,40 **** public Bounds3f() { this( ! Float.NEGATIVE_INFINITY, ! Float.POSITIVE_INFINITY, ! Float.NEGATIVE_INFINITY, ! Float.POSITIVE_INFINITY, ! Float.NEGATIVE_INFINITY, ! Float.POSITIVE_INFINITY); } --- 33,42 ---- public Bounds3f() { this( ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY, ! -Constants.INFINITY, ! Constants.INFINITY); } *************** *** 48,53 **** max = new Point3f(newMax); } ! ! public Bounds3f transform(Matrix4f transform){ Point3f newMin = new Point3f(); Point3f newMax = new Point3f(); --- 50,55 ---- max = new Point3f(newMax); } ! ! public Bounds3f transform(Matrix4f transform) { Point3f newMin = new Point3f(); Point3f newMax = new Point3f(); *************** *** 56,65 **** return new Bounds3f(newMin, newMax); } ! public Point3f getMax() { return new Point3f(max); } ! ! public Point3f getMin(){ return new Point3f(min); } --- 58,67 ---- return new Bounds3f(newMin, newMax); } ! public Point3f getMax() { return new Point3f(max); } ! ! public Point3f getMin() { return new Point3f(min); } Index: Bounds2f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds2f.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Bounds2f.java 9 Apr 2003 05:04:59 -0000 1.1 --- Bounds2f.java 9 Apr 2003 15:50:02 -0000 1.2 *************** *** 22,25 **** --- 22,27 ---- import javax.vecmath.Point2f; + import org.jrman.util.Constants; + public class Bounds2f { *************** *** 29,37 **** public Bounds2f() { ! this( ! Float.NEGATIVE_INFINITY, ! Float.POSITIVE_INFINITY, ! Float.NEGATIVE_INFINITY, ! Float.POSITIVE_INFINITY); } --- 31,35 ---- public Bounds2f() { ! this(-Constants.INFINITY, Constants.INFINITY, -Constants.INFINITY, Constants.INFINITY); } *************** *** 40,44 **** max = new Point2f(xMax, yMax); } ! public Bounds2f(Point2f min, Point2f max) { this.min = new Point2f(min); --- 38,42 ---- max = new Point2f(xMax, yMax); } ! public Bounds2f(Point2f min, Point2f max) { this.min = new Point2f(min); |
From: <ma...@us...> - 2003-04-09 15:50:15
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv25798/src/org/jrman/parser Modified Files: Parser.java Log Message: Defined Constants class to concentrate all constants in a single file. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Parser.java 9 Apr 2003 05:04:58 -0000 1.11 --- Parser.java 9 Apr 2003 15:50:11 -0000 1.12 *************** *** 37,40 **** --- 37,41 ---- import org.jrman.options.*; import org.jrman.parser.keywords.KeywordParser; + import org.jrman.util.Constants; public class Parser { *************** *** 229,233 **** public void perspective(float fov) { PerspectiveTransform perspective = ! new PerspectiveTransform(fov, 1f, Float.POSITIVE_INFINITY); Transform current = currentAttributes.getTransform(); currentAttributes.setTransform(perspective.preConcat(current)); --- 230,234 ---- public void perspective(float fov) { PerspectiveTransform perspective = ! new PerspectiveTransform(fov, 1f, Constants.INFINITY); Transform current = currentAttributes.getTransform(); currentAttributes.setTransform(perspective.preConcat(current)); |
From: <ma...@us...> - 2003-04-09 15:50:14
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs1:/tmp/cvs-serv25798/src/org/jrman/util Added Files: Constants.java Log Message: Defined Constants class to concentrate all constants in a single file. --- NEW FILE: Constants.java --- /* Constants.java Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.util; public class Constants { public final static float EPSILON = 1.0e-10f; public final static float INFINITY = 1.0e38f; private Constants() { } } |
From: <ma...@us...> - 2003-04-09 15:49:52
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs1:/tmp/cvs-serv25707/src/org/jrman/util Log Message: Directory /cvsroot/jrman/drafts/src/org/jrman/util added to the repository |
From: <ma...@us...> - 2003-04-09 05:05:04
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1:/tmp/cvs-serv515/src/org/jrman/shaders Added Files: DisplacementShader.java VolumeShader.java SurfaceShader.java Log Message: Reorganized packages. Fixed misc. errors. --- NEW FILE: DisplacementShader.java --- /* DisplacementShader.java Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.shaders; public interface DisplacementShader { } --- NEW FILE: VolumeShader.java --- /* VolumeShader.java Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.shaders; public interface VolumeShader { } --- NEW FILE: SurfaceShader.java --- /* SurfaceShader.java Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.shaders; public interface SurfaceShader { } |
From: <ma...@us...> - 2003-04-09 05:05:03
|
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs1:/tmp/cvs-serv515/src Removed Files: gen.pl keywords.txt Log Message: Reorganized packages. Fixed misc. errors. --- gen.pl DELETED --- --- keywords.txt DELETED --- |