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
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv25626/src/org/jrman/render Modified Files: SamplePoint.java RendererHidden.java ShaderVariables.java Micropolygon.java Sampler.java Log Message: More optimizations. Index: SamplePoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/SamplePoint.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SamplePoint.java 6 May 2003 02:15:44 -0000 1.4 --- SamplePoint.java 6 May 2003 20:54:27 -0000 1.5 *************** *** 56,61 **** } ! public Color3f getColor() { ! int i = 0;; while (i < samples.size()) { Sample sample = (Sample) samples.get(i++); --- 56,62 ---- } ! public void getColor(Color3f ocolor) { ! ocolor.set(0f, 0f, 0f); ! int i = 0; while (i < samples.size()) { Sample sample = (Sample) samples.get(i++); *************** *** 63,77 **** break; } - Color3f result = new Color3f(); while (i > 0) { Sample sample = (Sample) samples.get(--i); sample.getOpacity(opacity); ! result.x *= (1f - opacity.x); ! result.y *= (1f - opacity.y); ! result.z *= (1f - opacity.z); sample.getColor(color); ! result.add(color); } - return result; } --- 64,76 ---- break; } while (i > 0) { Sample sample = (Sample) samples.get(--i); sample.getOpacity(opacity); ! ocolor.x *= (1f - opacity.x); ! ocolor.y *= (1f - opacity.y); ! ocolor.z *= (1f - opacity.z); sample.getColor(color); ! ocolor.add(color); } } Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RendererHidden.java 6 May 2003 02:15:44 -0000 1.11 --- RendererHidden.java 6 May 2003 20:54:27 -0000 1.12 *************** *** 23,28 **** import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; - import java.util.Collection; - import java.util.Iterator; import javax.swing.JFrame; --- 23,26 ---- *************** *** 130,134 **** } ! private void addToBuckets(Micropolygon mp) { float mpMinX = mp.getMinX() - rasterWindowMin.x; float mpMinY = mp.getMinY() - rasterWindowMin.y; --- 128,132 ---- } ! public void addToBuckets(Micropolygon mp) { float mpMinX = mp.getMinX() - rasterWindowMin.x; float mpMinY = mp.getMinY() - rasterWindowMin.y; *************** *** 185,191 **** attr.getSurface().shade(shaderVariables); shaderVariables.transform(cameraToRaster); ! Collection c = shaderVariables.getMicropolygons(); ! for (Iterator it = c.iterator(); it.hasNext();) ! addToBuckets((Micropolygon) it.next()); } else { Primitive[] sub = p.split(); --- 183,187 ---- attr.getSurface().shade(shaderVariables); shaderVariables.transform(cameraToRaster); ! shaderVariables.getMicropolygons(this); } else { Primitive[] sub = p.split(); Index: ShaderVariables.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/ShaderVariables.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ShaderVariables.java 6 May 2003 02:15:44 -0000 1.2 --- ShaderVariables.java 6 May 2003 20:54:27 -0000 1.3 *************** *** 20,27 **** package org.jrman.render; - import java.util.ArrayList; - import java.util.Collection; import java.util.HashMap; - import java.util.List; import java.util.Map; --- 20,24 ---- *************** *** 96,106 **** } ! public Collection getMicropolygons() { int columns = Grid.getUSize(); int rows = Grid.getVSize(); ! List result = new ArrayList((rows - 1) * (columns - 1)); ! Point3fGrid pg = new Point3fGrid(); ! pg.set(P); ! Point3f[] p = (Point3f[]) pg.data; Color3f[] c = (Color3f[]) Ci.data; Color3f[] o = (Color3f[]) Oi.data; --- 93,100 ---- } ! public void getMicropolygons(RendererHidden rh) { int columns = Grid.getUSize(); int rows = Grid.getVSize(); ! Point3f[] p = (Point3f[]) P.data; Color3f[] c = (Color3f[]) Ci.data; Color3f[] o = (Color3f[]) Oi.data; *************** *** 108,112 **** for (int row = 0; row < rows - 1; row++) { int offset = row * columns + col; ! result.add( new Micropolygon( p[offset], --- 102,106 ---- for (int row = 0; row < rows - 1; row++) { int offset = row * columns + col; ! rh.addToBuckets( new Micropolygon( p[offset], *************** *** 119,123 **** o[offset].y, o[offset].z)); ! result.add( new Micropolygon( p[offset + columns + 1], --- 113,117 ---- o[offset].y, o[offset].z)); ! rh.addToBuckets( new Micropolygon( p[offset + columns + 1], *************** *** 131,135 **** o[offset + columns + 1].z)); } - return result; } --- 125,128 ---- Index: Micropolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Micropolygon.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Micropolygon.java 6 May 2003 02:15:44 -0000 1.4 --- Micropolygon.java 6 May 2003 20:54:27 -0000 1.5 *************** *** 20,24 **** package org.jrman.render; - import javax.vecmath.Color3f; import javax.vecmath.Point2f; import javax.vecmath.Point3f; --- 20,23 ---- *************** *** 36,44 **** private static Vector3f cp = new Vector3f(); ! private Point3f a; ! private Point3f b; ! private Point3f c; private float colorRed; --- 35,51 ---- private static Vector3f cp = new Vector3f(); ! private float ax; ! private float ay; ! private float bx; ! ! private float by; ! ! private float cx; ! ! private float cy; ! ! private float z; private float colorRed; *************** *** 63,69 **** public Micropolygon( ! Point3f pa, ! Point3f pb, ! Point3f pc, float cRed, float cGreen, --- 70,76 ---- public Micropolygon( ! Point3f a, ! Point3f b, ! Point3f c, float cRed, float cGreen, *************** *** 72,78 **** float oGreen, float oBlue) { ! a = pa; ! b = pb; ! c = pc; colorRed = cRed; colorGreen = cGreen; --- 79,102 ---- float oGreen, float oBlue) { ! // Face forward ! ab.sub(b, a); ! ac.sub(c, a); ! cp.cross(ab, ac); ! if (cp.z > 0) { ! Point3f tmp = b; ! b = c; ! c = tmp; ! } ! // get bounds ! addPointToBounds(a.x, a.y); ! addPointToBounds(b.x, b.y); ! addPointToBounds(c.x, c.y); ! ax = a.x; ! ay = a.y; ! bx = b.x; ! by = b.y; ! cx = c.x; ! cy = c.y; ! z = (a.z + b.z + c.z) / 3f; colorRed = cRed; colorGreen = cGreen; *************** *** 81,92 **** opacityGreen = oGreen; opacityBlue = oBlue; - setBounds(); - faceScreen(); - } - - private void setBounds() { - addPointToBounds(a.x, a.y); - addPointToBounds(b.x, b.y); - addPointToBounds(c.x, c.y); } --- 105,108 ---- *************** *** 98,118 **** } - private void faceScreen() { - ab.sub(b, a); - ac.sub(c, a); - cp.cross(ab, ac); - if (cp.z > 0) { - Point3f tmp = b; - b = c; - c = tmp; - } - } - public Sample getSample(Point2f point) { ! if ((a.y - b.y) * (point.x - a.x) + (b.x - a.x) * (point.y - a.y) > 0f) return null; ! if ((b.y - c.y) * (point.x - b.x) + (c.x - b.x) * (point.y - b.y) > 0f) return null; ! if ((c.y - a.y) * (point.x - c.x) + (a.x - c.x) * (point.y - c.y) > 0f) return null; return new Sample( --- 114,123 ---- } public Sample getSample(Point2f point) { ! if ((ay - by) * (point.x - ax) + (bx - ax) * (point.y - ay) > 0f) return null; ! if ((by - cy) * (point.x - bx) + (cx - bx) * (point.y - by) > 0f) return null; ! if ((cy - ay) * (point.x - cx) + (ax - cx) * (point.y - cy) > 0f) return null; return new Sample( *************** *** 123,127 **** opacityGreen, opacityBlue, ! (a.z + b.z + c.z) / 3f); } --- 128,132 ---- opacityGreen, opacityBlue, ! z); } Index: Sampler.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Sampler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sampler.java 6 May 2003 02:15:44 -0000 1.3 --- Sampler.java 6 May 2003 20:54:27 -0000 1.4 *************** *** 38,41 **** --- 38,43 ---- private SamplePoint[] samplePoints; + + private Color3f[] colors; public Sampler(int bucketWidth, int bucketHeight, float hSamples, float vSamples) { *************** *** 47,50 **** --- 49,55 ---- for (int i = 0; i < samplePoints.length; i++) samplePoints[i] = new SamplePoint(); + colors = new Color3f[width * height]; + for (int i = 0; i < colors.length; i++) + colors[i] = new Color3f(); } *************** *** 70,77 **** public Color3f[] getColors() { - Color3f[] result = new Color3f[samplePoints.length]; for (int i = 0; i < samplePoints.length; i++) ! result[i] = samplePoints[i].getColor(); ! return result; } --- 75,81 ---- public Color3f[] getColors() { for (int i = 0; i < samplePoints.length; i++) ! samplePoints[i].getColor(colors[i]); ! return colors; } |
From: <ma...@us...> - 2003-05-06 20:54:55
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv25626/sampleData Modified Files: AllSpheres.rib ManySpheres.rib Log Message: More optimizations. Index: AllSpheres.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/AllSpheres.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AllSpheres.rib 6 May 2003 02:15:14 -0000 1.4 --- AllSpheres.rib 6 May 2003 20:54:27 -0000 1.5 *************** *** 1,49999 **** TransformBegin ! Color 0.2960330237876859 0.2963578609228692 0.9686360289633602 Translate -50.0 0 -50.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin ! Color 0.07270954429935494 0.12071078939749802 0.9089651445293251 Translate -49.0 0 -50.0 Sphere .5 -5 .5 360 TransformEnd [...99969 lines suppressed...] TransformEnd TransformBegin ! Color 0.39352321149155156 0.5225826726074548 0.32230497760793775 Translate 46.0 0 49.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin ! Color 0.9202442969458572 0.862226603416244 0.8946551135282601 Translate 47.0 0 49.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin ! Color 0.6172083879935975 0.6628563845834179 0.7013204673334276 Translate 48.0 0 49.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin ! Color 0.37540754656456454 0.8284576603747668 0.9026455209519867 Translate 49.0 0 49.0 Sphere .5 -5 .5 360 Index: ManySpheres.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/ManySpheres.rib,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ManySpheres.rib 6 May 2003 02:15:44 -0000 1.5 --- ManySpheres.rib 6 May 2003 20:54:36 -0000 1.6 *************** *** 3,8 **** Exposure 1 2.5 Clipping 1 1000 ! #Option "limits" "bucketsize" [32 32] Projection "perspective" "fov" 50 Surface "fakedlight" Translate 0 0 60 --- 3,9 ---- Exposure 1 2.5 Clipping 1 1000 ! #Option "limits" "bucketsize" [64 64] "gridsize" [4096] Projection "perspective" "fov" 50 + ShadingRate 1 Surface "fakedlight" Translate 0 0 60 |
From: <ma...@us...> - 2003-05-06 20:54:41
|
Update of /cvsroot/jrman/drafts/src/org/jrman/main In directory sc8-pr-cvs1:/tmp/cvs-serv25626/src/org/jrman/main Modified Files: JRMan.java Log Message: More optimizations. Index: JRMan.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/main/JRMan.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JRMan.java 15 Apr 2003 05:22:11 -0000 1.1 --- JRMan.java 6 May 2003 20:54:36 -0000 1.2 *************** *** 25,32 **** --- 25,35 ---- public static void main(String args[]) throws Exception { + long start = System.currentTimeMillis(); Parser parser = new Parser(); parser.begin(args[0]); parser.parse(args[0]); parser.end(); + long end = System.currentTimeMillis(); + System.out.println("Total time = " + (float) (end - start) / 1000f); } |
From: <ma...@us...> - 2003-05-06 20:54:31
|
Update of /cvsroot/jrman/drafts/tests/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv25626/tests/org/jrman/geom Removed Files: AffineTransformTest.java Log Message: More optimizations. --- AffineTransformTest.java DELETED --- |
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv28769/src/org/jrman/render Modified Files: RendererHidden.java ShaderVariables.java Sampler.java SamplePoint.java Micropolygon.java Sample.java Log Message: Implemented some optimizations. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RendererHidden.java 4 May 2003 22:33:39 -0000 1.10 --- RendererHidden.java 6 May 2003 02:15:44 -0000 1.11 *************** *** 39,43 **** import org.jrman.geom.Plane; import org.jrman.geom.Transform; - import org.jrman.grid.Grid; import org.jrman.options.Filter; import org.jrman.options.Quantizer; --- 39,42 ---- *************** *** 61,65 **** private Bounds2f rasterWindow; ! private Bucket[] buckets; --- 60,66 ---- private Bounds2f rasterWindow; ! ! private Point2f rasterWindowMin; ! private Bucket[] buckets; *************** *** 130,143 **** private void addToBuckets(Micropolygon mp) { ! Bounds2f b = mp.getBounds(); ! Point2f bmin = b.getMin(); ! Point2f rmin = rasterWindow.getMin(); ! bmin.sub(rmin); ! Point2f bmax = b.getMax(); ! bmax.sub(rmin); ! int minColumn = Calc.clamp((int) (bmin.x / bucketWidth), 0, bucketColumns - 1); ! int minRow = Calc.clamp((int) (bmin.y / bucketHeight), 0, bucketRows - 1); ! int maxColumn = Calc.clamp((int) (bmax.x / bucketWidth), 0, bucketColumns - 1); ! int maxRow = Calc.clamp((int) (bmax.y / bucketHeight), 0, bucketRows - 1); for (int col = minColumn; col <= maxColumn; col++) for (int row = minRow; row <= maxRow; row++) --- 131,142 ---- private void addToBuckets(Micropolygon mp) { ! float mpMinX = mp.getMinX() - rasterWindowMin.x; ! float mpMinY = mp.getMinY() - rasterWindowMin.y; ! float mpMaxX = mp.getMaxX() - rasterWindowMin.x; ! float mpMaxY = mp.getMaxY() - rasterWindowMin.y; ! int minColumn = Calc.clamp((int) (mpMinX / bucketWidth), 0, bucketColumns - 1); ! int minRow = Calc.clamp((int) (mpMinY / bucketHeight), 0, bucketRows - 1); ! int maxColumn = Calc.clamp((int) (mpMaxX / bucketWidth), 0, bucketColumns - 1); ! int maxRow = Calc.clamp((int) (mpMaxY / bucketHeight), 0, bucketRows - 1); for (int col = minColumn; col <= maxColumn; col++) for (int row = minRow; row <= maxRow; row++) *************** *** 162,167 **** jf.setVisible(true); int gridSize = frame.getGridSize(); - int gridSide = (int) Math.round(Math.sqrt(gridSize)) + 1; - Grid.setSize(gridSide, gridSide); ShaderVariables shaderVariables = new ShaderVariables(); int gridCount = 0; --- 161,164 ---- *************** *** 258,261 **** --- 255,259 ---- private void createClippingVolume() { rasterWindow = createRasterWindow(); + rasterWindowMin = rasterWindow.getMin(); Transform rasterToScreen = Global.getTransform("raster").getInverse(); Bounds2f renderingScreenWindow = rasterWindow.transform(rasterToScreen); Index: ShaderVariables.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/ShaderVariables.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ShaderVariables.java 2 May 2003 05:02:08 -0000 1.1 --- ShaderVariables.java 6 May 2003 02:15:44 -0000 1.2 *************** *** 99,112 **** int columns = Grid.getUSize(); int rows = Grid.getVSize(); ! List result = new ArrayList(); Point3fGrid pg = new Point3fGrid(); pg.set(P); Point3f[] p = (Point3f[]) pg.data; ! Color3fGrid cg = new Color3fGrid(); ! cg.set(Ci); ! Color3f[] c = (Color3f[]) cg.data; ! Color3fGrid og = new Color3fGrid(); ! og.set(Oi); ! Color3f[] o = (Color3f[]) og.data; for (int col = 0; col < columns - 1; col++) for (int row = 0; row < rows - 1; row++) { --- 99,108 ---- int columns = Grid.getUSize(); int rows = Grid.getVSize(); ! List result = new ArrayList((rows - 1) * (columns - 1)); Point3fGrid pg = new Point3fGrid(); pg.set(P); Point3f[] p = (Point3f[]) pg.data; ! Color3f[] c = (Color3f[]) Ci.data; ! Color3f[] o = (Color3f[]) Oi.data; for (int col = 0; col < columns - 1; col++) for (int row = 0; row < rows - 1; row++) { *************** *** 117,122 **** p[offset + 1], p[offset + columns], ! c[offset], ! o[offset])); result.add( new Micropolygon( --- 113,122 ---- p[offset + 1], p[offset + columns], ! c[offset].x, ! c[offset].y, ! c[offset].z, ! o[offset].x, ! o[offset].y, ! o[offset].z)); result.add( new Micropolygon( *************** *** 124,129 **** p[offset + 1], p[offset + columns], ! c[offset + columns + 1], ! o[offset + columns + 1])); } return result; --- 124,133 ---- p[offset + 1], p[offset + columns], ! c[offset + columns + 1].x, ! c[offset + columns + 1].y, ! c[offset + columns + 1].z, ! o[offset + columns + 1].x, ! o[offset + columns + 1].y, ! o[offset + columns + 1].z)); } return result; Index: Sampler.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Sampler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sampler.java 4 May 2003 22:33:39 -0000 1.2 --- Sampler.java 6 May 2003 02:15:44 -0000 1.3 *************** *** 23,27 **** import javax.vecmath.Point2f; - import org.jrman.geom.Bounds2f; import org.jrman.util.Calc; --- 23,26 ---- *************** *** 78,90 **** private void sampleMicropolygon(Micropolygon mp) { ! Bounds2f b = mp.getBounds(); ! Point2f mpMin = b.getMin(); ! mpMin.sub(min); ! Point2f mpMax = b.getMax(); ! mpMax.sub(min); ! int minColumn = Calc.clamp((int) (mpMin.x / sampleWidth), 0, width - 1); ! int minRow = Calc.clamp((int) (mpMin.y / sampleHeight), 0, height - 1); ! int maxColumn = Calc.clamp((int) (mpMax.x / sampleWidth), 0, width - 1); ! int maxRow = Calc.clamp((int) (mpMax.y / sampleHeight), 0, height - 1); for (int col = minColumn; col <= maxColumn; col++) for (int row = minRow; row <= maxRow; row++) --- 77,88 ---- private void sampleMicropolygon(Micropolygon mp) { ! float mpMinX = mp.getMinX() - min.x; ! float mpMaxX = mp.getMaxX() - min.x; ! float mpMinY = mp.getMinY() - min.y; ! float mpMaxY = mp.getMaxY() - min.y; ! int minColumn = Calc.clamp((int) (mpMinX / sampleWidth), 0, width - 1); ! int minRow = Calc.clamp((int) (mpMinY / sampleHeight), 0, height - 1); ! int maxColumn = Calc.clamp((int) (mpMaxX / sampleWidth), 0, width - 1); ! int maxRow = Calc.clamp((int) (mpMaxY / sampleHeight), 0, height - 1); for (int col = minColumn; col <= maxColumn; col++) for (int row = minRow; row <= maxRow; row++) Index: SamplePoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/SamplePoint.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SamplePoint.java 5 May 2003 02:17:39 -0000 1.3 --- SamplePoint.java 6 May 2003 02:15:44 -0000 1.4 *************** *** 22,26 **** import java.util.ArrayList; import java.util.List; - import java.util.ListIterator; import javax.vecmath.Color3f; --- 22,25 ---- *************** *** 33,36 **** --- 32,39 ---- private List samples = new ArrayList(); + private Color3f color = new Color3f(); + + private Color3f opacity = new Color3f(); + public void init(float x, float y) { point.set(x, y); *************** *** 42,51 **** if (sample == null) return; ! ListIterator it = samples.listIterator(); ! while (it.hasNext()) { ! Sample s = (Sample) it.next(); if (s.behind(sample)) { ! it.previous(); ! it.add(sample); return; } --- 45,53 ---- if (sample == null) return; ! int i = 0; ! while (i < samples.size()) { ! Sample s = (Sample) samples.get(i++); if (s.behind(sample)) { ! samples.add(--i, sample); return; } *************** *** 55,72 **** public Color3f getColor() { ! ListIterator it = samples.listIterator(); ! while (it.hasNext()) { ! Sample sample = (Sample) it.next(); if (sample.isOpaque()) break; } Color3f result = new Color3f(); ! while (it.hasPrevious()) { ! Sample sample = (Sample) it.previous(); ! Color3f opacity = sample.getOpacity(); result.x *= (1f - opacity.x); result.y *= (1f - opacity.y); result.z *= (1f - opacity.z); ! Color3f color = sample.getColor(); result.add(color); } --- 57,74 ---- public Color3f getColor() { ! int i = 0;; ! while (i < samples.size()) { ! Sample sample = (Sample) samples.get(i++); if (sample.isOpaque()) break; } Color3f result = new Color3f(); ! while (i > 0) { ! Sample sample = (Sample) samples.get(--i); ! sample.getOpacity(opacity); result.x *= (1f - opacity.x); result.y *= (1f - opacity.y); result.z *= (1f - opacity.z); ! sample.getColor(color); result.add(color); } Index: Micropolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Micropolygon.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Micropolygon.java 4 May 2003 22:33:39 -0000 1.3 --- Micropolygon.java 6 May 2003 02:15:44 -0000 1.4 *************** *** 25,100 **** import javax.vecmath.Vector3f; ! import org.jrman.geom.Bounds2f; ! import org.jrman.geom.MutableBounds2f; public class Micropolygon { ! // These static Vector3f are not thead safe!!! ! private static Vector3f ab= new Vector3f(); ! private static Vector3f ac = new Vector3f(); ! private static Vector3f cp = new Vector3f(); ! ! private Point3f a; ! private Point3f b; ! private Point3f c; ! ! private Color3f color; ! ! private Color3f opacity; ! ! private MutableBounds2f bounds; ! ! public Micropolygon(Point3f pa, Point3f pb, Point3f pc, ! Color3f color, Color3f opacity) { a = pa; b = pb; c = pc; ! this.color = color; ! this.opacity = opacity; setBounds(); faceScreen(); } ! private void setBounds() { ! bounds = new MutableBounds2f(); ! bounds.addPoint(a.x, a.y); ! bounds.addPoint(b.x, b.y); ! bounds.addPoint(c.x, c.y); } ! private void faceScreen() { ab.sub(b, a); ! ac.sub(c, a); cp.cross(ab, ac); if (cp.z > 0) { Point3f tmp = b; b = c; ! c = tmp; } } - - public Bounds2f getBounds() { - return bounds; - } public Sample getSample(Point2f point) { - // v1.set(a.y - b.y, b.x - a.x); - // v2.set(point.x - a.x, point.y - a.y); if ((a.y - b.y) * (point.x - a.x) + (b.x - a.x) * (point.y - a.y) > 0f) return null; - // v1.set(b.y - c.y, c.x - b.x); - // v2.set(point.x - b.x, point.y - b.y); if ((b.y - c.y) * (point.x - b.x) + (c.x - b.x) * (point.y - b.y) > 0f) return null; - // v1.set(c.y - a.y, a.x - c.x); - // v2.set(point.x - c.x, point.y - c.y); if ((c.y - a.y) * (point.x - c.x) + (a.x - c.x) * (point.y - c.y) > 0f) return null; ! return new Sample(color, opacity, (a.z + b.z + c.z) / 3f); } ! } --- 25,144 ---- import javax.vecmath.Vector3f; ! import org.jrman.util.Constants; public class Micropolygon { ! // These static Vector3f are not thead safe!!! ! private static Vector3f ab = new Vector3f(); ! private static Vector3f ac = new Vector3f(); ! private static Vector3f cp = new Vector3f(); ! ! private Point3f a; ! private Point3f b; ! private Point3f c; ! ! private float colorRed; ! ! private float colorGreen; ! ! private float colorBlue; ! ! private float opacityRed; ! ! private float opacityGreen; ! ! private float opacityBlue; ! ! private float minX = Constants.INFINITY; ! ! private float maxX = -Constants.INFINITY; ! ! private float minY = Constants.INFINITY; ! ! private float maxY = -Constants.INFINITY; ! ! public Micropolygon( ! Point3f pa, ! Point3f pb, ! Point3f pc, ! float cRed, ! float cGreen, ! float cBlue, ! float oRed, ! float oGreen, ! float oBlue) { a = pa; b = pb; c = pc; ! colorRed = cRed; ! colorGreen = cGreen; ! colorBlue = cBlue; ! opacityRed = oRed; ! opacityGreen = oGreen; ! opacityBlue = oBlue; setBounds(); faceScreen(); } ! private void setBounds() { ! addPointToBounds(a.x, a.y); ! addPointToBounds(b.x, b.y); ! addPointToBounds(c.x, c.y); } ! ! private void addPointToBounds(float x, float y) { ! minX = Math.min(minX, x); ! maxX = Math.max(maxX, x); ! minY = Math.min(minY, y); ! maxY = Math.max(maxY, y); ! } ! private void faceScreen() { ab.sub(b, a); ! ac.sub(c, a); cp.cross(ab, ac); if (cp.z > 0) { Point3f tmp = b; b = c; ! c = tmp; } } public Sample getSample(Point2f point) { if ((a.y - b.y) * (point.x - a.x) + (b.x - a.x) * (point.y - a.y) > 0f) return null; if ((b.y - c.y) * (point.x - b.x) + (c.x - b.x) * (point.y - b.y) > 0f) return null; if ((c.y - a.y) * (point.x - c.x) + (a.x - c.x) * (point.y - c.y) > 0f) return null; ! return new Sample( ! colorRed, ! colorGreen, ! colorBlue, ! opacityRed, ! opacityGreen, ! opacityBlue, ! (a.z + b.z + c.z) / 3f); } ! ! public float getMaxX() { ! return maxX; ! } ! ! public float getMaxY() { ! return maxY; ! } ! ! public float getMinX() { ! return minX; ! } ! ! public float getMinY() { ! return minY; ! } ! } Index: Sample.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Sample.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sample.java 3 May 2003 18:02:48 -0000 1.1 --- Sample.java 6 May 2003 02:15:44 -0000 1.2 *************** *** 24,36 **** public class Sample { ! private Color3f color; ! private Color3f opacity; private float z; ! public Sample(Color3f color, Color3f opacity, float z) { ! this.color = color; ! this.opacity = opacity; this.z = z; } --- 24,49 ---- public class Sample { ! private float colorRed; ! private float colorGreen; ! ! private float colorBlue; ! ! private float opacityRed; ! ! private float opacityGreen; ! ! private float opacityBlue; private float z; ! public Sample(float cRed, float cGreen, float cBlue, ! float oRed, float oGreen, float oBlue, float z) { ! colorRed = cRed; ! colorGreen = cGreen; ! colorBlue = cBlue; ! opacityRed = oRed; ! opacityGreen = oGreen; ! opacityBlue = oBlue; this.z = z; } *************** *** 41,53 **** public boolean isOpaque() { ! return opacity.x == 1f && opacity.y == 1f && opacity.z == 1f; } ! public Color3f getColor() { ! return color; } ! public Color3f getOpacity() { ! return opacity; } --- 54,70 ---- public boolean isOpaque() { ! return opacityRed== 1f && opacityGreen == 1f && opacityBlue == 1f; } ! public void getColor(Color3f color) { ! color.x = colorRed; ! color.y = colorGreen; ! color.z = colorBlue; } ! public void getOpacity(Color3f opacity) { ! opacity.x = opacityRed; ! opacity.y = opacityGreen; ! opacity.z = opacityBlue; } |
From: <ma...@us...> - 2003-05-06 02:15:47
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv28769/src/org/jrman/parser Modified Files: Frame.java Log Message: Implemented some optimizations. Index: Frame.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Frame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Frame.java 4 May 2003 02:34:36 -0000 1.5 --- Frame.java 6 May 2003 02:15:44 -0000 1.6 *************** *** 27,30 **** --- 27,31 ---- import org.jrman.geom.Bounds2f; import org.jrman.geom.Transform; + import org.jrman.grid.Grid; import org.jrman.options.CameraProjection; import org.jrman.options.Display; *************** *** 130,134 **** colorSamples = 3; relativeDetail = 1f; ! gridSize = 256; bucketSizeX = 16; bucketSizeY = 16; --- 131,135 ---- colorSamples = 3; relativeDetail = 1f; ! setGridSize(256); bucketSizeX = 16; bucketSizeY = 16; *************** *** 466,469 **** --- 467,472 ---- public void setGridSize(int i) { gridSize = i; + int side = (int) (Math.ceil(Math.sqrt(i))) + 1; + Grid.setMaxSize(side * side); } |
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1:/tmp/cvs-serv28769/src/org/jrman/grid Modified Files: BooleanGrid.java Point3fGrid.java Tuple3fGrid.java Color3fGrid.java Grid.java FloatGrid.java Vector3fGrid.java Log Message: Implemented some optimizations. Index: BooleanGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/BooleanGrid.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BooleanGrid.java 2 May 2003 02:07:22 -0000 1.4 --- BooleanGrid.java 6 May 2003 02:15:11 -0000 1.5 *************** *** 27,31 **** public BooleanGrid() { ! data = new boolean[uSize * vSize]; } --- 27,31 ---- public BooleanGrid() { ! data = new boolean[maxSize]; } *************** *** 51,60 **** public void set(boolean b) { ! for (int i = 0; i < data.length; i++) data[i] = b; } public void set(boolean b, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = b; --- 51,60 ---- public void set(boolean b) { ! for (int i = 0; i < size; i++) data[i] = b; } public void set(boolean b, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = b; *************** *** 62,71 **** public void set(BooleanGrid b) { ! for (int i = 0; i < data.length; i++) data[i] = b.data[i]; } public void set(BooleanGrid b, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = b.data[i]; --- 62,71 ---- public void set(BooleanGrid b) { ! for (int i = 0; i < size; i++) data[i] = b.data[i]; } public void set(BooleanGrid b, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = b.data[i]; *************** *** 77,81 **** public boolean allTrue() { ! for (int i = 0; i < data.length; i++) if (!data[i]) return false; --- 77,81 ---- public boolean allTrue() { ! for (int i = 0; i < size; i++) if (!data[i]) return false; *************** *** 84,88 **** public boolean allTrue(BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) if (!data[i]) --- 84,88 ---- public boolean allTrue(BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) if (!data[i]) *************** *** 96,100 **** public boolean allFalse() { ! for (int i = 0; i < data.length; i++) if (data[i]) return false; --- 96,100 ---- public boolean allFalse() { ! for (int i = 0; i < size; i++) if (data[i]) return false; *************** *** 103,107 **** public boolean allFalse(BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) if (data[i]) --- 103,107 ---- public boolean allFalse(BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) if (data[i]) *************** *** 115,124 **** public void and(BooleanGrid b1, boolean b2) { ! for (int i = 0; i < data.length; i++) data[i] = (b1.data[i] & b2); } public void and(BooleanGrid b1, boolean b2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (b1.data[i] & b2); --- 115,124 ---- public void and(BooleanGrid b1, boolean b2) { ! for (int i = 0; i < size; i++) data[i] = (b1.data[i] & b2); } public void and(BooleanGrid b1, boolean b2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (b1.data[i] & b2); *************** *** 126,135 **** public void and(BooleanGrid b1, BooleanGrid b2) { ! for (int i = 0; i < data.length; i++) data[i] = (b1.data[i] & b2.data[i]); } public void and(BooleanGrid b1, BooleanGrid b2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (b1.data[i] & b2.data[i]); --- 126,135 ---- public void and(BooleanGrid b1, BooleanGrid b2) { ! for (int i = 0; i < size; i++) data[i] = (b1.data[i] & b2.data[i]); } public void and(BooleanGrid b1, BooleanGrid b2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (b1.data[i] & b2.data[i]); *************** *** 141,150 **** public void or(BooleanGrid b1, boolean b2) { ! for (int i = 0; i < data.length; i++) data[i] = (b1.data[i] | b2); } public void or(BooleanGrid b1, boolean b2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (b1.data[i] | b2); --- 141,150 ---- public void or(BooleanGrid b1, boolean b2) { ! for (int i = 0; i < size; i++) data[i] = (b1.data[i] | b2); } public void or(BooleanGrid b1, boolean b2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (b1.data[i] | b2); *************** *** 152,161 **** public void or(BooleanGrid b1, BooleanGrid b2) { ! for (int i = 0; i < data.length; i++) data[i] = (b1.data[i] | b2.data[i]); } public void or(BooleanGrid b1, BooleanGrid b2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (b1.data[i] | b2.data[i]); --- 152,161 ---- public void or(BooleanGrid b1, BooleanGrid b2) { ! for (int i = 0; i < size; i++) data[i] = (b1.data[i] | b2.data[i]); } public void or(BooleanGrid b1, BooleanGrid b2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (b1.data[i] | b2.data[i]); *************** *** 167,176 **** public void not(BooleanGrid b1) { ! for (int i = 0; i < data.length; i++) data[i] = !(b1.data[i]); } public void not(BooleanGrid b1, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = !(b1.data[i]); --- 167,176 ---- public void not(BooleanGrid b1) { ! for (int i = 0; i < size; i++) data[i] = !(b1.data[i]); } public void not(BooleanGrid b1, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = !(b1.data[i]); *************** *** 182,191 **** public void equal(FloatGrid f1, float f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] == f2); } public void equal(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] == f2); --- 182,191 ---- public void equal(FloatGrid f1, float f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] == f2); } public void equal(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] == f2); *************** *** 193,202 **** public void equal(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] == f2.data[i]); } public void equal(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] == f2.data[i]); --- 193,202 ---- public void equal(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] == f2.data[i]); } public void equal(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] == f2.data[i]); *************** *** 204,213 **** public void equal(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < data.length; i++) data[i] = t1.data[i].equals(t2); } public void equal(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = t1.data[i].equals(t2); --- 204,213 ---- public void equal(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < size; i++) data[i] = t1.data[i].equals(t2); } public void equal(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = t1.data[i].equals(t2); *************** *** 215,224 **** public void equal(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) data[i] = t1.data[i].equals(t2.data[i]); } public void equal(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = t1.data[i].equals(t2.data[i]); --- 215,224 ---- public void equal(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) data[i] = t1.data[i].equals(t2.data[i]); } public void equal(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = t1.data[i].equals(t2.data[i]); *************** *** 230,239 **** public void notEqual(FloatGrid f1, float f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] != f2); } public void notEqual(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] != f2); --- 230,239 ---- public void notEqual(FloatGrid f1, float f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] != f2); } public void notEqual(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] != f2); *************** *** 241,250 **** public void notEqual(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] != f2.data[i]); } public void notEqual(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] != f2.data[i]); --- 241,250 ---- public void notEqual(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] != f2.data[i]); } public void notEqual(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] != f2.data[i]); *************** *** 252,261 **** public void notEqual(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < data.length; i++) data[i] = !(t1.data[i].equals(t2)); } public void notEqual(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = !(t1.data[i].equals(t2)); --- 252,261 ---- public void notEqual(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < size; i++) data[i] = !(t1.data[i].equals(t2)); } public void notEqual(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = !(t1.data[i].equals(t2)); *************** *** 263,272 **** public void notEqual(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) data[i] = !(t1.data[i].equals(t2.data[i])); } public void notEqual(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = !(t1.data[i].equals(t2.data[i])); --- 263,272 ---- public void notEqual(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) data[i] = !(t1.data[i].equals(t2.data[i])); } public void notEqual(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = !(t1.data[i].equals(t2.data[i])); *************** *** 278,287 **** public void less(FloatGrid f1, float f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] < f2); } public void less(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] < f2); --- 278,287 ---- public void less(FloatGrid f1, float f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] < f2); } public void less(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] < f2); *************** *** 289,298 **** public void less(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] < f2.data[i]); } public void less(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] < f2.data[i]); --- 289,298 ---- public void less(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] < f2.data[i]); } public void less(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] < f2.data[i]); *************** *** 304,313 **** public void lessOrEqual(FloatGrid f1, float f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] <= f2); } public void lessOrEqual(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] <= f2); --- 304,313 ---- public void lessOrEqual(FloatGrid f1, float f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] <= f2); } public void lessOrEqual(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] <= f2); *************** *** 315,324 **** public void lessOrEqual(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] <= f2.data[i]); } public void lessOrEqual(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] <= f2.data[i]); --- 315,324 ---- public void lessOrEqual(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] <= f2.data[i]); } public void lessOrEqual(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] <= f2.data[i]); *************** *** 330,339 **** public void greater(FloatGrid f1, float f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] > f2); } public void greater(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] > f2); --- 330,339 ---- public void greater(FloatGrid f1, float f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] > f2); } public void greater(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] > f2); *************** *** 341,350 **** public void greater(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] > f2.data[i]); } public void greater(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] > f2.data[i]); --- 341,350 ---- public void greater(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] > f2.data[i]); } public void greater(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] > f2.data[i]); *************** *** 356,365 **** public void greaterOrEqual(FloatGrid f1, float f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] >= f2); } public void greaterOrEqual(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] >= f2); --- 356,365 ---- public void greaterOrEqual(FloatGrid f1, float f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] >= f2); } public void greaterOrEqual(FloatGrid f1, float f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] >= f2); *************** *** 367,376 **** public void greaterOrEqual(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < data.length; i++) data[i] = (f1.data[i] >= f2.data[i]); } public void greaterOrEqual(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = (f1.data[i] >= f2.data[i]); --- 367,376 ---- public void greaterOrEqual(FloatGrid f1, FloatGrid f2) { ! for (int i = 0; i < size; i++) data[i] = (f1.data[i] >= f2.data[i]); } public void greaterOrEqual(FloatGrid f1, FloatGrid f2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = (f1.data[i] >= f2.data[i]); Index: Point3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Point3fGrid.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Point3fGrid.java 21 Apr 2003 00:09:34 -0000 1.3 --- Point3fGrid.java 6 May 2003 02:15:12 -0000 1.4 *************** *** 27,31 **** public Point3fGrid() { ! data = new Point3f[uSize * vSize]; for (int i = 0; i < data.length; i++) data[i] = new Point3f(); --- 27,31 ---- public Point3fGrid() { ! data = new Point3f[maxSize]; for (int i = 0; i < data.length; i++) data[i] = new Point3f(); *************** *** 39,43 **** Point3f[] tdata = (Point3f[]) data; Point3f[] pdata = (Point3f[]) p.data; ! for (int i = 0; i < tdata.length; i++) transform.transformPoint(pdata[i], tdata[i]); } --- 39,43 ---- Point3f[] tdata = (Point3f[]) data; Point3f[] pdata = (Point3f[]) p.data; ! for (int i = 0; i < size; i++) transform.transformPoint(pdata[i], tdata[i]); } *************** *** 46,50 **** Point3f[] tdata = (Point3f[]) data; Point3f[] pdata = (Point3f[]) p.data; ! for (int i = 0; i < tdata.length; i++) if (cond.data[i]) transform.transformPoint(pdata[i], tdata[i]); --- 46,50 ---- Point3f[] tdata = (Point3f[]) data; Point3f[] pdata = (Point3f[]) p.data; ! for (int i = 0; i < size; i++) if (cond.data[i]) transform.transformPoint(pdata[i], tdata[i]); Index: Tuple3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Tuple3fGrid.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Tuple3fGrid.java 2 May 2003 02:07:22 -0000 1.5 --- Tuple3fGrid.java 6 May 2003 02:15:12 -0000 1.6 *************** *** 52,56 **** public void set(Tuple3f in) { ! for (int i = 0; i < data.length; i++) { data[i].set(in); } --- 52,56 ---- public void set(Tuple3f in) { ! for (int i = 0; i < size; i++) { data[i].set(in); } *************** *** 58,62 **** public void set(Tuple3f in, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].set(in); --- 58,62 ---- public void set(Tuple3f in, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].set(in); *************** *** 64,73 **** public void set(Tuple3fGrid t) { ! for (int i = 0; i < data.length; i++) data[i].set(t.data[i]); } public void set(Tuple3fGrid t, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].set(t.data[i]); --- 64,73 ---- public void set(Tuple3fGrid t) { ! for (int i = 0; i < size; i++) data[i].set(t.data[i]); } public void set(Tuple3fGrid t, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].set(t.data[i]); *************** *** 79,88 **** public void negate(Tuple3fGrid t) { ! for (int i = 0; i < data.length; i++) data[i].negate(t.data[i]); } public void negate(Tuple3fGrid t, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].negate(t.data[i]); --- 79,88 ---- public void negate(Tuple3fGrid t) { ! for (int i = 0; i < size; i++) data[i].negate(t.data[i]); } public void negate(Tuple3fGrid t, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].negate(t.data[i]); *************** *** 94,103 **** public void add(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < data.length; i++) data[i].add(t1.data[i], t2); } public void add(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].add(t1.data[i], t2); --- 94,103 ---- public void add(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < size; i++) data[i].add(t1.data[i], t2); } public void add(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].add(t1.data[i], t2); *************** *** 105,114 **** public void add(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) data[i].add(t1.data[i], t2.data[i]); } public void add(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].add(t1.data[i], t2.data[i]); --- 105,114 ---- public void add(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) data[i].add(t1.data[i], t2.data[i]); } public void add(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].add(t1.data[i], t2.data[i]); *************** *** 120,129 **** public void sub(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < data.length; i++) data[i].sub(t1.data[i], t2); } public void sub(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].sub(t1.data[i], t2); --- 120,129 ---- public void sub(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < size; i++) data[i].sub(t1.data[i], t2); } public void sub(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].sub(t1.data[i], t2); *************** *** 131,140 **** public void sub(Tuple3f t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) data[i].sub(t1, t2.data[i]); } public void sub(Tuple3f t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].sub(t1, t2.data[i]); --- 131,140 ---- public void sub(Tuple3f t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) data[i].sub(t1, t2.data[i]); } public void sub(Tuple3f t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].sub(t1, t2.data[i]); *************** *** 142,151 **** public void sub(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) data[i].sub(t1.data[i], t2.data[i]); } public void sub(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].sub(t1.data[i], t2.data[i]); --- 142,151 ---- public void sub(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) data[i].sub(t1.data[i], t2.data[i]); } public void sub(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].sub(t1.data[i], t2.data[i]); *************** *** 157,161 **** public void mul(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = t1.data[i].x * t2.x; data[i].y = t1.data[i].y * t2.y; --- 157,161 ---- public void mul(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < size; i++) { data[i].x = t1.data[i].x * t2.x; data[i].y = t1.data[i].y * t2.y; *************** *** 165,169 **** public void mul(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = t1.data[i].x * t2.x; --- 165,169 ---- public void mul(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = t1.data[i].x * t2.x; *************** *** 174,178 **** public void mul(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = t1.data[i].x * t2.data[i].x; data[i].y = t1.data[i].y * t2.data[i].y; --- 174,178 ---- public void mul(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) { data[i].x = t1.data[i].x * t2.data[i].x; data[i].y = t1.data[i].y * t2.data[i].y; *************** *** 182,186 **** public void mul(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = t1.data[i].x * t2.data[i].x; --- 182,186 ---- public void mul(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = t1.data[i].x * t2.data[i].x; *************** *** 195,199 **** public void div(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = t1.data[i].x / t2.x; data[i].y = t1.data[i].y / t2.y; --- 195,199 ---- public void div(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < size; i++) { data[i].x = t1.data[i].x / t2.x; data[i].y = t1.data[i].y / t2.y; *************** *** 203,207 **** public void div(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = t1.data[i].x / t2.x; --- 203,207 ---- public void div(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = t1.data[i].x / t2.x; *************** *** 212,216 **** public void div(Tuple3f t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = t1.x / t2.data[i].x; data[i].y = t1.y / t2.data[i].y; --- 212,216 ---- public void div(Tuple3f t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) { data[i].x = t1.x / t2.data[i].x; data[i].y = t1.y / t2.data[i].y; *************** *** 220,224 **** public void div(Tuple3f t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = t1.x / t2.data[i].x; --- 220,224 ---- public void div(Tuple3f t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = t1.x / t2.data[i].x; *************** *** 229,233 **** public void div(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = t1.data[i].x / t2.data[i].x; data[i].y = t1.data[i].y / t2.data[i].y; --- 229,233 ---- public void div(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) { data[i].x = t1.data[i].x / t2.data[i].x; data[i].y = t1.data[i].y / t2.data[i].y; *************** *** 237,241 **** public void div(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = t1.data[i].x / t2.data[i].x; --- 237,241 ---- public void div(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = t1.data[i].x / t2.data[i].x; *************** *** 250,254 **** public void min(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = Math.min(t1.data[i].x, t2.x); data[i].y = Math.min(t1.data[i].y, t2.y); --- 250,254 ---- public void min(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < size; i++) { data[i].x = Math.min(t1.data[i].x, t2.x); data[i].y = Math.min(t1.data[i].y, t2.y); *************** *** 258,262 **** public void min(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Math.min(t1.data[i].x, t2.x); --- 258,262 ---- public void min(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Math.min(t1.data[i].x, t2.x); *************** *** 267,271 **** public void min(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = Math.min(t1.data[i].x, t2.data[i].x); data[i].y = Math.min(t1.data[i].y, t2.data[i].y); --- 267,271 ---- public void min(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) { data[i].x = Math.min(t1.data[i].x, t2.data[i].x); data[i].y = Math.min(t1.data[i].y, t2.data[i].y); *************** *** 275,279 **** public void min(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Math.min(t1.data[i].x, t2.data[i].x); --- 275,279 ---- public void min(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Math.min(t1.data[i].x, t2.data[i].x); *************** *** 288,292 **** public void max(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = Math.max(t1.data[i].x, t2.x); data[i].y = Math.max(t1.data[i].y, t2.y); --- 288,292 ---- public void max(Tuple3fGrid t1, Tuple3f t2) { ! for (int i = 0; i < size; i++) { data[i].x = Math.max(t1.data[i].x, t2.x); data[i].y = Math.max(t1.data[i].y, t2.y); *************** *** 296,300 **** public void max(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Math.max(t1.data[i].x, t2.x); --- 296,300 ---- public void max(Tuple3fGrid t1, Tuple3f t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Math.max(t1.data[i].x, t2.x); *************** *** 305,309 **** public void max(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < data.length; i++) { data[i].x = Math.max(t1.data[i].x, t2.data[i].x); data[i].y = Math.max(t1.data[i].y, t2.data[i].y); --- 305,309 ---- public void max(Tuple3fGrid t1, Tuple3fGrid t2) { ! for (int i = 0; i < size; i++) { data[i].x = Math.max(t1.data[i].x, t2.data[i].x); data[i].y = Math.max(t1.data[i].y, t2.data[i].y); *************** *** 313,317 **** public void max(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Math.max(t1.data[i].x, t2.data[i].x); --- 313,317 ---- public void max(Tuple3fGrid t1, Tuple3fGrid t2, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Math.max(t1.data[i].x, t2.data[i].x); *************** *** 326,330 **** public void clamp(Tuple3fGrid t, Tuple3f min, Tuple3f max) { ! for (int i = 0; i < data.length; i++) { data[i].x = Calc.clamp(t.data[i].x, min.x, max.x); data[i].y = Calc.clamp(t.data[i].y, min.x, max.y); --- 326,330 ---- public void clamp(Tuple3fGrid t, Tuple3f min, Tuple3f max) { ! for (int i = 0; i < size; i++) { data[i].x = Calc.clamp(t.data[i].x, min.x, max.x); data[i].y = Calc.clamp(t.data[i].y, min.x, max.y); *************** *** 334,338 **** public void clamp(Tuple3fGrid t, Tuple3f min, Tuple3f max, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Calc.clamp(t.data[i].x, min.x, max.x); --- 334,338 ---- public void clamp(Tuple3fGrid t, Tuple3f min, Tuple3f max, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Calc.clamp(t.data[i].x, min.x, max.x); *************** *** 347,351 **** public void mix(Tuple3f t1, Tuple3f t2, FloatGrid alpha) { ! for (int i = 0; i < data.length; i++) { data[i].x = Calc.interpolate(t1.x, t2.x, alpha.data[i]); data[i].y = Calc.interpolate(t1.y, t2.y, alpha.data[i]); --- 347,351 ---- public void mix(Tuple3f t1, Tuple3f t2, FloatGrid alpha) { ! for (int i = 0; i < size; i++) { data[i].x = Calc.interpolate(t1.x, t2.x, alpha.data[i]); data[i].y = Calc.interpolate(t1.y, t2.y, alpha.data[i]); *************** *** 355,359 **** public void mix(Tuple3f t1, Tuple3f t2, FloatGrid alpha, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.x, t2.x, alpha.data[i]); --- 355,359 ---- public void mix(Tuple3f t1, Tuple3f t2, FloatGrid alpha, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.x, t2.x, alpha.data[i]); *************** *** 364,368 **** public void mix(Tuple3f t1, Tuple3fGrid t2, float alpha) { ! for (int i = 0; i < data.length; i++) { data[i].x = Calc.interpolate(t1.x, t2.data[i].x, alpha); data[i].y = Calc.interpolate(t1.y, t2.data[i].y, alpha); --- 364,368 ---- public void mix(Tuple3f t1, Tuple3fGrid t2, float alpha) { ! for (int i = 0; i < size; i++) { data[i].x = Calc.interpolate(t1.x, t2.data[i].x, alpha); data[i].y = Calc.interpolate(t1.y, t2.data[i].y, alpha); *************** *** 372,376 **** public void mix(Tuple3f t1, Tuple3fGrid t2, float alpha, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.x, t2.data[i].x, alpha); --- 372,376 ---- public void mix(Tuple3f t1, Tuple3fGrid t2, float alpha, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.x, t2.data[i].x, alpha); *************** *** 381,385 **** public void mix(Tuple3f t1, Tuple3fGrid t2, FloatGrid alpha) { ! for (int i = 0; i < data.length; i++) { data[i].x = Calc.interpolate(t1.x, t2.data[i].x, alpha.data[i]); data[i].y = Calc.interpolate(t1.y, t2.data[i].y, alpha.data[i]); --- 381,385 ---- public void mix(Tuple3f t1, Tuple3fGrid t2, FloatGrid alpha) { ! for (int i = 0; i < size; i++) { data[i].x = Calc.interpolate(t1.x, t2.data[i].x, alpha.data[i]); data[i].y = Calc.interpolate(t1.y, t2.data[i].y, alpha.data[i]); *************** *** 389,393 **** public void mix(Tuple3f t1, Tuple3fGrid t2, FloatGrid alpha, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.x, t2.data[i].x, alpha.data[i]); --- 389,393 ---- public void mix(Tuple3f t1, Tuple3fGrid t2, FloatGrid alpha, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.x, t2.data[i].x, alpha.data[i]); *************** *** 398,402 **** public void mix(Tuple3fGrid t1, Tuple3f t2, float alpha) { ! for (int i = 0; i < data.length; i++) { data[i].x = Calc.interpolate(t1.data[i].x, t2.x, alpha); data[i].y = Calc.interpolate(t1.data[i].y, t2.y, alpha); --- 398,402 ---- public void mix(Tuple3fGrid t1, Tuple3f t2, float alpha) { ! for (int i = 0; i < size; i++) { data[i].x = Calc.interpolate(t1.data[i].x, t2.x, alpha); data[i].y = Calc.interpolate(t1.data[i].y, t2.y, alpha); *************** *** 406,410 **** public void mix(Tuple3fGrid t1, Tuple3f t2, float alpha, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.data[i].x, t2.x, alpha); --- 406,410 ---- public void mix(Tuple3fGrid t1, Tuple3f t2, float alpha, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.data[i].x, t2.x, alpha); *************** *** 415,419 **** public void mix(Tuple3fGrid t1, Tuple3f t2, FloatGrid alpha) { ! for (int i = 0; i < data.length; i++) { data[i].x = Calc.interpolate(t1.data[i].x, t2.x, alpha.data[i]); data[i].y = Calc.interpolate(t1.data[i].y, t2.y, alpha.data[i]); --- 415,419 ---- public void mix(Tuple3fGrid t1, Tuple3f t2, FloatGrid alpha) { ! for (int i = 0; i < size; i++) { data[i].x = Calc.interpolate(t1.data[i].x, t2.x, alpha.data[i]); data[i].y = Calc.interpolate(t1.data[i].y, t2.y, alpha.data[i]); *************** *** 423,427 **** public void mix(Tuple3fGrid t1, Tuple3f t2, FloatGrid alpha, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.data[i].x, t2.x, alpha.data[i]); --- 423,427 ---- public void mix(Tuple3fGrid t1, Tuple3f t2, FloatGrid alpha, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.data[i].x, t2.x, alpha.data[i]); *************** *** 432,436 **** public void mix(Tuple3fGrid t1, Tuple3fGrid t2, float alpha) { ! for (int i = 0; i < data.length; i++) { data[i].x = Calc.interpolate(t1.data[i].x, t2.data[i].x, alpha); data[i].y = Calc.interpolate(t1.data[i].y, t2.data[i].y, alpha); --- 432,436 ---- public void mix(Tuple3fGrid t1, Tuple3fGrid t2, float alpha) { ! for (int i = 0; i < size; i++) { data[i].x = Calc.interpolate(t1.data[i].x, t2.data[i].x, alpha); data[i].y = Calc.interpolate(t1.data[i].y, t2.data[i].y, alpha); *************** *** 440,444 **** public void mix(Tuple3fGrid t1, Tuple3fGrid t2, float alpha, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.data[i].x, t2.data[i].x, alpha); --- 440,444 ---- public void mix(Tuple3fGrid t1, Tuple3fGrid t2, float alpha, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.data[i].x, t2.data[i].x, alpha); *************** *** 449,453 **** public void mix(Tuple3fGrid t1, Tuple3fGrid t2, FloatGrid alpha) { ! for (int i = 0; i < data.length; i++) { data[i].x = Calc.interpolate(t1.data[i].x, t2.data[i].x, alpha.data[i]); data[i].y = Calc.interpolate(t1.data[i].y, t2.data[i].y, alpha.data[i]); --- 449,453 ---- public void mix(Tuple3fGrid t1, Tuple3fGrid t2, FloatGrid alpha) { ! for (int i = 0; i < size; i++) { data[i].x = Calc.interpolate(t1.data[i].x, t2.data[i].x, alpha.data[i]); data[i].y = Calc.interpolate(t1.data[i].y, t2.data[i].y, alpha.data[i]); *************** *** 457,461 **** public void mix(Tuple3fGrid t1, Tuple3fGrid t2, FloatGrid alpha, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.data[i].x, t2.data[i].x, alpha.data[i]); --- 457,461 ---- public void mix(Tuple3fGrid t1, Tuple3fGrid t2, FloatGrid alpha, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) { data[i].x = Calc.interpolate(t1.data[i].x, t2.data[i].x, alpha.data[i]); *************** *** 470,474 **** public void Du(Tuple3fGrid t, FloatGrid du) { ! for (int i = 0; i < data.length; i += uSize) { for (int j = 0; j < uSize - 1; j++) { data[i + j].sub(t.data[i + j + 1], t.data[i + j]); --- 470,474 ---- public void Du(Tuple3fGrid t, FloatGrid du) { ! for (int i = 0; i < size; i += uSize) { for (int j = 0; j < uSize - 1; j++) { data[i + j].sub(t.data[i + j + 1], t.data[i + j]); *************** *** 481,485 **** public void Du(Tuple3fGrid t, FloatGrid du, BooleanGrid cond) { ! for (int i = 0; i < data.length; i += uSize) { for (int j = 0; j < uSize; j++) if (cond.data[i + j]) { --- 481,485 ---- public void Du(Tuple3fGrid t, FloatGrid du, BooleanGrid cond) { ! for (int i = 0; i < size; i += uSize) { for (int j = 0; j < uSize; j++) if (cond.data[i + j]) { *************** *** 499,508 **** public void Dv(Tuple3fGrid t, FloatGrid dv) { ! for (int i = 0; i < data.length - uSize; i += uSize) for (int j = 0; j < uSize; j++) { data[i + j].sub(t.data[i + j + uSize], t.data[i + j]); data[i + j].scale(1f / dv.data[i + j]); } ! for (int i = data.length - uSize; i < data.length; i++) { data[i].sub(t.data[i], t.data[i - uSize]); data[i].scale(1f / dv.data[i]); --- 499,508 ---- public void Dv(Tuple3fGrid t, FloatGrid dv) { ! for (int i = 0; i < size - uSize; i += uSize) for (int j = 0; j < uSize; j++) { data[i + j].sub(t.data[i + j + uSize], t.data[i + j]); data[i + j].scale(1f / dv.data[i + j]); } ! for (int i = size - uSize; i < size; i++) { data[i].sub(t.data[i], t.data[i - uSize]); data[i].scale(1f / dv.data[i]); *************** *** 511,515 **** public void Dv(Tuple3fGrid t, FloatGrid dv, BooleanGrid cond) { ! for (int i = 0; i < data.length - uSize; i += uSize) for (int j = 0; j < uSize; j++) if (cond.data[i + j]) { --- 511,515 ---- public void Dv(Tuple3fGrid t, FloatGrid dv, BooleanGrid cond) { ! for (int i = 0; i < size - uSize; i += uSize) for (int j = 0; j < uSize; j++) if (cond.data[i + j]) { *************** *** 517,521 **** data[i + j].scale(1f / dv.data[i + j]); } ! for (int i = data.length - uSize; i < data.length; i++) if (cond.data[i]) { data[i].sub(t.data[i], t.data[i - uSize]); --- 517,521 ---- data[i + j].scale(1f / dv.data[i + j]); } ! for (int i = size - uSize; i < size; i++) if (cond.data[i]) { data[i].sub(t.data[i], t.data[i - uSize]); *************** *** 529,538 **** public void random() { ! for (int i = 0; i < data.length; i++) data[i].set((float) Math.random(), (float) Math.random(), (float) Math.random()); } public void random(BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].set( --- 529,538 ---- public void random() { ! for (int i = 0; i < size; i++) data[i].set((float) Math.random(), (float) Math.random(), (float) Math.random()); } public void random(BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].set( *************** *** 565,574 **** public void setxcomp(float x) { ! for (int i = 0; i < data.length; i++) data[i].x = x; } public void setxcomp(float x, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].x = x; --- 565,574 ---- public void setxcomp(float x) { ! for (int i = 0; i < size; i++) data[i].x = x; } public void setxcomp(float x, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].x = x; *************** *** 576,585 **** public void setxcomp(FloatGrid x) { ! for (int i = 0; i < data.length; i++) data[i].x = x.data[i]; } public void setxcomp(FloatGrid x, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].x = x.data[i]; --- 576,585 ---- public void setxcomp(FloatGrid x) { ! for (int i = 0; i < size; i++) data[i].x = x.data[i]; } public void setxcomp(FloatGrid x, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].x = x.data[i]; *************** *** 591,600 **** public void setycomp(float y) { ! for (int i = 0; i < data.length; i++) data[i].y = y; } public void setycomp(float y, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].y = y; --- 591,600 ---- public void setycomp(float y) { ! for (int i = 0; i < size; i++) data[i].y = y; } public void setycomp(float y, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].y = y; *************** *** 602,611 **** public void setycomp(FloatGrid y) { ! for (int i = 0; i < data.length; i++) data[i].y = y.data[i]; } public void setycomp(FloatGrid y, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].y = y.data[i]; --- 602,611 ---- public void setycomp(FloatGrid y) { ! for (int i = 0; i < size; i++) data[i].y = y.data[i]; } public void setycomp(FloatGrid y, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].y = y.data[i]; *************** *** 617,626 **** public void setzcomp(float z) { ! for (int i = 0; i < data.length; i++) data[i].z = z; } public void setzcomp(float z, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].z = z; --- 617,626 ---- public void setzcomp(float z) { ! for (int i = 0; i < size; i++) data[i].z = z; } public void setzcomp(float z, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].z = z; *************** *** 628,637 **** public void setzcomp(FloatGrid z) { ! for (int i = 0; i < data.length; i++) data[i].z = z.data[i]; } public void setzcomp(FloatGrid z, BooleanGrid cond) { ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i].z = z.data[i]; --- 628,637 ---- public void setzcomp(FloatGrid z) { ! for (int i = 0; i < size; i++) data[i].z = z.data[i]; } public void setzcomp(FloatGrid z, BooleanGrid cond) { ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i].z = z.data[i]; Index: Color3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Color3fGrid.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Color3fGrid.java 21 Apr 2003 00:09:34 -0000 1.2 --- Color3fGrid.java 6 May 2003 02:15:13 -0000 1.3 *************** *** 25,29 **** public Color3fGrid() { ! data = new Color3f[uSize * vSize]; for (int i = 0; i < data.length; i++) data[i] = new Color3f(); --- 25,29 ---- public Color3fGrid() { ! data = new Color3f[maxSize]; for (int i = 0; i < data.length; i++) data[i] = new Color3f(); Index: Grid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Grid.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Grid.java 2 May 2003 02:07:22 -0000 1.2 --- Grid.java 6 May 2003 02:15:13 -0000 1.3 *************** *** 21,41 **** public class Grid { ! protected static int uSize; ! protected static int vSize; ! public static void setSize(int newUSize, int newVSize) { uSize = newUSize; vSize = newVSize; } ! protected Grid() { } ! public static int getUSize() { return uSize; } ! public static int getVSize() { return vSize; --- 21,52 ---- public class Grid { ! ! protected static int maxSize; ! ! protected static int size; ! protected static int uSize; ! protected static int vSize; ! ! public static void setMaxSize(int newMaxSize) { ! maxSize = newMaxSize; ! } ! public static void setSize(int newUSize, int newVSize) { + if (newUSize * newVSize > maxSize) + throw new IllegalArgumentException("too big"); uSize = newUSize; vSize = newVSize; + size = uSize * vSize; } ! protected Grid() { } ! public static int getUSize() { return uSize; } ! public static int getVSize() { return vSize; Index: FloatGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/FloatGrid.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FloatGrid.java 3 May 2003 18:02:49 -0000 1.6 --- FloatGrid.java 6 May 2003 02:15:13 -0000 1.7 *************** *** 31,35 **** public FloatGrid() { ! data = new float[uSize * vSize]; } --- 31,35 ---- public FloatGrid() { ! data = new float[maxSize]; } [...1823 lines suppressed...] } --- 1170,1174 ---- Point3f[] pdata = (Point3f[]) p.data; Point3f tmp = new Point3f(); ! for (int i = 0; i < size; i++) data[i] = Calc.depth(pdata[i], toCamera, near, far, tmp); } *************** *** 1182,1186 **** Point3f[] pdata = (Point3f[]) p.data; Point3f tmp = new Point3f(); ! for (int i = 0; i < data.length; i++) if (cond.data[i]) data[i] = Calc.depth(pdata[i], toCamera, near, far, tmp); --- 1182,1186 ---- Point3f[] pdata = (Point3f[]) p.data; Point3f tmp = new Point3f(); ! for (int i = 0; i < size; i++) if (cond.data[i]) data[i] = Calc.depth(pdata[i], toCamera, near, far, tmp); Index: Vector3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Vector3fGrid.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Vector3fGrid.java 4 May 2003 02:34:36 -0000 1.4 --- Vector3fGrid.java 6 May 2003 02:15:13 -0000 1.5 *************** *** 27,31 **** public Vector3fGrid() { ! data = new Vector3f[uSize * vSize]; for (int i = 0; i < data.length; i++) data[i] = new Vector3f(); --- 27,31 ---- public Vector3fGrid() { ! data = new Vector3f[maxSize]; for (int i = 0; i < data.length; i++) data[i] = new Vector3f(); *************** *** 39,43 **** Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < tdata.length; i++) tdata[i].normalize(vdata[i]); } --- 39,43 ---- Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < size; i++) tdata[i].normalize(vdata[i]); } *************** *** 46,50 **** Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < tdata.length; i++) if (cond.data[i]) tdata[i].normalize(vdata[i]); --- 46,50 ---- Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < size; i++) if (cond.data[i]) tdata[i].normalize(vdata[i]); *************** *** 58,62 **** Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < tdata.length; i++) transform.transformVector(vdata[i], tdata[i]); } --- 58,62 ---- Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < size; i++) transform.transformVector(vdata[i], tdata[i]); } *************** *** 65,69 **** Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < tdata.length; i++) if (cond.data[i]) transform.transformVector(vdata[i], tdata[i]); --- 65,69 ---- Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < size; i++) if (cond.data[i]) transform.transformVector(vdata[i], tdata[i]); *************** *** 77,81 **** Vector3f[] tdata = (Vector3f[]) data; Vector3f[] ndata = (Vector3f[]) n.data; ! for (int i = 0; i < tdata.length; i++) transform.transformNormal(ndata[i], tdata[i]); } --- 77,81 ---- Vector3f[] tdata = (Vector3f[]) data; Vector3f[] ndata = (Vector3f[]) n.data; ! for (int i = 0; i < size; i++) transform.transformNormal(ndata[i], tdata[i]); } *************** *** 84,88 **** Vector3f[] tdata = (Vector3f[]) data; Vector3f[] ndata = (Vector3f[]) n.data; ! for (int i = 0; i < tdata.length; i++) if (cond.data[i]) transform.transformNormal(ndata[i], tdata[i]); --- 84,88 ---- Vector3f[] tdata = (Vector3f[]) data; Vector3f[] ndata = (Vector3f[]) n.data; ! for (int i = 0; i < size; i++) if (cond.data[i]) transform.transformNormal(ndata[i], tdata[i]); *************** *** 96,100 **** Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < tdata.length; i++) { float d = vdata[i].dot(light); if (d < 0) --- 96,100 ---- Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; ! for (int i = 0; i < size; i++) { float d = vdata[i].dot(light); if (d < 0) *************** *** 109,113 **** Vector3f[] vdata = (Vector3f[]) v.data; Vector3f[] ldata = (Vector3f[]) light.data; ! for (int i = 0; i < tdata.length; i++) {... [truncated message content] |
From: <ma...@us...> - 2003-05-06 02:15:47
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv28769/src/org/jrman/primitive Modified Files: Quadric.java Log Message: Implemented some optimizations. Index: Quadric.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Quadric.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Quadric.java 5 May 2003 08:29:08 -0000 1.7 --- Quadric.java 6 May 2003 02:15:45 -0000 1.8 *************** *** 427,430 **** --- 427,434 ---- float height = max.y - min.y; boolean ready = width * height <= gridSize * attributes.getShadingRate(); + float idealSize = (width * height) / attributes.getShadingRate(); + idealSize = Calc.clamp(idealSize, 36f, gridSize); + int side = (int) (Math.ceil(Math.sqrt(idealSize))) + 1; + Grid.setSize(side, side); return ready; } |
From: <ma...@us...> - 2003-05-06 02:15:47
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv28769/sampleData Modified Files: ManySpheres.rib Added Files: AllSpheres.rib Log Message: Implemented some optimizations. Index: ManySpheres.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/ManySpheres.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ManySpheres.rib 5 May 2003 09:48:43 -0000 1.4 --- ManySpheres.rib 6 May 2003 02:15:44 -0000 1.5 *************** *** 3,6 **** --- 3,7 ---- Exposure 1 2.5 Clipping 1 1000 + #Option "limits" "bucketsize" [32 32] Projection "perspective" "fov" 50 Surface "fakedlight" |
From: <ma...@us...> - 2003-05-05 09:48:47
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv9154/sampleData Added Files: ManySpheres.rib Log Message: Re-added a file... |
From: <ma...@us...> - 2003-05-05 09:33:21
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv2172/sampleData Removed Files: AllSpheres.rib ManySpheres.rib Log Message: Added Torus + sample files. (and removed very large file...) --- AllSpheres.rib DELETED --- --- ManySpheres.rib DELETED --- |
From: <ma...@us...> - 2003-05-05 08:29:16
|
Update of /cvsroot/jrman/drafts/eclipse-config In directory sc8-pr-cvs1:/tmp/cvs-serv1849/eclipse-config Modified Files: preferences.epf Log Message: Added Torus + sample files. Index: preferences.epf =================================================================== RCS file: /cvsroot/jrman/drafts/eclipse-config/preferences.epf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** preferences.epf 18 Apr 2003 04:51:35 -0000 1.1 --- preferences.epf 5 May 2003 08:29:07 -0000 1.2 *************** *** 1,3 **** ! #Thu Apr 17 21:12:44 CDT 2003 org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.ORG_ECLIPSE_PDE_SOURCE_SRC=C\:/eclipse/plugins/org.eclipse.pde.source_2.1.0/src org.eclipse.pde.core=2.1.0 --- 1,3 ---- ! #Mon May 05 03:12:22 CDT 2003 org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.ORG_ECLIPSE_PDE_SOURCE_SRC=C\:/eclipse/plugins/org.eclipse.pde.source_2.1.0/src org.eclipse.pde.core=2.1.0 *************** *** 15,19 **** org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.ui.editors=2.1.0 ! org.eclipse.jdt.ui/org.eclipse.jface.textfont=1|Sans|12|0|GTK|1|; org.eclipse.jdt.launching/org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0" encoding\="UTF-8"?>\n<vmSettings\n defaultVM\="57,org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType1,0" defaultVMConnector\="">\n <vmType id\="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType">\n <vm id\="0" javadocURL\="http\://java.sun.com/j2se/1.4.1/docs/api"\n name\="j2sdk1.4.1_01" path\="/extra/j2sdk1.4.1_01"/>\n </vmType>\n</vmSettings>\n org.eclipse.jdt.core/org.eclipse.jdt.core.classpathContainer.Demo|org.eclipse.jdt.launching.JRE_CONTAINER=<?xml version\="1.0" encoding\="UTF-8"?>\n<classpath><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/rt.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/sunrsasign.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/jsse.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/jce.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/charsets.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/dnsns.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3daudio.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3dcore.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3dutils.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/ldapsec.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/localedata.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/sunjce_provider.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/vecmath.jar" rootpath\="" sourcepath\=""/></classpath> --- 15,19 ---- org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.ui.editors=2.1.0 ! org.eclipse.jdt.ui/org.eclipse.jface.textfont=1|Sans|11|0|GTK|1|; org.eclipse.jdt.launching/org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0" encoding\="UTF-8"?>\n<vmSettings\n defaultVM\="57,org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType1,0" defaultVMConnector\="">\n <vmType id\="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType">\n <vm id\="0" javadocURL\="http\://java.sun.com/j2se/1.4.1/docs/api"\n name\="j2sdk1.4.1_01" path\="/extra/j2sdk1.4.1_01"/>\n </vmType>\n</vmSettings>\n org.eclipse.jdt.core/org.eclipse.jdt.core.classpathContainer.Demo|org.eclipse.jdt.launching.JRE_CONTAINER=<?xml version\="1.0" encoding\="UTF-8"?>\n<classpath><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/rt.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/sunrsasign.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/jsse.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/jce.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/charsets.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/dnsns.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3daudio.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3dcore.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3dutils.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/ldapsec.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/localedata.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/sunjce_provider.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/vecmath.jar" rootpath\="" sourcepath\=""/></classpath> *************** *** 47,51 **** org.eclipse.jdt.ui/org.eclipse.jdt.ui.javadoc=false org.eclipse.jdt.ui/content_assist_proposals_background=255,255,255 ! org.eclipse.debug.ui/org.eclipse.debug.ui.lastLaunchConfigSelection=<?xml version\="1.0" encoding\="UTF-8"?>\n<launchConfiguration local\="true" path\="jrman illum2.rib.launch"/>\n org.eclipse.jdt.core/org.eclipse.jdt.core.classpathContainer.drafts|org.eclipse.jdt.launching.JRE_CONTAINER=<?xml version\="1.0" encoding\="UTF-8"?>\n<classpath><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/rt.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/sunrsasign.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/jsse.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/jce.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/charsets.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/sunjce_provider.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/dnsns.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/localedata.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/ldapsec.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/vecmath.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/j3dcore.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/j3daudio.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/j3dutils.jar" rootpath\="" sourcepath\=""/></classpath> org.eclipse.jdt.ui/org.eclipse.jdt.ui.importorder=java;javax;org;com; --- 47,51 ---- org.eclipse.jdt.ui/org.eclipse.jdt.ui.javadoc=false org.eclipse.jdt.ui/content_assist_proposals_background=255,255,255 ! org.eclipse.debug.ui/org.eclipse.debug.ui.lastLaunchConfigSelection=<?xml version\="1.0" encoding\="UTF-8"?>\n<launchConfiguration local\="true" path\="jrMan ManySpheres.rib.launch"/>\n org.eclipse.jdt.core/org.eclipse.jdt.core.classpathContainer.drafts|org.eclipse.jdt.launching.JRE_CONTAINER=<?xml version\="1.0" encoding\="UTF-8"?>\n<classpath><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/rt.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/sunrsasign.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/jsse.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/jce.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/charsets.jar" rootpath\="" sourcepath\="/extra/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/sunjce_provider.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/dnsns.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/localedata.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/ldapsec.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/vecmath.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/j3dcore.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/j3daudio.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="/extra/j2sdk1.4.1_01/jre/lib/ext/j3dutils.jar" rootpath\="" sourcepath\=""/></classpath> org.eclipse.jdt.ui/org.eclipse.jdt.ui.importorder=java;javax;org;com; *************** *** 55,59 **** org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.ORG_ECLIPSE_JDT_SOURCE_SRC=C\:/eclipse/plugins/org.eclipse.jdt.source_2.1.0/src org.eclipse.jdt.core/org.eclipse.jdt.core.classpathContainer.Parser|org.eclipse.jdt.launching.JRE_CONTAINER=<?xml version\="1.0" encoding\="UTF-8"?>\n<classpath><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/rt.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/sunrsasign.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/jsse.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/jce.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/charsets.jar" rootpath\="" sourcepath\="C\:/j2sdk1.4.1_01/src.zip"/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/dnsns.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3daudio.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3dcore.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/j3dutils.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/ldapsec.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/localedata.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/sunjce_provider.jar" rootpath\="" sourcepath\=""/><classpathentry kind\="lib" path\="C\:/j2sdk1.4.1_01/jre/lib/ext/vecmath.jar" rootpath\="" sourcepath\=""/></classpath> - org.eclipse.ui.workbench/org.eclipse.jdt.ui.editors.textfont=1|Sans|12|0|GTK|1|; org.eclipse.jdt.ui/Refactoring.savealleditors=true org.eclipse.jdt.ui/fontPropagated=true --- 55,58 ---- *************** *** 61,67 **** org.eclipse.ui.editors/printMarginColumn=95 org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.ECLIPSE_HOME=/extra/mago/progs/eclipse - org.eclipse.debug.ui/org.eclipse.debug.ui.VariableView+org.eclipse.debug.ui.ShowDetailPaneAction=false org.eclipse.ui.editors/printMargin=true ! org.eclipse.team.cvs.ui/pref_compression_level=3 org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JRE_LIB=C\:/j2sdk1.4.1_01/jre/lib/rt.jar --- 60,65 ---- org.eclipse.ui.editors/printMarginColumn=95 org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.ECLIPSE_HOME=/extra/mago/progs/eclipse org.eclipse.ui.editors/printMargin=true ! org.eclipse.team.cvs.ui/pref_compression_level=6 org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JRE_LIB=C\:/j2sdk1.4.1_01/jre/lib/rt.jar |
From: <ma...@us...> - 2003-05-05 08:29:16
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv1849/src/org/jrman/primitive Modified Files: Quadric.java Sphere.java Added Files: Torus.java Log Message: Added Torus + sample files. --- NEW FILE: Torus.java --- /* Torus.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.primitive; import java.util.Map; import javax.vecmath.Point3f; import javax.vecmath.Vector3f; import org.jrman.attributes.Attributes; import org.jrman.geom.BoundingVolume; import org.jrman.geom.Bounds3f; import org.jrman.grid.Grid; import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; import org.jrman.render.ShaderVariables; public class Torus extends Quadric { private float majorRadius; private float minorRadius; private float phiMin; private float phiMax; private float thetaMin; private float thetaMax; public Torus( float majorRadius, float minorRadius, float phiMin, float phiMax, float thetaMin, float thetaMax, Map parameters, Attributes attributes) { super(parameters, attributes); this.majorRadius = majorRadius; this.minorRadius = minorRadius; this.phiMin = phiMin; this.phiMax = phiMax; this.thetaMin = thetaMin; this.thetaMax = thetaMax; } protected BoundingVolume internalGetBoundingVolume() { float zMin; float zMax; float sinPhiMinR = (float) Math.sin(phiMin) * minorRadius; float sinPhiMaxR = (float) Math.sin(phiMax) * minorRadius; if (phiMin < Math.PI / 2 && phiMax > Math.PI / 2) zMax = minorRadius; else zMax = Math.max(sinPhiMinR, sinPhiMaxR); if (phiMin < Math.PI * 3 / 2 && phiMax > Math.PI * 3 / 2) zMin = -minorRadius; else zMin = Math.min(sinPhiMinR, sinPhiMaxR); float cosPhiMinR = (float) Math.cos(phiMin) * minorRadius; float cosPhiMaxR = (float) Math.cos(phiMax) * minorRadius; float rMin = majorRadius + Math.min(cosPhiMinR, cosPhiMaxR); float rMax = majorRadius + Math.max(cosPhiMinR, cosPhiMaxR); float cosThetaMin = (float) Math.cos(thetaMin); float sinThetaMin = (float) Math.sin(thetaMin); float cosThetaMax = (float) Math.cos(thetaMax); float sinThetaMax = (float) Math.sin(thetaMax); float xMin; float xMax = cosThetaMin * rMin; xMax = Math.max(xMax, cosThetaMin * rMax); xMax = Math.max(xMax, cosThetaMax * rMin); xMax = Math.max(xMax, cosThetaMax * rMax); float yMin; float yMax; if (thetaMin < Math.PI && thetaMax > Math.PI) xMin = -rMax; else { xMin = cosThetaMin * rMin; xMin = Math.min(xMin, cosThetaMin * rMax); xMin = Math.min(xMin, cosThetaMax * rMin); xMin = Math.min(xMin, cosThetaMax * rMax); } if (thetaMin < Math.PI / 2 && thetaMax > Math.PI / 2) yMax = rMax; else { yMax = sinThetaMin * rMin; yMax = Math.max(yMax, sinThetaMin * rMax); yMax = Math.max(yMax, sinThetaMax * rMin); yMax = Math.max(yMax, sinThetaMax * rMax); } if (thetaMin < Math.PI * 3 / 2 && thetaMax > Math.PI * 3 / 2) yMin = -rMax; else { yMin = sinThetaMin * rMin; yMin = Math.min(yMin, sinThetaMin * rMax); yMin = Math.min(yMin, sinThetaMax * rMin); yMin = Math.min(yMin, sinThetaMax * rMax); } Bounds3f result = new Bounds3f(xMin, xMax, yMin, yMax, zMin, zMax); return result; } public Primitive[] split() { Primitive[] result = new Primitive[2]; if (thetaMax - thetaMin > phiMax - phiMin) { result[0] = new Torus( majorRadius, minorRadius, phiMin, phiMax, thetaMin, (thetaMin + thetaMax) / 2f, interpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = new Torus( majorRadius, minorRadius, phiMin, phiMax, (thetaMin + thetaMax) / 2f, thetaMax, interpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { result[0] = new Torus( majorRadius, minorRadius, phiMin, (phiMin + phiMax) / 2f, thetaMin, thetaMax, interpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = new Torus( majorRadius, minorRadius, (phiMin + phiMax) / 2f, phiMax, thetaMin, thetaMax, interpolateParameters(0f, 1f, .5f, 1f), attributes); } return result; } protected void dice_P(ShaderVariables shaderVariables) { int uSize = Grid.getUSize(); int vSize = Grid.getVSize(); float thetaDelta = (thetaMax - thetaMin) / ( uSize - 1); float phiDelta = (phiMax - phiMin) / (vSize - 1); Point3fGrid P = shaderVariables.P; Point3f tmp = new Point3f(); float theta = thetaMin; for (int u = 0; u < uSize; u++) { float cosTheta = (float) Math.cos(theta); float sinTheta = (float) Math.sin(theta); float phi = phiMin; for (int v = 0; v < vSize; v++) { float r = minorRadius * (float) Math.cos(phi); tmp.z = minorRadius * (float) Math.sin(phi); tmp.x = (majorRadius + r) * cosTheta; tmp.y = (majorRadius + r) * sinTheta; P.set(u, v, tmp); phi += phiDelta; } theta += thetaDelta; } } protected void dice_Ng(ShaderVariables shaderVariables) { int uSize = Grid.getUSize(); int vSize = Grid.getVSize(); float thetaDelta = (thetaMax - thetaMin) / ( uSize - 1); Vector3fGrid Ng = shaderVariables.Ng; Vector3f tmp = new Vector3f(); float theta = thetaMin; for (int u = 0; u < uSize; u++) { float cosTheta = (float) Math.cos(theta); float sinTheta = (float) Math.sin(theta); tmp.z = 0f; tmp.x = majorRadius * cosTheta; tmp.y = majorRadius * sinTheta; for (int v = 0; v < vSize; v++) Ng.set(u, v, tmp); theta += thetaDelta; } Ng.sub(shaderVariables.P, Ng); } } Index: Quadric.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Quadric.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Quadric.java 3 May 2003 18:02:48 -0000 1.6 --- Quadric.java 5 May 2003 08:29:08 -0000 1.7 *************** *** 26,29 **** --- 26,30 ---- import javax.vecmath.Color3f; import javax.vecmath.Matrix4f; + import javax.vecmath.Point2f; import javax.vecmath.Point3f; import javax.vecmath.Point4f; *************** *** 418,421 **** --- 419,431 ---- } return result; + } + + public boolean isReadyToBeDiced(int gridSize) { + Point2f min = rasterBounds.getMin(); + Point2f max = rasterBounds.getMax(); + float width = max.x - min.x; + float height = max.y - min.y; + boolean ready = width * height <= gridSize * attributes.getShadingRate(); + return ready; } Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Sphere.java 4 May 2003 22:33:39 -0000 1.14 --- Sphere.java 5 May 2003 08:29:08 -0000 1.15 *************** *** 22,26 **** import java.util.Map; - import javax.vecmath.Point2f; import javax.vecmath.Point3f; --- 22,25 ---- *************** *** 164,185 **** } - public boolean isReadyToBeDiced(int gridSize) { - Point2f min = rasterBounds.getMin(); - Point2f max = rasterBounds.getMax(); - float width = max.x - min.x; - float height = max.y - min.y; - boolean ready = width * height <= gridSize * attributes.getShadingRate(); - return ready; - } - protected void dice_P(ShaderVariables shaderVariables) { int uSize = Grid.getUSize(); int vSize = Grid.getVSize(); float thetaDelta = (thetaMax - thetaMin) / (uSize - 1); - if (thetaDelta <= 0) - System.out.println("thetaDelta: " + thetaDelta); float phiDelta = (phiMax - phiMin) / (vSize - 1); - if (phiDelta <= 0) - System.out.println("phiDelta: " + phiDelta); Point3fGrid P = shaderVariables.P; Point3f tmp = new Point3f(); --- 163,171 ---- *************** *** 197,204 **** P.set(u, v, tmp); phi += phiDelta; - phi = Math.min(phi, phiMax); } theta += thetaDelta; - theta = Math.min(theta, thetaMax); } } --- 183,188 ---- |
From: <ma...@us...> - 2003-05-05 08:29:16
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv1849/src/org/jrman/parser/keywords Modified Files: KeywordTorus.java Log Message: Added Torus + sample files. Index: KeywordTorus.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordTorus.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordTorus.java 7 Apr 2003 08:24:30 -0000 1.2 --- KeywordTorus.java 5 May 2003 08:29:08 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- package org.jrman.parser.keywords; + import java.util.Map; + import org.jrman.parser.Tokenizer; *************** *** 35,56 **** // Expect major radius match(st, TK_NUMBER); ! // Expect minor radius match(st, TK_NUMBER); ! // Expect phi min match(st, TK_NUMBER); ! // Expect phi max match(st, TK_NUMBER); ! // Expect theta max match(st, TK_NUMBER); ! if (array) match(st, TK_RBRACE); - // Expect parameter list ! parseParameterList(st); } --- 37,58 ---- // Expect major radius match(st, TK_NUMBER); ! float majorRadius = (float) st.nval; // Expect minor radius match(st, TK_NUMBER); ! float minorRadius = (float) st.nval; // Expect phi min match(st, TK_NUMBER); ! float phiMin = (float) st.nval; // Expect phi max match(st, TK_NUMBER); ! float phiMax = (float) st.nval; // Expect theta max match(st, TK_NUMBER); ! float thetaMax = (float) st.nval; if (array) match(st, TK_RBRACE); // Expect parameter list ! Map parameters = parseParameterList(st); ! parser.addTorus(majorRadius, minorRadius, phiMin, phiMax, thetaMax, parameters); } |
From: <ma...@us...> - 2003-05-05 08:29:16
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv1849/src/org/jrman/parser Modified Files: Parser.java Log Message: Added Torus + sample files. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Parser.java 3 May 2003 18:02:49 -0000 1.33 --- Parser.java 5 May 2003 08:29:08 -0000 1.34 *************** *** 57,60 **** --- 57,61 ---- import org.jrman.parser.keywords.KeywordParser; import org.jrman.primitive.Sphere; + import org.jrman.primitive.Torus; import org.jrman.render.Renderer; import org.jrman.shaders.Imager; *************** *** 477,481 **** saveCurrentTransformAs("screen"); // from "camera" to "screen" setIdentity(); ! Global.setTransform("raster", frame.getRasterTransform()); // from "screen" to "raster" Global.setTransform("NDC", frame.getNDCTransform()); // from "raster" to "NDC" } --- 478,483 ---- saveCurrentTransformAs("screen"); // from "camera" to "screen" setIdentity(); ! Global.setTransform("raster", frame.getRasterTransform()); ! // from "screen" to "raster" Global.setTransform("NDC", frame.getNDCTransform()); // from "raster" to "NDC" } *************** *** 640,643 **** --- 642,649 ---- } + public void setShadingRate(float size) { + currentAttributes.setShadingRate(size); + } + public void addSphere( float radius, *************** *** 663,668 **** } ! public void setShadingRate(float size) { ! currentAttributes.setShadingRate(size); } --- 669,694 ---- } ! public void addTorus( ! float majorRadius, ! float minorRadius, ! float phiMin, ! float phiMax, ! float thetaMax, ! Map parameters) { ! if (inAreaLightSource) ! return; ! phiMin = (float) Math.toRadians(phiMin); ! phiMax = (float) Math.toRadians(phiMax); ! thetaMax = (float) Math.toRadians(thetaMax); ! renderer.addPrimitive( ! new Torus( ! majorRadius, ! minorRadius, ! phiMin, ! phiMax, ! 0f, ! thetaMax, ! parameters, ! getAttributes())); } |
From: <ma...@us...> - 2003-05-05 02:17:43
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv29013/sampleData Modified Files: sphere.rib rings.rib Added Files: AllSpheres.rib ManySpheres.rib Log Message: Tests with a large number of spheres. --- NEW FILE: AllSpheres.rib --- TransformBegin Color 0.014256401726789547 0.734352466785813 0.3988869344684113 Translate -50.0 0 -50.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin Color 0.351488824782097 0.793420191922605 0.16855703658040844 Translate -49.0 0 -50.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin Color 0.7576486218682563 0.47938448206041084 0.9828157989927997 Translate -48.0 0 -50.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin Color 0.48254613881001474 0.7157287218879977 0.47661393678068587 Translate -47.0 0 -50.0 Sphere .5 -5 .5 360 [...49961 lines suppressed...] TransformBegin Color 0.21844213204201324 0.9038422141556064 0.26658441293876767 Translate 46.0 0 49.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin Color 0.4079227490709001 0.5293828189708939 0.9875860214556278 Translate 47.0 0 49.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin Color 0.620995026837245 0.5852427078101332 0.44714947835619534 Translate 48.0 0 49.0 Sphere .5 -5 .5 360 TransformEnd TransformBegin Color 0.07570307390205 0.5640347619927459 0.57945008962296 Translate 49.0 0 49.0 Sphere .5 -5 .5 360 TransformEnd --- NEW FILE: ManySpheres.rib --- Format 1200 900 1 PixelSamples 4 4 Exposure 1 2.5 Clipping 1 1000 Projection "perspective" "fov" 50 Surface "fakedlight" Translate 0 0 60 Rotate 20 0 0 1 Rotate -50 1 0 0 WorldBegin ReadArchive "AllSpheres.rib" WorldEnd Index: sphere.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/sphere.rib,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sphere.rib 4 May 2003 22:33:39 -0000 1.5 --- sphere.rib 5 May 2003 02:17:39 -0000 1.6 *************** *** 1,3 **** ! Format 640 480 1 PixelSamples 4 4 Exposure 1 2.5 --- 1,3 ---- ! Format 800 600 1 PixelSamples 4 4 Exposure 1 2.5 Index: rings.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/rings.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rings.rib 4 May 2003 22:33:39 -0000 1.1 --- rings.rib 5 May 2003 02:17:39 -0000 1.2 *************** *** 1,3 **** ! Format 1200 900 1 PixelSamples 4 4 Exposure 1 2.5 --- 1,3 ---- ! Format 800 600 1 PixelSamples 4 4 Exposure 1 2.5 |
From: <ma...@us...> - 2003-05-05 02:17:43
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv29013/src/org/jrman/render Modified Files: SamplePoint.java Log Message: Tests with a large number of spheres. Index: SamplePoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/SamplePoint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SamplePoint.java 4 May 2003 22:33:39 -0000 1.2 --- SamplePoint.java 5 May 2003 02:17:39 -0000 1.3 *************** *** 20,24 **** package org.jrman.render; ! import java.util.LinkedList; import java.util.List; import java.util.ListIterator; --- 20,24 ---- package org.jrman.render; ! import java.util.ArrayList; import java.util.List; import java.util.ListIterator; *************** *** 31,35 **** private Point2f point = new Point2f();; ! private List samples = new LinkedList(); public void init(float x, float y) { --- 31,35 ---- private Point2f point = new Point2f();; ! private List samples = new ArrayList(); public void init(float x, float y) { |
From: <ma...@us...> - 2003-05-05 02:17:43
|
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs1:/tmp/cvs-serv29013/src Added Files: GenSpheres.java Log Message: Tests with a large number of spheres. --- NEW FILE: GenSpheres.java --- /* GenSpheres.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. */ public class GenSpheres { public static void main(String[] args) { int n = Integer.parseInt(args[0]); int m = Integer.parseInt(args[1]); float z = -n / 2; for (int i = 0; i < n; i++) { float x = -m / 2; for (int j = 0; j < m; j++) { System.out.println("TransformBegin"); System.out.println("Color " + Math.random() + " " + Math.random() + " " + Math.random()); System.out.println("Translate " + x + " 0 " + z); System.out.println("Sphere .5 -5 .5 360"); System.out.println("TransformEnd"); x += 1; } z += 1; } } } |
From: <ma...@us...> - 2003-05-04 22:33:44
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv32000/src/org/jrman/render Modified Files: SamplePoint.java RendererHidden.java Micropolygon.java Sampler.java Log Message: Did some optimizations. Fixed Sphere to only split in 2 (along the largest dimension). Added new sample file. Index: SamplePoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/SamplePoint.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SamplePoint.java 3 May 2003 18:02:48 -0000 1.1 --- SamplePoint.java 4 May 2003 22:33:39 -0000 1.2 *************** *** 29,38 **** public class SamplePoint { ! private Point2f point; private List samples = new LinkedList(); ! public SamplePoint(float x, float y) { ! point = new Point2f(x, y); } --- 29,39 ---- public class SamplePoint { ! private Point2f point = new Point2f();; private List samples = new LinkedList(); ! public void init(float x, float y) { ! point.set(x, y); ! samples.clear(); } Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RendererHidden.java 4 May 2003 02:34:36 -0000 1.9 --- RendererHidden.java 4 May 2003 22:33:39 -0000 1.10 *************** *** 71,75 **** private int bucketHeight; ! public void init(Frame frame, World world) { super.init(frame, world); --- 71,75 ---- private int bucketHeight; ! public void init(Frame frame, World world) { super.init(frame, world); *************** *** 119,122 **** --- 119,124 ---- private void placeInBucket(Primitive primitive, BoundingVolume bv) { Bounds2f bounds = bv.transform(cameraToRaster).toBounds2f(); + if (!bounds.intersects(rasterWindow)) + return; primitive.setRasterBounds(bounds); Point2f min = bounds.getMin(); *************** *** 164,167 **** --- 166,175 ---- ShaderVariables shaderVariables = new ShaderVariables(); int gridCount = 0; + Sampler sampler = + new Sampler( + bucketWidth, + bucketHeight, + frame.getHorizontalSamplingRate(), + frame.getVerticalSamplingRate()); long start = System.currentTimeMillis(); for (int row = 0; row < bucketRows; row++) *************** *** 192,203 **** float samplerX = rmin.x + bucketWidth * column; float samplerY = rmin.y + bucketHeight * row; ! Sampler sampler = ! new Sampler( ! samplerX, ! samplerY, ! bucketWidth, ! bucketHeight, ! frame.getHorizontalSamplingRate(), ! frame.getVerticalSamplingRate()); sampler.sampleBucket(bucket); bucket.flush(); --- 200,204 ---- float samplerX = rmin.x + bucketWidth * column; float samplerY = rmin.y + bucketHeight * row; ! sampler.init(samplerX, samplerY); sampler.sampleBucket(bucket); bucket.flush(); *************** *** 212,216 **** bucketHeight); } ! for (int i = 0; i < buckets.length; i++){ if (buckets[i].hasMorePrimitives()) System.out.println("More primitives: " + i); --- 213,217 ---- bucketHeight); } ! for (int i = 0; i < buckets.length; i++) { if (buckets[i].hasMorePrimitives()) System.out.println("More primitives: " + i); Index: Micropolygon.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Micropolygon.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Micropolygon.java 3 May 2003 18:02:48 -0000 1.2 --- Micropolygon.java 4 May 2003 22:33:39 -0000 1.3 *************** *** 23,36 **** import javax.vecmath.Point2f; import javax.vecmath.Point3f; - import javax.vecmath.Vector2f; import javax.vecmath.Vector3f; import org.jrman.geom.Bounds2f; import org.jrman.geom.MutableBounds2f; - import org.jrman.util.Calc; public class Micropolygon { ! private Point3f a; private Point3f b; --- 23,41 ---- import javax.vecmath.Point2f; import javax.vecmath.Point3f; import javax.vecmath.Vector3f; import org.jrman.geom.Bounds2f; import org.jrman.geom.MutableBounds2f; public class Micropolygon { + + // These static Vector3f are not thead safe!!! + private static Vector3f ab= new Vector3f(); ! private static Vector3f ac = new Vector3f(); ! ! private static Vector3f cp = new Vector3f(); ! ! private Point3f a; private Point3f b; *************** *** 63,71 **** private void faceScreen() { - Vector3f ab = new Vector3f(); ab.sub(b, a); - Vector3f ac = new Vector3f(); ac.sub(c, a); - Vector3f cp = new Vector3f(); cp.cross(ab, ac); if (cp.z > 0) { --- 68,73 ---- *************** *** 81,98 **** public Sample getSample(Point2f point) { ! Vector2f v1 = new Vector2f(b.x - a.x , b.y - a.y); ! Calc.perp(v1, v1); ! Vector2f v2 = new Vector2f(point.x - a.x, point.y - a.y); ! if (v1.dot(v2) > 0f) return null; ! v1.set(c.x - b.x, c.y - b.y); ! Calc.perp(v1, v1); ! v2.set(point.x - b.x, point.y - b.y); ! if (v1.dot(v2) > 0f) return null; ! v1.set(a.x - c.x, a.y - c.y); ! Calc.perp(v1, v1); ! v2.set(point.x - c.x, point.y - c.y); ! if (v1.dot(v2) > 0f) return null; return new Sample(color, opacity, (a.z + b.z + c.z) / 3f); --- 83,97 ---- public Sample getSample(Point2f point) { ! // v1.set(a.y - b.y, b.x - a.x); ! // v2.set(point.x - a.x, point.y - a.y); ! if ((a.y - b.y) * (point.x - a.x) + (b.x - a.x) * (point.y - a.y) > 0f) return null; ! // v1.set(b.y - c.y, c.x - b.x); ! // v2.set(point.x - b.x, point.y - b.y); ! if ((b.y - c.y) * (point.x - b.x) + (c.x - b.x) * (point.y - b.y) > 0f) return null; ! // v1.set(c.y - a.y, a.x - c.x); ! // v2.set(point.x - c.x, point.y - c.y); ! if ((c.y - a.y) * (point.x - c.x) + (a.x - c.x) * (point.y - c.y) > 0f) return null; return new Sample(color, opacity, (a.z + b.z + c.z) / 3f); Index: Sampler.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/Sampler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sampler.java 3 May 2003 18:02:48 -0000 1.1 --- Sampler.java 4 May 2003 22:33:39 -0000 1.2 *************** *** 27,67 **** public class Sampler { ! ! Point2f min; ! private int width; ! private int height; ! private float sampleWidth; ! private float sampleHeight; ! private SamplePoint[] samplePoints; ! public Sampler( ! float samplerX, ! float samplerY, ! int bucketWidth, ! int bucketHeight, ! float hSamples, ! float vSamples) { ! min = new Point2f(samplerX, samplerY); ! width = (int) Math.ceil(bucketWidth * hSamples); ! height = (int) Math.ceil(bucketHeight * vSamples); ! sampleWidth = 1f / hSamples; ! sampleHeight = 1f / hSamples; ! samplePoints = new SamplePoint[width * height]; ! float y = min.y + sampleHeight * .5f; ! for (int row = 0; row < height; row++) { ! float x = min.x + sampleWidth * .5f; ! for (int column = 0; column < width; column++) { ! samplePoints[row * width + column] = new SamplePoint(x, y); ! x += sampleWidth; ! } ! y += sampleHeight; } } ! public void sampleBucket(Bucket bucket) { while (bucket.hasMoreMicropolygons()) { --- 27,66 ---- public class Sampler { ! ! Point2f min = new Point2f(); ! private int width; ! private int height; ! private float sampleWidth; ! private float sampleHeight; ! private SamplePoint[] samplePoints; ! public Sampler(int bucketWidth, int bucketHeight, float hSamples, float vSamples) { ! width = (int) Math.ceil(bucketWidth * hSamples); ! height = (int) Math.ceil(bucketHeight * vSamples); ! sampleWidth = 1f / hSamples; ! sampleHeight = 1f / hSamples; ! samplePoints = new SamplePoint[width * height]; ! for (int i = 0; i < samplePoints.length; i++) ! samplePoints[i] = new SamplePoint(); ! } ! ! public void init(float minX, float minY) { ! min.set(minX, minY); ! float y = min.y + sampleHeight * .5f; ! for (int row = 0; row < height; row++) { ! float x = min.x + sampleWidth * .5f; ! for (int column = 0; column < width; column++) { ! samplePoints[row * width + column].init(x, y); ! x += sampleWidth; } + y += sampleHeight; + } } ! public void sampleBucket(Bucket bucket) { while (bucket.hasMoreMicropolygons()) { *************** *** 70,81 **** } } ! public Color3f[] getColors() { Color3f[] result = new Color3f[samplePoints.length]; ! for (int i = 0; i < samplePoints.length; i++) ! result[i] = samplePoints[i].getColor(); return result; } ! private void sampleMicropolygon(Micropolygon mp) { Bounds2f b = mp.getBounds(); --- 69,80 ---- } } ! public Color3f[] getColors() { Color3f[] result = new Color3f[samplePoints.length]; ! for (int i = 0; i < samplePoints.length; i++) ! result[i] = samplePoints[i].getColor(); return result; } ! private void sampleMicropolygon(Micropolygon mp) { Bounds2f b = mp.getBounds(); *************** *** 87,96 **** int minRow = Calc.clamp((int) (mpMin.y / sampleHeight), 0, height - 1); int maxColumn = Calc.clamp((int) (mpMax.x / sampleWidth), 0, width - 1); ! int maxRow = Calc.clamp((int) (mpMax.y / sampleHeight), 0, height - 1); for (int col = minColumn; col <= maxColumn; col++) for (int row = minRow; row <= maxRow; row++) getSamplePoint(col, row).sampleMicropolygon(mp); } ! private SamplePoint getSamplePoint(int column, int row) { return samplePoints[row * width + column]; --- 86,95 ---- int minRow = Calc.clamp((int) (mpMin.y / sampleHeight), 0, height - 1); int maxColumn = Calc.clamp((int) (mpMax.x / sampleWidth), 0, width - 1); ! int maxRow = Calc.clamp((int) (mpMax.y / sampleHeight), 0, height - 1); for (int col = minColumn; col <= maxColumn; col++) for (int row = minRow; row <= maxRow; row++) getSamplePoint(col, row).sampleMicropolygon(mp); } ! private SamplePoint getSamplePoint(int column, int row) { return samplePoints[row * width + column]; |
From: <ma...@us...> - 2003-05-04 22:33:43
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv32000/src/org/jrman/primitive Modified Files: Sphere.java Log Message: Did some optimizations. Fixed Sphere to only split in 2 (along the largest dimension). Added new sample file. Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Sphere.java 3 May 2003 18:02:48 -0000 1.13 --- Sphere.java 4 May 2003 22:33:39 -0000 1.14 *************** *** 121,161 **** public Primitive[] split() { ! Primitive[] result = new Primitive[4]; ! result[0] = ! new Sphere( ! radius, ! phiMin, ! (phiMin + phiMax) / 2f, ! thetaMin, ! (thetaMin + thetaMax) / 2f, ! interpolateParameters(0f, .5f, 0f, .5f), ! attributes); ! result[1] = ! new Sphere( ! radius, ! (phiMin + phiMax) / 2f, ! phiMax, ! thetaMin, ! (thetaMin + thetaMax) / 2f, ! interpolateParameters(0f, .5f, .5f, 1f), ! attributes); ! result[2] = ! new Sphere( ! radius, ! phiMin, ! (phiMin + phiMax) / 2f, ! (thetaMin + thetaMax) / 2f, ! thetaMax, ! interpolateParameters(.5f, 1f, 0f, .5f), ! attributes); ! result[3] = ! new Sphere( ! radius, ! (phiMin + phiMax) / 2f, ! phiMax, ! (thetaMin + thetaMax) / 2f, ! thetaMax, ! interpolateParameters(.5f, 1f, .5f, 1f), ! attributes); return result; } --- 121,164 ---- public Primitive[] split() { ! Primitive[] result = new Primitive[2]; ! if (thetaMax - thetaMin > phiMax - phiMin) { ! result[0] = ! new Sphere( ! radius, ! phiMin, ! phiMax, ! thetaMin, ! (thetaMin + thetaMax) / 2f, ! interpolateParameters(0f, .5f, 0f, 1f), ! attributes); ! result[1] = ! new Sphere( ! radius, ! phiMin, ! phiMax, ! (thetaMin + thetaMax) / 2f, ! thetaMax, ! interpolateParameters(.5f, 1f, 0f, 1f), ! attributes); ! } else { ! result[0] = ! new Sphere( ! radius, ! phiMin, ! (phiMin + phiMax) / 2f, ! thetaMin, ! thetaMax, ! interpolateParameters(0f, 1f, 0f, .5f), ! attributes); ! result[1] = ! new Sphere( ! radius, ! (phiMin + phiMax) / 2f, ! phiMax, ! thetaMin, ! thetaMax, ! interpolateParameters(0f, 1f, .5f, 1f), ! attributes); ! } return result; } |
From: <ma...@us...> - 2003-05-04 22:33:43
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv32000/sampleData Modified Files: sphere.rib Added Files: rings.rib Log Message: Did some optimizations. Fixed Sphere to only split in 2 (along the largest dimension). Added new sample file. --- NEW FILE: rings.rib --- Format 1200 900 1 PixelSamples 4 4 Exposure 1 2.5 Clipping 1 1000 Projection "perspective" "fov" 10 Surface "fakedlight" Translate 0 0 30 WorldBegin ShadingRate 1 TransformBegin Color 0 0 .6 Rotate 90 1 0 0 Sphere 100 -100 100 180 TransformEnd Color 1 1 0 TransformBegin Translate 1 0 2 Rotate 30 0 1 0 Sphere 2 -.6 .6 360 TransformEnd TransformBegin Translate -1 0 2.5 Rotate 60 1 0 0 Sphere 2 -.6 .6 360 TransformEnd WorldEnd Index: sphere.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/sphere.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sphere.rib 4 May 2003 02:34:37 -0000 1.4 --- sphere.rib 4 May 2003 22:33:39 -0000 1.5 *************** *** 1,3 **** ! Format 1200 900 1 PixelSamples 4 4 Exposure 1 2.5 --- 1,3 ---- ! Format 640 480 1 PixelSamples 4 4 Exposure 1 2.5 |
From: <ma...@us...> - 2003-05-04 02:34:40
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1:/tmp/cvs-serv32242/src/org/jrman/shaders Modified Files: FakedLightShader.java Log Message: Fixed FOV bug. Changed sphere.rib to get objects away from projection plane. Index: FakedLightShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/FakedLightShader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FakedLightShader.java 3 May 2003 18:02:49 -0000 1.1 --- FakedLightShader.java 4 May 2003 02:34:36 -0000 1.2 *************** *** 34,37 **** --- 34,39 ---- private FloatGrid light; + private Vector3f lightDirection = new Vector3f(1f, 1f, -1f); + public FakedLightShader(String name, Map parameters) { super(name, parameters); *************** *** 45,49 **** tmpN.faceforward(sv.N, sv.I); tmpN.normalize(tmpN); ! light.dot(tmpN, new Vector3f(1f, 1f, -1f)); light.max(light, 0f); light.mul(light, .7f); --- 47,51 ---- tmpN.faceforward(sv.N, sv.I); tmpN.normalize(tmpN); ! light.dot(tmpN, lightDirection); light.max(light, 0f); light.mul(light, .7f); |
From: <ma...@us...> - 2003-05-04 02:34:40
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv32242/sampleData Modified Files: sphere.rib Log Message: Fixed FOV bug. Changed sphere.rib to get objects away from projection plane. Index: sphere.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/sphere.rib,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sphere.rib 3 May 2003 18:02:49 -0000 1.3 --- sphere.rib 4 May 2003 02:34:37 -0000 1.4 *************** *** 2,11 **** PixelSamples 4 4 Exposure 1 2.5 ! Clipping 1 15 ! Projection "perspective" "fov" 45 #ScreenWindow -8 8 -6 6 #Projection "orthographic" Surface "fakedlight" ! Translate 0 0 10 WorldBegin ShadingRate 1 --- 2,12 ---- PixelSamples 4 4 Exposure 1 2.5 ! Clipping 1 1000 ! ScreenWindow -.8 .8 -.6 .6 ! Projection "perspective" "fov" 20 #ScreenWindow -8 8 -6 6 #Projection "orthographic" Surface "fakedlight" ! Translate 0 0 40 WorldBegin ShadingRate 1 |
From: <ma...@us...> - 2003-05-04 02:34:40
|
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1:/tmp/cvs-serv32242/src/org/jrman/grid Modified Files: Vector3fGrid.java Log Message: Fixed FOV bug. Changed sphere.rib to get objects away from projection plane. Index: Vector3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Vector3fGrid.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Vector3fGrid.java 3 May 2003 18:02:49 -0000 1.3 --- Vector3fGrid.java 4 May 2003 02:34:36 -0000 1.4 *************** *** 50,54 **** tdata[i].normalize(vdata[i]); } ! /* * vtransform --- 50,54 ---- tdata[i].normalize(vdata[i]); } ! /* * vtransform *************** *** 88,102 **** transform.transformNormal(ndata[i], tdata[i]); } ! /* * faceforward */ ! ! public void faceforward(Vector3fGrid v, Vector3fGrid eye) { Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; - Vector3f[] edata = (Vector3f[]) eye.data; for (int i = 0; i < tdata.length; i++) { ! float d = vdata[i].dot(edata[i]); if (d < 0) tdata[i].set(v.data[i]); --- 88,114 ---- transform.transformNormal(ndata[i], tdata[i]); } ! /* * faceforward */ ! ! public void faceforward(Vector3fGrid v, Vector3f light) { Vector3f[] tdata = (Vector3f[]) data; Vector3f[] vdata = (Vector3f[]) v.data; for (int i = 0; i < tdata.length; i++) { ! float d = vdata[i].dot(light); ! if (d < 0) ! tdata[i].set(v.data[i]); ! else ! tdata[i].negate(v.data[i]); ! } ! } ! ! public void faceforward(Vector3fGrid v, Vector3fGrid light) { ! Vector3f[] tdata = (Vector3f[]) data; ! Vector3f[] vdata = (Vector3f[]) v.data; ! Vector3f[] ldata = (Vector3f[]) light.data; ! for (int i = 0; i < tdata.length; i++) { ! float d = vdata[i].dot(ldata[i]); if (d < 0) tdata[i].set(v.data[i]); |
From: <ma...@us...> - 2003-05-04 02:34:40
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv32242/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Fixed FOV bug. Changed sphere.rib to get objects away from projection plane. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RendererHidden.java 3 May 2003 18:02:48 -0000 1.8 --- RendererHidden.java 4 May 2003 02:34:36 -0000 1.9 *************** *** 27,31 **** import javax.swing.JFrame; - import javax.swing.JScrollPane; import javax.vecmath.Color3f; import javax.vecmath.Point2f; --- 27,30 ---- |