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-16 09:19:16
|
Update of /cvsroot/jrman/drafts/tests In directory sc8-pr-cvs1:/tmp/cvs-serv18808/tests Log Message: Directory /cvsroot/jrman/drafts/tests added to the repository |
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv28053/src/org/jrman/geom Modified Files: AffineTransform.java Bounds3f.java Bounds2f.java ClippingVolume.java Plane.java PerspectiveTransform.java ConvexHull3f.java Log Message: Wrote toString() methods for some classes. Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AffineTransform.java 15 Apr 2003 10:15:13 -0000 1.8 --- AffineTransform.java 15 Apr 2003 13:07:56 -0000 1.9 *************** *** 282,285 **** --- 282,291 ---- return new AffineTransform(getInverseMatrix()); } + + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("AffineTransform:\n").append(matrix); + return sb.toString(); + } } Index: Bounds3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds3f.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Bounds3f.java 14 Apr 2003 04:41:25 -0000 1.5 --- Bounds3f.java 15 Apr 2003 13:07:56 -0000 1.6 *************** *** 216,218 **** --- 216,226 ---- } + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("Bounds2f"); + sb.append(", min: ").append(min); + sb.append(", max: ").append(max); + return sb.toString(); + } + } Index: Bounds2f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds2f.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Bounds2f.java 15 Apr 2003 06:54:53 -0000 1.5 --- Bounds2f.java 15 Apr 2003 13:07:56 -0000 1.6 *************** *** 81,84 **** --- 81,92 ---- return new Point2f(min); } + + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("Bounds2f"); + sb.append(", min: ").append(min); + sb.append(", max: ").append(max); + return sb.toString(); + } } Index: ClippingVolume.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/ClippingVolume.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClippingVolume.java 14 Apr 2003 08:37:59 -0000 1.2 --- ClippingVolume.java 15 Apr 2003 13:07:56 -0000 1.3 *************** *** 45,47 **** --- 45,55 ---- } + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("ClippingVolume:\n"); + for (Iterator iter = planes.iterator(); iter.hasNext();) + sb.append(iter.next()).append('\n'); + return sb.toString(); + } + } Index: Plane.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Plane.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Plane.java 13 Apr 2003 05:15:32 -0000 1.2 --- Plane.java 15 Apr 2003 13:07:56 -0000 1.3 *************** *** 80,83 **** --- 80,91 ---- return isInside(p); } + + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("Plane"); + sb.append(", point: ").append(point); + sb.append(", normal: ").append(normal); + return sb.toString(); + } } Index: PerspectiveTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/PerspectiveTransform.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PerspectiveTransform.java 11 Apr 2003 22:23:11 -0000 1.3 --- PerspectiveTransform.java 15 Apr 2003 13:07:56 -0000 1.4 *************** *** 98,100 **** --- 98,106 ---- } + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("AffineTransform:\n").append(getMatrix()); + return sb.toString(); + } + } Index: ConvexHull3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/ConvexHull3f.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConvexHull3f.java 15 Apr 2003 11:41:57 -0000 1.3 --- ConvexHull3f.java 15 Apr 2003 13:07:56 -0000 1.4 *************** *** 28,42 **** public class ConvexHull3f implements BoundingVolume { ! private Collection points = new ArrayList(); ! public void addPoint(Point3f point) { points.add(new Point3f(point)); } ! public void addPoint(float x, float y, float z) { points.add(new Point3f(x, y, z)); } ! public void addHpoint(Point4f hpoint) { Point3f p = new Point3f(); --- 28,42 ---- public class ConvexHull3f implements BoundingVolume { ! private Collection points = new ArrayList(); ! public void addPoint(Point3f point) { points.add(new Point3f(point)); } ! public void addPoint(float x, float y, float z) { points.add(new Point3f(x, y, z)); } ! public void addHpoint(Point4f hpoint) { Point3f p = new Point3f(); *************** *** 47,51 **** public BoundingVolume transform(Transform transform) { ConvexHull3f result = new ConvexHull3f(); ! for (Iterator iter = points.iterator(); iter.hasNext(); ) { Point3f p = (Point3f) iter.next(); result.addPoint(p); --- 47,51 ---- public BoundingVolume transform(Transform transform) { ConvexHull3f result = new ConvexHull3f(); ! for (Iterator iter = points.iterator(); iter.hasNext();) { Point3f p = (Point3f) iter.next(); result.addPoint(p); *************** *** 56,61 **** public Plane.Side whichSideOf(Plane plane) { boolean inside = false; ! boolean outside = false;; ! for (Iterator iter = points.iterator(); iter.hasNext(); ) { Point3f p = (Point3f) iter.next(); if (plane.isInside(p)) { --- 56,62 ---- public Plane.Side whichSideOf(Plane plane) { boolean inside = false; ! boolean outside = false; ! ; ! for (Iterator iter = points.iterator(); iter.hasNext();) { Point3f p = (Point3f) iter.next(); if (plane.isInside(p)) { *************** *** 74,80 **** public Bounds3f getBoundingBox() { MutableBounds3f result = new MutableBounds3f(); ! for (Iterator iter = points.iterator(); iter.hasNext(); ) result.addPoint((Point3f) iter.next()); return result; } --- 75,89 ---- public Bounds3f getBoundingBox() { MutableBounds3f result = new MutableBounds3f(); ! for (Iterator iter = points.iterator(); iter.hasNext();) result.addPoint((Point3f) iter.next()); return result; + } + + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("ConvexHull:\n"); + for (Iterator iter = points.iterator(); iter.hasNext();) + sb.append(iter.next()).append('\n'); + return sb.toString(); } |
From: <ma...@us...> - 2003-04-15 13:08:01
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv28053/src/org/jrman/primitive Modified Files: Sphere.java Log Message: Wrote toString() methods for some classes. Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Sphere.java 15 Apr 2003 12:35:24 -0000 1.6 --- Sphere.java 15 Apr 2003 13:07:57 -0000 1.7 *************** *** 53,56 **** --- 53,65 ---- this.thetaMax = thetaMax; } + + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("Sphere,"); + sb.append(" radius: ").append(radius); + sb.append(", phi: ").append(phiMin).append(" -> ").append(phiMax); + sb.append(", theta: ").append(thetaMin).append(" -> ").append(thetaMax); + return sb.toString(); + } public BoundingVolume internalGetBoundingVolume() { |
From: <ma...@us...> - 2003-04-15 12:35:30
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv12375/src/org/jrman/primitive Modified Files: Sphere.java Log Message: Fixed another bounding box bug. Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Sphere.java 15 Apr 2003 11:41:57 -0000 1.5 --- Sphere.java 15 Apr 2003 12:35:24 -0000 1.6 *************** *** 22,31 **** import java.util.Map; - import javax.vecmath.Point3f; - import org.jrman.attributes.Attributes; import org.jrman.geom.BoundingVolume; - import org.jrman.geom.Bounds3f; - import org.jrman.geom.ConvexHull3f; import org.jrman.geom.MutableBounds3f; --- 22,27 ---- *************** *** 61,69 **** float zMin = (float) Math.sin(phiMin) * radius; float zMax = (float) Math.sin(phiMax) * radius; ! float r = radius; if (phiMax < 0) ! r = (float) Math.cos(phiMax); else if (phiMin > 0) ! r = (float) Math.cos(phiMin); MutableBounds3f mb = new MutableBounds3f(); float incr = (thetaMax - thetaMin) / 4; --- 57,65 ---- float zMin = (float) Math.sin(phiMin) * radius; float zMax = (float) Math.sin(phiMax) * radius; ! float r = radius * 1.415f; if (phiMax < 0) ! r = (float) Math.cos(phiMax) * r; else if (phiMin > 0) ! r = (float) Math.cos(phiMin) * r; MutableBounds3f mb = new MutableBounds3f(); float incr = (thetaMax - thetaMin) / 4; |
From: <ma...@us...> - 2003-04-15 11:42:01
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv26505/src/org/jrman/geom Modified Files: ConvexHull3f.java Log Message: Implemented sphere bounding box. And fixed some bugs... Index: ConvexHull3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/ConvexHull3f.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConvexHull3f.java 14 Apr 2003 08:37:59 -0000 1.2 --- ConvexHull3f.java 15 Apr 2003 11:41:57 -0000 1.3 *************** *** 56,60 **** public Plane.Side whichSideOf(Plane plane) { boolean inside = false; ! boolean outside = true; for (Iterator iter = points.iterator(); iter.hasNext(); ) { Point3f p = (Point3f) iter.next(); --- 56,60 ---- public Plane.Side whichSideOf(Plane plane) { boolean inside = false; ! boolean outside = false;; for (Iterator iter = points.iterator(); iter.hasNext(); ) { Point3f p = (Point3f) iter.next(); |
From: <ma...@us...> - 2003-04-15 11:42:01
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv26505/src/org/jrman/parser Modified Files: Parser.java Log Message: Implemented sphere bounding box. And fixed some bugs... Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Parser.java 15 Apr 2003 10:15:15 -0000 1.28 --- Parser.java 15 Apr 2003 11:41:57 -0000 1.29 *************** *** 645,650 **** if (inAreaLightSource) return; ! float phiMin = (float) ((zMin <= -radius) ? -Math.PI : Math.asin(zMin / radius)); ! float phiMax = (float) ((zMax >= radius) ? Math.PI : Math.asin(zMax / radius)); float thetaMin = 0f; thetaMax = toRadians(thetaMax); --- 645,650 ---- if (inAreaLightSource) return; ! float phiMin = (float) ((zMin <= -radius) ? -Math.PI / 2 : Math.asin(zMin / radius)); ! float phiMax = (float) ((zMax >= radius) ? Math.PI / 2 : Math.asin(zMax / radius)); float thetaMin = 0f; thetaMax = toRadians(thetaMax); |
From: <ma...@us...> - 2003-04-15 11:42:01
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv26505/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Implemented sphere bounding box. And fixed some bugs... Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RendererHidden.java 15 Apr 2003 10:15:14 -0000 1.3 --- RendererHidden.java 15 Apr 2003 11:41:57 -0000 1.4 *************** *** 73,82 **** BoundingVolume bv = primitive.getBoundingVolume(); bv = bv.transform(objectToCamera); ! Plane.Side side = bv.whichSideOf(eyePlane); ! if (side == Plane.Side.OUTSIDE) return true; if (side == Plane.Side.INSIDE) { ! if (clippingVolume.whereIs(bv) != Plane.Side.OUTSIDE) ! placeInBucket(primitive, bv); return true; } --- 73,81 ---- BoundingVolume bv = primitive.getBoundingVolume(); bv = bv.transform(objectToCamera); ! if (clippingVolume.whereIs(bv) == Plane.Side.OUTSIDE) return true; + Plane.Side side = bv.whichSideOf(eyePlane); if (side == Plane.Side.INSIDE) { ! placeInBucket(primitive, bv); return true; } *************** *** 129,132 **** --- 128,133 ---- bucketRows = (int) Math.ceil(height / bucketHeight); buckets = new Bucket[bucketColumns * bucketRows]; + for (int i = 0; i < buckets.length; i++) + buckets[i] = new Bucket(); } |
From: <ma...@us...> - 2003-04-15 11:42:01
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv26505/src/org/jrman/primitive Modified Files: Sphere.java Log Message: Implemented sphere bounding box. And fixed some bugs... Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Sphere.java 15 Apr 2003 10:15:15 -0000 1.4 --- Sphere.java 15 Apr 2003 11:41:57 -0000 1.5 *************** *** 27,30 **** --- 27,32 ---- import org.jrman.geom.BoundingVolume; import org.jrman.geom.Bounds3f; + import org.jrman.geom.ConvexHull3f; + import org.jrman.geom.MutableBounds3f; public class Sphere extends Quadric { *************** *** 40,45 **** private float thetaMax; - private BoundingVolume boundingVolume; - public Sphere( float radius, --- 42,45 ---- *************** *** 59,69 **** public BoundingVolume internalGetBoundingVolume() { ! // TODO fix sphere bounding volume ! if (boundingVolume == null) ! boundingVolume = ! new Bounds3f( ! new Point3f(-radius, -radius, -radius), ! new Point3f(radius, radius, radius)); ! return boundingVolume; } --- 59,78 ---- public BoundingVolume internalGetBoundingVolume() { ! float zMin = (float) Math.sin(phiMin) * radius; ! float zMax = (float) Math.sin(phiMax) * radius; ! float r = radius; ! if (phiMax < 0) ! r = (float) Math.cos(phiMax); ! else if (phiMin > 0) ! r = (float) Math.cos(phiMin); ! MutableBounds3f mb = new MutableBounds3f(); ! float incr = (thetaMax - thetaMin) / 4; ! for (float angle = thetaMin; angle <= thetaMax; angle += incr) { ! float x = (float) Math.cos(angle) * r; ! float y = (float) Math.sin(angle) * r; ! mb.addPoint(x, y, zMin); ! mb.addPoint(x, y, zMax); ! } ! return mb; } |
From: <ma...@us...> - 2003-04-15 10:15:19
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs1:/tmp/cvs-serv27418/src/org/jrman/util Modified Files: Calc.java Log Message: Continued implementing Renderer. Fixed some bugs... Index: Calc.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Calc.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Calc.java 15 Apr 2003 05:22:11 -0000 1.2 --- Calc.java 15 Apr 2003 10:15:15 -0000 1.3 *************** *** 31,34 **** --- 31,38 ---- } + public static int clamp(int v, int min, int max) { + return Math.min(Math.max(v, min), max); + } + public static float clamp(float v, float min, float max) { return Math.min(Math.max(v, min), max); |
From: <ma...@us...> - 2003-04-15 10:15:19
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv27418/src/org/jrman/render Modified Files: RendererHidden.java Added Files: Bucket.java Log Message: Continued implementing Renderer. Fixed some bugs... --- NEW FILE: Bucket.java --- /* Bucket.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.render; import java.util.Stack; import org.jrman.primitive.Primitive; public class Bucket { private Stack primitives = new Stack(); public void addPrimitive(Primitive primitive) { primitives.push(primitive); } public boolean hasMorePrimitives() { return !primitives.isEmpty(); } public Primitive getNextPrimitive() { return (Primitive) primitives.pop(); } } Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RendererHidden.java 15 Apr 2003 06:54:53 -0000 1.2 --- RendererHidden.java 15 Apr 2003 10:15:14 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- import javax.vecmath.Vector3f; + import org.jrman.geom.BoundingVolume; import org.jrman.geom.Bounds2f; import org.jrman.geom.ClippingVolume; *************** *** 37,44 **** public class RendererHidden extends Renderer { private ClippingVolume clippingVolume; public void addPrimitive(Primitive primitive) { ! // TODO Auto-generated method stub } --- 38,105 ---- public class RendererHidden extends Renderer { + private final static int MAX_EYE_SPLITS = 10; + private ClippingVolume clippingVolume; + private Plane eyePlane; + + private Transform worldToCamera; + + private Transform cameraToRaster; + + private Bounds2f rasterWindow; + + private Bucket[] buckets; + + private int bucketColumns; + + private int bucketRows; + + private int bucketWidth; + + private int bucketHeight; + public void addPrimitive(Primitive primitive) { ! Transform objectToWorld = primitive.getAttributes().getTransform(); ! Transform objectToCamera = worldToCamera.concat(objectToWorld); ! if (!addPrimitive(primitive, 0, objectToCamera)) ! System.err.println("Can't split primitive at eye plane: " + primitive); ! } ! ! private boolean addPrimitive( ! Primitive primitive, ! int recursionLevel, ! Transform objectToCamera) { ! BoundingVolume bv = primitive.getBoundingVolume(); ! bv = bv.transform(objectToCamera); ! Plane.Side side = bv.whichSideOf(eyePlane); ! if (side == Plane.Side.OUTSIDE) ! return true; ! if (side == Plane.Side.INSIDE) { ! if (clippingVolume.whereIs(bv) != Plane.Side.OUTSIDE) ! placeInBucket(primitive, bv); ! return true; ! } ! // BOTH_SIDES ! if (recursionLevel == MAX_EYE_SPLITS) ! return false; ! Primitive[] sub = primitive.split(); ! for (int i = 0; i < sub.length; i++) ! if (!addPrimitive(sub[i], recursionLevel + 1, objectToCamera)) ! return false; ! return true; ! } ! ! private void placeInBucket(Primitive primitive, BoundingVolume bv) { ! Bounds2f bounds = bv.transform(cameraToRaster).getBoundingBox().toBounds2f(); ! primitive.setRasterBounds(bounds); ! Point2f min = bounds.getMin(); ! int column = Calc.clamp((int) (min.x / bucketWidth), 0, bucketColumns - 1); ! int row = Calc.clamp((int) (min.y / bucketHeight), 0, bucketRows - 1); ! getBucket(column, row).addPrimitive(primitive); ! } ! ! private Bucket getBucket(int column, int row) { ! return buckets[row * bucketColumns + column]; } *************** *** 49,59 **** public void init(Frame frame, World world) { super.init(frame, world); ! createClippingVolume(frame); ! // TODO create buckets } ! private void createClippingVolume(Frame frame) { ! Bounds2f rasterWindow = createRasterWindow(); Transform rasterToScreen = Global.getTransform("raster").getInverse(); Bounds2f renderingScreenWindow = rasterWindow.transform(rasterToScreen); --- 110,136 ---- public void init(Frame frame, World world) { super.init(frame, world); ! worldToCamera = Global.getTransform("camera"); ! Transform cameraToScreen = Global.getTransform("screen"); ! Transform screenToRaster = Global.getTransform("raster"); ! cameraToRaster = screenToRaster.concat(cameraToScreen); ! eyePlane = Plane.createWithPointAndNormal(new Point3f(), new Vector3f(0f, 0f, -1f)); ! createClippingVolume(); ! createBuckets(); ! } + private void createBuckets() { + Point2f min = rasterWindow.getMin(); + Point2f max = rasterWindow.getMax(); + float width = max.x - min.x + 1; + float height = max.y - min.y + 1; + bucketWidth = frame.getBucketSizeX(); + bucketHeight = frame.getBucketSizeY(); + bucketColumns = (int) Math.ceil(width / bucketWidth); + bucketRows = (int) Math.ceil(height / bucketHeight); + buckets = new Bucket[bucketColumns * bucketRows]; } ! private void createClippingVolume() { ! rasterWindow = createRasterWindow(); Transform rasterToScreen = Global.getTransform("raster").getInverse(); Bounds2f renderingScreenWindow = rasterWindow.transform(rasterToScreen); *************** *** 71,79 **** clippingVolume.addPlane(Plane.createWithThreePoints(origin, lowerLeft, upperLeft)); float near = frame.getNearClipping(); - float far = frame.getFarClipping(); clippingVolume.addPlane( Plane.createWithPointAndNormal( new Point3f(0f, 0f, near), new Vector3f(0f, 0f, -1f))); clippingVolume.addPlane( Plane.createWithPointAndNormal( --- 148,156 ---- clippingVolume.addPlane(Plane.createWithThreePoints(origin, lowerLeft, upperLeft)); float near = frame.getNearClipping(); clippingVolume.addPlane( Plane.createWithPointAndNormal( new Point3f(0f, 0f, near), new Vector3f(0f, 0f, -1f))); + float far = frame.getFarClipping(); clippingVolume.addPlane( Plane.createWithPointAndNormal( |
From: <ma...@us...> - 2003-04-15 10:15:19
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv27418/src/org/jrman/primitive Modified Files: Primitive.java Sphere.java Log Message: Continued implementing Renderer. Fixed some bugs... Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Primitive.java 14 Apr 2003 08:37:55 -0000 1.2 --- Primitive.java 15 Apr 2003 10:15:14 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- import org.jrman.attributes.Attributes; import org.jrman.geom.BoundingVolume; + import org.jrman.geom.Bounds2f; public abstract class Primitive { *************** *** 31,34 **** --- 32,39 ---- protected Attributes attributes; + protected Bounds2f rasterBounds; + + protected BoundingVolume boundingVolume; + protected Primitive(Map parameters, Attributes attributes) { this.parameters = parameters; *************** *** 40,48 **** } ! public abstract BoundingVolume getBoundingVolume(); public abstract Primitive[] split(); public abstract Map dice(); } --- 45,63 ---- } ! public BoundingVolume getBoundingVolume() { ! if (boundingVolume == null) ! boundingVolume = internalGetBoundingVolume(); ! return boundingVolume; ! } ! ! protected abstract BoundingVolume internalGetBoundingVolume(); public abstract Primitive[] split(); public abstract Map dice(); + + public void setRasterBounds(Bounds2f bounds) { + this.rasterBounds = bounds; + } } Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sphere.java 15 Apr 2003 06:54:54 -0000 1.3 --- Sphere.java 15 Apr 2003 10:15:15 -0000 1.4 *************** *** 58,62 **** } ! public BoundingVolume getBoundingVolume() { // TODO fix sphere bounding volume if (boundingVolume == null) --- 58,62 ---- } ! public BoundingVolume internalGetBoundingVolume() { // TODO fix sphere bounding volume if (boundingVolume == null) |
From: <ma...@us...> - 2003-04-15 10:15:19
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv27418/src/org/jrman/parser Modified Files: Parser.java Log Message: Continued implementing Renderer. Fixed some bugs... Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Parser.java 15 Apr 2003 05:22:10 -0000 1.27 --- Parser.java 15 Apr 2003 10:15:15 -0000 1.28 *************** *** 252,255 **** --- 252,256 ---- public void translate(float dx, float dy, float dz) { Matrix4f translation = new Matrix4f(); + translation.setIdentity(); translation.setTranslation(new Vector3f(dx, dy, dz)); concatTransform(translation); |
From: <ma...@us...> - 2003-04-15 10:15:18
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv27418/src/org/jrman/geom Modified Files: AffineTransform.java Log Message: Continued implementing Renderer. Fixed some bugs... Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AffineTransform.java 15 Apr 2003 06:54:53 -0000 1.7 --- AffineTransform.java 15 Apr 2003 10:15:13 -0000 1.8 *************** *** 83,88 **** Point2f min = screenWindow.getMin(); Point2f max = screenWindow.getMax(); ! Matrix4f m = new Matrix4f(); ! Matrix4f tmp = new Matrix4f( horizontalResolution / (max.x - min.x), --- 83,87 ---- Point2f min = screenWindow.getMin(); Point2f max = screenWindow.getMax(); ! Matrix4f m = new Matrix4f( horizontalResolution / (max.x - min.x), *************** *** 102,111 **** 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); --- 101,111 ---- 0f, 1f); ! Matrix4f tmp = new Matrix4f(); ! tmp.setIdentity(); 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.setIdentity(); tmp.setTranslation(new Vector3f(-min.x, -min.y, 0f)); m.mul(tmp); |
From: <ma...@us...> - 2003-04-15 06:54:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv9937/src/org/jrman/geom Modified Files: AffineTransform.java Transform.java Bounds2f.java Log Message: Implemented projection clipping volume. Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AffineTransform.java 15 Apr 2003 05:22:10 -0000 1.6 --- AffineTransform.java 15 Apr 2003 06:54:53 -0000 1.7 *************** *** 205,208 **** --- 205,222 ---- } + public void untransformPoint(Point2f point) { + Point3f p = new Point3f(point.x, point.y, 1f); + getInverseMatrix().transform(p); + point.x = p.x; + point.y = p.y; + } + + public void untransformPoint(Point2f point, Point3f out) { + Point3f p = new Point3f(point.x, point.y, 1f); + getInverseMatrix().transform(p); + out.x = p.x; + out.y = p.y; + } + public void untransformPoint(Point3f point) { getInverseMatrix().transform(point); *************** *** 263,266 **** --- 277,284 ---- } return inverseNormalsMatrix; + } + + public Transform getInverse() { + return new AffineTransform(getInverseMatrix()); } Index: Transform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Transform.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Transform.java 15 Apr 2003 05:22:10 -0000 1.3 --- Transform.java 15 Apr 2003 06:54:53 -0000 1.4 *************** *** 54,57 **** --- 54,61 ---- void transformNormal(Vector3f normal, Vector3f out); + void untransformPoint(Point2f point); + + void untransformPoint(Point2f point, Point3f out); + void untransformPoint(Point3f point); *************** *** 69,72 **** --- 73,78 ---- void untransformNormal(Vector3f normal, Vector3f out); + + Transform getInverse(); Matrix4f getMatrix(); Index: Bounds2f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds2f.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Bounds2f.java 15 Apr 2003 05:22:10 -0000 1.4 --- Bounds2f.java 15 Apr 2003 06:54:53 -0000 1.5 *************** *** 56,60 **** } ! public Bounds2f transformToBounds2f(Transform transform) { MutableBounds2f mb = new MutableBounds2f(); Point2f p = new Point2f(); --- 56,60 ---- } ! public Bounds2f transform(Transform transform) { MutableBounds2f mb = new MutableBounds2f(); Point2f p = new Point2f(); |
From: <ma...@us...> - 2003-04-15 06:54:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv9937/src/org/jrman/primitive Modified Files: Sphere.java Log Message: Implemented projection clipping volume. Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sphere.java 14 Apr 2003 08:37:56 -0000 1.2 --- Sphere.java 15 Apr 2003 06:54:54 -0000 1.3 *************** *** 59,63 **** public BoundingVolume getBoundingVolume() { ! // Should implement a tighter bounding volume if (boundingVolume == null) boundingVolume = --- 59,63 ---- public BoundingVolume getBoundingVolume() { ! // TODO fix sphere bounding volume if (boundingVolume == null) boundingVolume = |
From: <ma...@us...> - 2003-04-15 06:54:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv9937/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Implemented projection clipping volume. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RendererHidden.java 15 Apr 2003 05:22:10 -0000 1.1 --- RendererHidden.java 15 Apr 2003 06:54:53 -0000 1.2 *************** *** 20,35 **** package org.jrman.render; import org.jrman.primitive.Primitive; public class RendererHidden extends Renderer { public void addPrimitive(Primitive primitive) { // TODO Auto-generated method stub - } public void render() { // TODO Auto-generated method stub } --- 20,105 ---- package org.jrman.render; + import javax.vecmath.Point2f; + import javax.vecmath.Point3f; + import javax.vecmath.Vector3f; + + import org.jrman.geom.Bounds2f; + import org.jrman.geom.ClippingVolume; + import org.jrman.geom.Plane; + import org.jrman.geom.Transform; + import org.jrman.options.Filter; + import org.jrman.parser.Frame; + import org.jrman.parser.Global; + import org.jrman.parser.World; import org.jrman.primitive.Primitive; + import org.jrman.util.Calc; public class RendererHidden extends Renderer { + private ClippingVolume clippingVolume; + public void addPrimitive(Primitive primitive) { // TODO Auto-generated method stub } public void render() { // TODO Auto-generated method stub + } + + public void init(Frame frame, World world) { + super.init(frame, world); + createClippingVolume(frame); + // TODO create buckets + + } + + private void createClippingVolume(Frame frame) { + Bounds2f rasterWindow = createRasterWindow(); + Transform rasterToScreen = Global.getTransform("raster").getInverse(); + Bounds2f renderingScreenWindow = rasterWindow.transform(rasterToScreen); + Point2f min = renderingScreenWindow.getMin(); + Point2f max = renderingScreenWindow.getMax(); + clippingVolume = new ClippingVolume(); + Point3f origin = new Point3f(); + Point3f upperLeft = new Point3f(min.x, max.y, 1f); + Point3f upperRight = new Point3f(max.x, max.y, 1f); + Point3f lowerLeft = new Point3f(min.x, min.y, 1f); + Point3f lowerRight = new Point3f(max.x, min.y, 1f); + clippingVolume.addPlane(Plane.createWithThreePoints(origin, upperLeft, upperRight)); + clippingVolume.addPlane(Plane.createWithThreePoints(origin, upperRight, lowerRight)); + clippingVolume.addPlane(Plane.createWithThreePoints(origin, lowerRight, lowerLeft)); + clippingVolume.addPlane(Plane.createWithThreePoints(origin, lowerLeft, upperLeft)); + float near = frame.getNearClipping(); + float far = frame.getFarClipping(); + clippingVolume.addPlane( + Plane.createWithPointAndNormal( + new Point3f(0f, 0f, near), + new Vector3f(0f, 0f, -1f))); + clippingVolume.addPlane( + Plane.createWithPointAndNormal( + new Point3f(0f, 0f, far), + new Vector3f(0f, 0f, 1f))); + } + private Bounds2f createRasterWindow() { + Bounds2f cropWindow = frame.getCropWindow(); + Point2f min = cropWindow.getMin(); + Point2f max = cropWindow.getMax(); + int xResolution = frame.getHorizontalResolution(); + int yResolution = frame.getVerticalResolution(); + float rxmin = Calc.clamp((float) Math.ceil(xResolution * min.x), 0f, xResolution - 1); + float rxmax = + Calc.clamp((float) Math.ceil(xResolution * max.x - 1f), 0f, xResolution - 1); + float rymin = Calc.clamp((float) Math.ceil(yResolution * min.y), 0f, yResolution - 1); + float rymax = + Calc.clamp((float) Math.ceil(yResolution * max.y - 1f), 0f, yResolution - 1); + Filter filter = frame.getFilter(); + float xw = filter.getHorizontalWidth() / 2f; + float yw = filter.getVerticalWidth() / 2f; + rxmin = (float) Math.floor(rxmin - xw); + rxmax = (float) Math.ceil(rxmax + xw); + rymin = (float) Math.floor(rymin - yw); + rymax = (float) Math.ceil(rymax + yw); + return new Bounds2f(rxmin, rxmax, rymin, rymax); } |
From: <ma...@us...> - 2003-04-15 05:22:14
|
Update of /cvsroot/jrman/drafts/src/org/jrman/main In directory sc8-pr-cvs1:/tmp/cvs-serv10538/src/org/jrman/main Added Files: JRMan.java Log Message: Organized code to start working on renderer. --- NEW FILE: JRMan.java --- /* JRMan.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.main; import org.jrman.parser.Parser; public class JRMan { public static void main(String args[]) throws Exception { Parser parser = new Parser(); parser.begin(args[0]); parser.parse(args[0]); parser.end(); } } |
From: <ma...@us...> - 2003-04-15 05:22:14
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs1:/tmp/cvs-serv10538/src/org/jrman/util Modified Files: Calc.java Log Message: Organized code to start working on renderer. Index: Calc.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Calc.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Calc.java 14 Apr 2003 08:38:01 -0000 1.1 --- Calc.java 15 Apr 2003 05:22:11 -0000 1.2 *************** *** 30,33 **** --- 30,37 ---- private Calc() { } + + public static float clamp(float v, float min, float max) { + return Math.min(Math.max(v, min), max); + } public static float interpolate(float a, float b, float alpha) { |
From: <ma...@us...> - 2003-04-15 05:22:14
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv10538/src/org/jrman/parser Modified Files: World.java Parser.java Log Message: Organized code to start working on renderer. Index: World.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/World.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** World.java 12 Apr 2003 15:19:50 -0000 1.2 --- World.java 15 Apr 2003 05:22:10 -0000 1.3 *************** *** 20,29 **** package org.jrman.parser; - import java.util.ArrayList; import java.util.HashMap; - import java.util.List; import java.util.Map; - import org.jrman.primitive.Primitive; import org.jrman.shaders.LightShader; --- 20,26 ---- *************** *** 32,45 **** private Map lights; - private List primitives; - public World() { lights = new HashMap(); - primitives = new ArrayList(); } public World(World other) { lights = new HashMap(other.lights); - primitives = new ArrayList(other.primitives); } --- 29,38 ---- *************** *** 53,60 **** throw new IllegalArgumentException("no such light: " + sequenceNumber); return light; - } - - public void addPrimitive(Primitive primitive) { - primitives.add(primitive); // Just for now... } --- 46,49 ---- Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Parser.java 14 Apr 2003 08:38:00 -0000 1.26 --- Parser.java 15 Apr 2003 05:22:10 -0000 1.27 *************** *** 58,61 **** --- 58,62 ---- import org.jrman.parser.keywords.KeywordParser; import org.jrman.primitive.Sphere; + import org.jrman.render.Renderer; import org.jrman.shaders.Imager; import org.jrman.shaders.LightShader; *************** *** 66,78 **** public class Parser { private boolean inAreaLightSource; ! private String renderer; private World world; private Frame frame; ! ! private final static String KEYWORD_PREFIX = "org.jrman.parser.keywords.Keyword"; private Map keywordParsers = new HashMap(); --- 67,81 ---- public class Parser { + private final static String KEYWORD_PREFIX = "org.jrman.parser.keywords.Keyword"; + private boolean inAreaLightSource; ! private String beginName; private World world; private Frame frame; ! ! private Renderer renderer; private Map keywordParsers = new HashMap(); *************** *** 158,168 **** } - public static void main(String args[]) throws Exception { - Parser parser = new Parser(); - parser.begin(args[0]); - parser.parse(args[0]); - parser.end(); - } - private KeywordParser getKeyWordParser(String keyword) throws Exception { KeywordParser kp = (KeywordParser) keywordParsers.get(keyword.toLowerCase()); --- 161,164 ---- *************** *** 330,334 **** public void begin(String renderer) { ! this.renderer = renderer; pushState(State.BEGIN_END); } --- 326,330 ---- public void begin(String renderer) { ! this.beginName = renderer; pushState(State.BEGIN_END); } *************** *** 379,385 **** --- 375,384 ---- setIdentity(); worldStack.push(new World(world)); + renderer = Renderer.createRenderer(frame, world); } public void worldEnd() { + renderer.render(); + renderer = null; world = (World) worldStack.pop(); popState(); *************** *** 649,653 **** float thetaMin = 0f; thetaMax = toRadians(thetaMax); ! world.addPrimitive( new Sphere( radius, --- 648,652 ---- float thetaMin = 0f; thetaMax = toRadians(thetaMax); ! renderer.addPrimitive( new Sphere( radius, |
From: <ma...@us...> - 2003-04-15 05:22:14
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv10538/src/org/jrman/render Added Files: Renderer.java RendererNull.java RendererHidden.java Log Message: Organized code to start working on renderer. --- NEW FILE: Renderer.java --- /* Renderer.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.render; import org.jrman.options.Hider; import org.jrman.parser.Frame; import org.jrman.parser.World; import org.jrman.primitive.Primitive; public abstract class Renderer { protected Frame frame; protected World world; public static Renderer createRenderer(Frame frame, World world) { Renderer renderer = null; Hider hider = frame.getHider(); if (hider == Hider.HIDDEN) renderer = new RendererHidden(); else if (hider == Hider.NULL) renderer = new RendererNull(); renderer.init(frame, world); return renderer; } public abstract void addPrimitive(Primitive primitive); public abstract void render(); public void init(Frame frame, World world) { this.frame = frame; this.world = world; } } --- NEW FILE: RendererNull.java --- /* RendererNull.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.render; import org.jrman.primitive.Primitive; public class RendererNull extends Renderer { public void addPrimitive(Primitive primitive) { } public void render() { } } --- NEW FILE: RendererHidden.java --- /* RendererHidden.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.render; import org.jrman.primitive.Primitive; public class RendererHidden extends Renderer { public void addPrimitive(Primitive primitive) { // TODO Auto-generated method stub } public void render() { // TODO Auto-generated method stub } } |
From: <ma...@us...> - 2003-04-15 05:22:13
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv10538/src/org/jrman/primitive Modified Files: Quadric.java Log Message: Organized code to start working on renderer. Index: Quadric.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Quadric.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Quadric.java 14 Apr 2003 08:37:56 -0000 1.1 --- Quadric.java 15 Apr 2003 05:22:10 -0000 1.2 *************** *** 112,115 **** --- 112,116 ---- sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); } + result.put(name, sparam); } else if (type == Declaration.Type.HPOINT) { Point4f[][] param = (Point4f[][]) parameters.get(name); *************** *** 130,133 **** --- 131,135 ---- sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); } + result.put(name, sparam); } else if (type == Declaration.Type.MATRIX) { Matrix4f[][] param = (Matrix4f[][]) parameters.get(name); *************** *** 148,151 **** --- 150,154 ---- sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); } + result.put(name, sparam); } } |
From: <ma...@us...> - 2003-04-15 05:22:13
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv10538/src/org/jrman/geom Modified Files: AffineTransform.java Transform.java Bounds2f.java Added Files: MutableBounds2f.java Log Message: Organized code to start working on renderer. --- NEW FILE: MutableBounds2f.java --- /* MutableBounds2f.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.geom; import javax.vecmath.Point2f; public class MutableBounds2f extends Bounds2f { public void addPoint(float x, float y) { min.x = Math.min(x, min.x); min.y = Math.min(y, min.y); max.x =Math.max(x, max.x); max.y = Math.max(y, max.y); } public void addPoint(Point2f point) { addPoint(point.x, point.y); } } Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AffineTransform.java 12 Apr 2003 20:52:01 -0000 1.5 --- AffineTransform.java 15 Apr 2003 05:22:10 -0000 1.6 *************** *** 159,162 **** --- 159,176 ---- } + public void transformPoint(Point2f point) { + Point3f p = new Point3f(point.x, point.y, 1f); + matrix.transform(p); + point.x = p.x; + point.y = p.y; + } + + public void transformPoint(Point2f point, Point2f out) { + Point3f p = new Point3f(point.x, point.y, 1f); + matrix.transform(p); + out.x = p.x; + out.y = p.y; + } + public void transformPoint(Point3f point) { matrix.transform(point); Index: Transform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Transform.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Transform.java 9 Apr 2003 16:05:07 -0000 1.2 --- Transform.java 15 Apr 2003 05:22:10 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- import javax.vecmath.Matrix4f; + import javax.vecmath.Point2f; import javax.vecmath.Point3f; import javax.vecmath.Point4f; *************** *** 32,35 **** --- 33,40 ---- Transform concat(Matrix4f matrix); + + void transformPoint(Point2f point); + + void transformPoint(Point2f point, Point2f out); void transformPoint(Point3f point); Index: Bounds2f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Bounds2f.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Bounds2f.java 13 Apr 2003 05:15:32 -0000 1.3 --- Bounds2f.java 15 Apr 2003 05:22:10 -0000 1.4 *************** *** 22,30 **** import javax.vecmath.Point2f; public class Bounds2f { ! private Point2f max; ! private Point2f min; public Bounds2f(float xMin, float xMax, float yMin, float yMax) { --- 22,32 ---- import javax.vecmath.Point2f; + import org.jrman.util.Constants; + public class Bounds2f { ! protected Point2f max; ! protected Point2f min; public Bounds2f(float xMin, float xMax, float yMin, float yMax) { *************** *** 38,41 **** --- 40,47 ---- } + protected Bounds2f() { // Empty + this(Constants.INFINITY, -Constants.INFINITY, Constants.INFINITY, -Constants.INFINITY); + } + public boolean intersects(Bounds2f other) { if (min.x > other.max.x) *************** *** 48,51 **** --- 54,75 ---- return false; return true; + } + + public Bounds2f transformToBounds2f(Transform transform) { + MutableBounds2f mb = new MutableBounds2f(); + Point2f p = new Point2f(); + p.set(min.x, min.y); + transform.transformPoint(p); + mb.addPoint(p); + p.set(min.x, max.y); + transform.transformPoint(p); + mb.addPoint(p); + p.set(max.x, min.y); + transform.transformPoint(p); + mb.addPoint(p); + p.set(max.x, max.y); + transform.transformPoint(p); + mb.addPoint(p); + return new Bounds2f(mb.min, mb.max); } |
From: <ma...@us...> - 2003-04-15 05:21:55
|
Update of /cvsroot/jrman/drafts/src/org/jrman/main In directory sc8-pr-cvs1:/tmp/cvs-serv10459/src/org/jrman/main Log Message: Directory /cvsroot/jrman/drafts/src/org/jrman/main added to the repository |
From: <ma...@us...> - 2003-04-15 05:21:55
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv10459/src/org/jrman/render Log Message: Directory /cvsroot/jrman/drafts/src/org/jrman/render added to the repository |
From: <ma...@us...> - 2003-04-14 17:22:44
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv31127/src/org/jrman/parser Modified Files: Frame.java Log Message: Fixed near and far clipping planes. Index: Frame.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Frame.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Frame.java 12 Apr 2003 17:07:22 -0000 1.1 --- Frame.java 14 Apr 2003 17:22:37 -0000 1.2 *************** *** 34,37 **** --- 34,38 ---- import org.jrman.options.Quantizer; import org.jrman.shaders.Imager; + import org.jrman.util.Constants; public class Frame { *************** *** 114,120 **** cropWindow = new Bounds2f(0f, 1f, 0f, 1f); cameraProjection = CameraProjection.ORTHOGRAPHIC; ! nearClipping = Float.MIN_VALUE; ! farClipping = Float.POSITIVE_INFINITY; ! fStop = Float.POSITIVE_INFINITY; shutterOpen = 0f; shutterClose = 0f; --- 115,121 ---- cropWindow = new Bounds2f(0f, 1f, 0f, 1f); cameraProjection = CameraProjection.ORTHOGRAPHIC; ! nearClipping = Constants.EPSILON; ! farClipping = Constants.INFINITY; ! fStop = Constants.INFINITY; shutterOpen = 0f; shutterClose = 0f; *************** *** 129,132 **** --- 130,136 ---- colorSamples = 3; relativeDetail = 1f; + gridSize = 256; + bucketSizeX = 16; + bucketSizeY = 16; } |