You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(116) |
May
(220) |
Jun
(52) |
Jul
(30) |
Aug
(35) |
Sep
(24) |
Oct
(49) |
Nov
(44) |
Dec
(70) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(21) |
Feb
(30) |
Mar
(9) |
Apr
(44) |
May
(2) |
Jun
|
Jul
(10) |
Aug
(20) |
Sep
(25) |
Oct
(12) |
Nov
(16) |
Dec
(4) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(10) |
2006 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(33) |
2007 |
Jan
(4) |
Feb
(57) |
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ma...@us...> - 2003-05-26 05:18:02
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv18496/sampleData Modified Files: elephant.rib Added Files: 4INS-Balls.rib Log Message: Added scene with Insulin Molecule. --- NEW FILE: 4INS-Balls.rib --- ##RenderMan RIB-Structure 1.0 version 3.03 Display "4INS-Balls" "framebuffer" "rgb" Format 1000 750 1 #FrameAspectRatio 1.054393 #ScreenWindow -1.581590 1.581590 -1.500000 1.500000 Option "limits" "bucketsize" [32 32] "gridsize" 1024 Projection "perspective" "fov" 16 Declare "shadows" "string" Attribute "light" "shadows" "on" LightSource "ambientlight" 0 "intensity" [.2] "lightcolor" [1 1 1] #LightSource "pointlight" 1 "intensity" [9] "lightcolor" [1.000000 1.000000 1.000000] "from" [-0.100000 0.100000 1.000000] #LightSource "pointlight" 2 "intensity" [9] "lightcolor" [1.000000 1.000000 1.000000] "from" [1.000000 2.000000 0.500000] LightSource "distantlight" 5 "from" [1 1 -1] "to" [0 0 0] Translate 0.000000 0.000000 -2.000000 # Background colors slow down rendering, # but this is what most people expect by # default. Comment these lines for a transparent # background. [...5190 lines suppressed...] Translate 0.710915 -0.310004 0.802874 Sphere 0.036655 -0.036655 0.036655 360 TransformEnd TransformBegin Translate 0.313210 0.288484 0.808513 Sphere 0.036655 -0.036655 0.036655 360 TransformEnd TransformBegin Translate 0.093450 -0.250116 0.808513 Sphere 0.036655 -0.036655 0.036655 360 TransformEnd TransformBegin Translate 0.683903 -0.219326 0.826248 Sphere 0.036655 -0.036655 0.036655 360 TransformEnd TransformBegin Translate 0.179786 0.312677 -0.128102 Sphere 0.036655 -0.036655 0.036655 360 TransformEnd WorldEnd Index: elephant.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/elephant.rib,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** elephant.rib 26 May 2003 01:47:59 -0000 1.3 --- elephant.rib 26 May 2003 05:17:58 -0000 1.4 *************** *** 1,3 **** ! Format 2000 1500 1 PixelSamples 4 4 Exposure 1 2.2 --- 1,3 ---- ! Format 512 384 1 PixelSamples 4 4 Exposure 1 2.2 *************** *** 32,35 **** --- 32,36 ---- Rotate -90 1 0 0 Scale .2 .2 .2 + #Attribute "displacementbound" "sphere" 0.01 ReadArchive "gumbo.rib" AttributeEnd |
From: <ma...@us...> - 2003-05-26 01:48:06
|
Update of /cvsroot/jrman/drafts/src/org/jrman/geom In directory sc8-pr-cvs1:/tmp/cvs-serv3271/src/org/jrman/geom Modified Files: AffineTransform.java PerspectiveTransform.java Transform.java Log Message: Improved "specular" Made z linear in projection perspective (and solved depth resolution problems). Added title and scrollpane to display. Fixed I (vector from camera) in orthographic projection. Fixed (?) bounding box enlargement by displacement bound. Index: AffineTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/AffineTransform.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AffineTransform.java 15 Apr 2003 13:07:56 -0000 1.9 --- AffineTransform.java 26 May 2003 01:48:00 -0000 1.10 *************** *** 288,291 **** --- 288,295 ---- return sb.toString(); } + + public boolean isPerspective() { + return false; + } } Index: PerspectiveTransform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/PerspectiveTransform.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PerspectiveTransform.java 8 May 2003 05:00:33 -0000 1.7 --- PerspectiveTransform.java 26 May 2003 01:48:00 -0000 1.8 *************** *** 29,32 **** --- 29,36 ---- private Point4f hpoint = new Point4f(); + + private float near; + + private float far; public static PerspectiveTransform createWithFov(float fov, float near, float far) { *************** *** 38,43 **** } ! private PerspectiveTransform(Matrix4f matrix) { super(matrix); } --- 42,49 ---- } ! private PerspectiveTransform(Matrix4f matrix, float near, float far) { super(matrix); + this.near = near; + this.far = far; } *************** *** 47,56 **** fl, 0f, 0f, 0f, 0f, fl, 0f, 0f, ! 0f, 0f, far / (far - near), (far * near) / (near - far), 0f, 0f, 1f, 0f)); } public Transform getCopy() { ! return new PerspectiveTransform(getMatrix()); } --- 53,65 ---- fl, 0f, 0f, 0f, 0f, fl, 0f, 0f, ! // 0f, 0f, far / (far - near), (far * near) / (near - far), ! 0f, 0f, 1f, 1f, 0f, 0f, 1f, 0f)); + this.near = near; + this.far = far; } public Transform getCopy() { ! return new PerspectiveTransform(getMatrix(), near, far); } *************** *** 58,62 **** Matrix4f matrix = getMatrix(); matrix.mul(m); ! return new PerspectiveTransform(matrix); } --- 67,71 ---- Matrix4f matrix = getMatrix(); matrix.mul(m); ! return new PerspectiveTransform(matrix, near, far); } *************** *** 64,72 **** Matrix4f matrix = getMatrix(); matrix.mul(transform.getMatrix()); ! return new PerspectiveTransform(matrix); } public Transform preConcat(Transform transform) { ! Transform perspective = new PerspectiveTransform(transform.getMatrix()); return perspective.concat(this); } --- 73,81 ---- Matrix4f matrix = getMatrix(); matrix.mul(transform.getMatrix()); ! return new PerspectiveTransform(matrix, near, far); } public Transform preConcat(Transform transform) { ! Transform perspective = new PerspectiveTransform(transform.getMatrix(), near, far); return perspective.concat(this); } *************** *** 76,79 **** --- 85,89 ---- transformHPoint(hpoint); point.project(hpoint); + point.z = (hpoint. w - near) / (far - near); } *************** *** 82,85 **** --- 92,96 ---- transformHPoint(hpoint); out.project(hpoint); + out.z = (hpoint.w - near) / (far -near); } *************** *** 88,91 **** --- 99,106 ---- sb.append("AffineTransform:\n").append(getMatrix()); return sb.toString(); + } + + public boolean isPerspective() { + return true; } Index: Transform.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/geom/Transform.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Transform.java 15 Apr 2003 06:54:53 -0000 1.4 --- Transform.java 26 May 2003 01:48:00 -0000 1.5 *************** *** 78,80 **** --- 78,82 ---- Matrix4f getMatrix(); + boolean isPerspective(); + } |
From: <ma...@us...> - 2003-05-26 01:48:06
|
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1:/tmp/cvs-serv3271/src/org/jrman/grid Modified Files: FloatGrid.java Log Message: Improved "specular" Made z linear in projection perspective (and solved depth resolution problems). Added title and scrollpane to display. Fixed I (vector from camera) in orthographic projection. Fixed (?) bounding box enlargement by displacement bound. Index: FloatGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/FloatGrid.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FloatGrid.java 23 May 2003 06:47:01 -0000 1.8 --- FloatGrid.java 26 May 2003 01:48:00 -0000 1.9 *************** *** 23,27 **** import javax.vecmath.Vector3f; - import org.jrman.geom.Transform; import org.jrman.util.Calc; --- 23,26 ---- |
From: <ma...@us...> - 2003-05-26 01:48:06
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv3271/src/org/jrman/parser Modified Files: Frame.java Log Message: Improved "specular" Made z linear in projection perspective (and solved depth resolution problems). Added title and scrollpane to display. Fixed I (vector from camera) in orthographic projection. Fixed (?) bounding box enlargement by displacement bound. Index: Frame.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Frame.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Frame.java 8 May 2003 05:00:33 -0000 1.7 --- Frame.java 26 May 2003 01:48:00 -0000 1.8 *************** *** 116,120 **** cropWindow = new Bounds2f(0f, 1f, 0f, 1f); cameraProjection = CameraProjection.ORTHOGRAPHIC; ! nearClipping = 1e-2f; farClipping = Constants.INFINITY; fStop = Constants.INFINITY; --- 116,120 ---- cropWindow = new Bounds2f(0f, 1f, 0f, 1f); cameraProjection = CameraProjection.ORTHOGRAPHIC; ! nearClipping = Constants.EPSILON; farClipping = Constants.INFINITY; fStop = Constants.INFINITY; |
From: <ma...@us...> - 2003-05-26 01:48:06
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv3271/src/org/jrman/render Modified Files: RenderCanvas.java RendererHidden.java Log Message: Improved "specular" Made z linear in projection perspective (and solved depth resolution problems). Added title and scrollpane to display. Fixed I (vector from camera) in orthographic projection. Fixed (?) bounding box enlargement by displacement bound. Index: RenderCanvas.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RenderCanvas.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RenderCanvas.java 9 May 2003 00:05:13 -0000 1.2 --- RenderCanvas.java 26 May 2003 01:48:00 -0000 1.3 *************** *** 20,29 **** package org.jrman.render; ! import java.awt.Canvas; import java.awt.Graphics; import java.awt.Image; import java.awt.image.MemoryImageSource; ! public class RenderCanvas extends Canvas { private int hSize; --- 20,31 ---- package org.jrman.render; ! import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.image.MemoryImageSource; ! import javax.swing.JComponent; ! ! public class RenderCanvas extends JComponent { private int hSize; *************** *** 40,44 **** this.hSize = hSize; this.vSize = vSize; ! setSize(hSize,vSize); buffer = new int[hSize* vSize]; mis = new MemoryImageSource(hSize, vSize, buffer, 0, hSize); --- 42,46 ---- this.hSize = hSize; this.vSize = vSize; ! setPreferredSize(new Dimension(hSize,vSize)); buffer = new int[hSize* vSize]; mis = new MemoryImageSource(hSize, vSize, buffer, 0, hSize); Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** RendererHidden.java 23 May 2003 06:47:01 -0000 1.21 --- RendererHidden.java 26 May 2003 01:48:00 -0000 1.22 *************** *** 20,24 **** package org.jrman.render; ! import java.awt.BorderLayout; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; --- 20,24 ---- package org.jrman.render; ! import java.awt.FlowLayout; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; *************** *** 26,29 **** --- 26,31 ---- import javax.swing.JFrame; + import javax.swing.JScrollPane; + import javax.swing.ScrollPaneConstants; import javax.vecmath.Color3f; import javax.vecmath.Point2f; *************** *** 53,58 **** --- 55,66 ---- private final static int MAX_EYE_SPLITS = 10; + private final static Vector3f ORTHO_I = new Vector3f(0f, 0f, 1f); + private static Vector3f vtmp = new Vector3f(); + private static Point3f ptmp1 = new Point3f(); + + private static Point3f ptmp2 = new Point3f(); + private ClippingVolume clippingVolume; *************** *** 158,162 **** float l = vtmp.length(); vtmp.set(l, 0f, 0f); ! cameraToRaster.transformVector(vtmp, vtmp); bounds = bv.toBounds2f(vtmp.length()); } else { --- 166,174 ---- float l = vtmp.length(); vtmp.set(l, 0f, 0f); ! ptmp1.set(0f, 0f, bv.getMinZ()); ! ptmp2.add(ptmp1, vtmp); ! cameraToRaster.transformPoint(ptmp1, ptmp1); ! cameraToRaster.transformPoint(ptmp2, ptmp2); ! vtmp.sub(ptmp1, ptmp2); bounds = bv.toBounds2f(vtmp.length()); } else { *************** *** 223,229 **** public void render() { JFrame jf = new JFrame(); RenderCanvas rc = new RenderCanvas(frame.getHorizontalResolution(), frame.getVerticalResolution()); ! jf.getContentPane().add(rc, BorderLayout.CENTER); jf.pack(); jf.addWindowListener(new WindowAdapter() { --- 235,246 ---- public void render() { JFrame jf = new JFrame(); + jf.setTitle(frame.getDisplay().getName()); RenderCanvas rc = new RenderCanvas(frame.getHorizontalResolution(), frame.getVerticalResolution()); ! jf.getContentPane().add( ! new JScrollPane( ! rc, ! ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ! ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED)); jf.pack(); jf.addWindowListener(new WindowAdapter() { *************** *** 261,272 **** if (ds != null) ds.shade(shaderVariables); ! shaderVariables.I.set(shaderVariables.P); SurfaceShader surface = attr.getSurface(); if (surface == null) ! surface = SurfaceShader.createShader("fakedlight", new HashMap(), attr); surface.shade(shaderVariables); VolumeShader vs = attr.getAtmosphere(); if (vs != null) ! vs.shade(shaderVariables, frame.getNearClipping(), frame.getFarClipping()); shaderVariables.transform(cameraToRaster); shaderVariables.getMicropolygons(this); --- 278,299 ---- if (ds != null) ds.shade(shaderVariables); ! if (cameraToRaster.isPerspective()) ! shaderVariables.I.set(shaderVariables.P); ! else ! shaderVariables.I.set(ORTHO_I); SurfaceShader surface = attr.getSurface(); if (surface == null) ! surface = ! SurfaceShader.createShader( ! "fakedlight", ! new HashMap(), ! attr); surface.shade(shaderVariables); VolumeShader vs = attr.getAtmosphere(); if (vs != null) ! vs.shade( ! shaderVariables, ! frame.getNearClipping(), ! frame.getFarClipping()); shaderVariables.transform(cameraToRaster); shaderVariables.getMicropolygons(this); *************** *** 403,408 **** Calc.clamp((float) Math.ceil(yResolution * max.y - 1f), 0f, yResolution - 1); Filter filter = frame.getFilter(); ! float xw = filter.getHorizontalWidth() / 2f; ! float yw = filter.getVerticalWidth() / 2f; rxmin = (float) Math.floor(rxmin - xw); rxmax = (float) Math.ceil(rxmax + xw); --- 430,435 ---- Calc.clamp((float) Math.ceil(yResolution * max.y - 1f), 0f, yResolution - 1); Filter filter = frame.getFilter(); ! float xw = (filter.getHorizontalWidth() - 1) / 2f; ! float yw = (filter.getVerticalWidth() - 1) / 2f; rxmin = (float) Math.floor(rxmin - xw); rxmax = (float) Math.ceil(rxmax + xw); |
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv3271/sampleData Modified Files: torus.rib disk.rib ManySpheres2.rib capsules.rib ManySpheres.rib rings.rib cubeScene.rib uteapot.rib cone.rib cubeSceneInstances.rib ManySpheres3.rib bezier.rib ManyToruses.rib points.rib shaderTest.rib sphere.rib elephant.rib Added Files: elephant2.rib uteapotData.rib Log Message: Improved "specular" Made z linear in projection perspective (and solved depth resolution problems). Added title and scrollpane to display. Fixed I (vector from camera) in orthographic projection. Fixed (?) bounding box enlargement by displacement bound. --- NEW FILE: elephant2.rib --- Format 512 384 1 PixelSamples 4 4 Exposure 1 2.2 Clipping 40 80 Option "limits" "gridsize" 1024 "bucketsize" [32 32] Display "Elephant" "framebuffer" "rgb" PixelFilter "box" 1 1 Projection "perspective" "fov" 5 Translate 0 0 60 Rotate -60 1 0 0 WorldBegin LightSource "spotlight" 1 "from" [0 8 -5] "to" [0 0 0] "lightcolor" [1 0 0] "intensity" 75 LightSource "spotlight" 2 "from" [-4 8 2] "to" [0 0 0] "lightcolor" [0 1 0] "intensity" 75 LightSource "spotlight" 3 "from" [4 8 2] "to" [0 0 0] "lightcolor" [0 0 1] "intensity" 75 #Atmosphere "fog" "background" [1 1 1] "distance" 200 AttributeBegin Color 1 1 1 Surface "matte" #Patch "bilinear" "P" [-50 0 -50 50 0 -50 -50 0 50 50 0 50] Rotate -90 1 0 0 Disk 0 50 360 AttributeEnd AttributeBegin Displacement "bumptest" Surface "metal" "roughness" 1 Color .3 .3 .3 Translate 0 0 -4 Rotate -120 0 1 0 Rotate -90 1 0 0 Scale .2 .2 .2 ReadArchive "gumbo.rib" AttributeEnd WorldEnd --- NEW FILE: uteapotData.rib --- # xBodyBack AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ -80.0 0.0 30.0 -80.0 -44.8 30.0 -44.8 -80.0 30.0 0.0 -80.0 30.0 -80.0 0.0 12.0 -80.0 -44.8 12.0 -44.8 -80.0 12.0 0.0 -80.0 12.0 -60.0 0.0 3.0 -60.0 -33.6 3.0 -33.6 -60.0 3.0 0.0 -60.0 3.0 -60.0 0.0 0.0 -60.0 -33.6 0.0 -33.6 -60.0 0.0 0.0 -60.0 0.0 ] Patch "bicubic" "P" [ 0.0 -80.0 30.0 44.8 -80.0 30.0 80.0 -44.8 30.0 80.0 0.0 30.0 0.0 -80.0 12.0 44.8 -80.0 12.0 80.0 -44.8 12.0 80.0 0.0 12.0 0.0 -60.0 3.0 33.6 -60.0 3.0 60.0 -33.6 3.0 60.0 0.0 3.0 0.0 -60.0 0.0 33.6 -60.0 0.0 60.0 -33.6 0.0 60.0 0.0 0.0 ] Patch "bicubic" "P" [ -60.0 0.0 90.0 -60.0 -33.6 90.0 -33.6 -60.0 90.0 0.0 -60.0 90.0 -70.0 0.0 69.0 -70.0 -39.20 69.0 -39.20 -70.0 69.0 0.0 -70.0 69.0 -80.0 0.0 48.0 -80.0 -44.8 48.0 -44.8 -80.0 48.0 0.0 -80.0 48.0 -80.0 0.0 30.0 -80.0 -44.8 30.0 -44.8 -80.0 30.0 0.0 -80.0 30.0 ] Patch "bicubic" "P" [ 0.0 -60.0 90.0 33.6 -60.0 90.0 60.0 -33.6 90.0 60.0 0.0 90.0 0.0 -70.0 69.0 39.20 -70.0 69.0 70.0 -39.20 69.0 70.0 0.0 69.0 0.0 -80.0 48.0 44.8 -80.0 48.0 80.0 -44.8 48.0 80.0 0.0 48.0 0.0 -80.0 30.0 44.8 -80.0 30.0 80.0 -44.8 30.0 80.0 0.0 30.0 ] Patch "bicubic" "P" [ -56.0 0.0 90.0 -56.0 -31.36 90.0 -31.36 -56.0 90.0 0.0 -56.0 90.0 -53.5 0.0 95.25 -53.5 -29.96 95.25 -29.96 -53.5 95.25 0.0 -53.5 95.25 -57.5 0.0 95.25 -57.5 -32.20 95.25 -32.20 -57.5 95.25 0.0 -57.5 95.25 -60.0 0.0 90.0 -60.0 -33.6 90.0 -33.6 -60.0 90.0 0.0 -60.0 90.0 ] Patch "bicubic" "P" [ 0.0 -56.0 90.0 31.36 -56.0 90.0 56.0 -31.36 90.0 56.0 0.0 90.0 0.0 -53.5 95.25 29.96 -53.5 95.25 53.5 -29.96 95.25 53.5 0.0 95.25 0.0 -57.5 95.25 32.20 -57.5 95.25 57.5 -32.20 95.25 57.5 0.0 95.25 0.0 -60.0 90.0 33.6 -60.0 90.0 60.0 -33.6 90.0 60.0 0.0 90.0 ] AttributeEnd # xBody_Front AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 80.0 0.0 30.0 80.0 44.80 30.0 44.80 80.0 30.0 0.0 80.0 30.0 80.0 0.0 12.0 80.0 44.80 12.0 44.80 80.0 12.0 0.0 80.0 12.0 60.0 0.0 3.0 60.0 33.60 3.0 33.60 60.0 3.0 0.0 60.0 3.0 60.0 0.0 0.0 60.0 33.60 0.0 33.60 60.0 0.0 0.0 60.0 0.0 ] Patch "bicubic" "P" [ 0.0 80.0 30.0 -44.80 80.0 30.0 -80.0 44.80 30.0 -80.0 0.0 30.0 0.0 80.0 12.0 -44.80 80.0 12.0 -80.0 44.80 12.0 -80.0 0.0 12.0 0.0 60.0 3.0 -33.60 60.0 3.0 -60.0 33.60 3.0 -60.0 0.0 3.0 0.0 60.0 0.0 -33.60 60.0 0.0 -60.0 33.60 0.0 -60.0 0.0 0.0 ] Patch "bicubic" "P" [ 60.0 0.0 90.0 60.0 33.60 90.0 33.60 60.0 90.0 0.0 60.0 90.0 70.0 0.0 69.0 70.0 39.20 69.0 39.20 70.0 69.0 0.0 70.0 69.0 80.0 0.0 48.0 80.0 44.80 48.0 44.80 80.0 48.0 0.0 80.0 48.0 80.0 0.0 30.0 80.0 44.80 30.0 44.80 80.0 30.0 0.0 80.0 30.0 ] Patch "bicubic" "P" [ 0.0 60.0 90.0 -33.60 60.0 90.0 -60.0 33.60 90.0 -60.0 0.0 90.0 0.0 70.0 69.0 -39.20 70.0 69.0 -70.0 39.20 69.0 -70.0 0.0 69.0 0.0 80.0 48.0 -44.80 80.0 48.0 -80.0 44.80 48.0 -80.0 0.0 48.0 0.0 80.0 30.0 -44.80 80.0 30.0 -80.0 44.80 30.0 -80.0 0.0 30.0 ] Patch "bicubic" "P" [ 56.0 0.0 90.0 56.0 31.36 90.0 31.36 56.0 90.0 0.0 56.0 90.0 53.50 0.0 95.25 53.50 29.96 95.25 29.96 53.50 95.25 0.0 53.50 95.25 57.50 0.0 95.25 57.50 32.20 95.25 32.20 57.50 95.25 0.0 57.50 95.25 60.0 0.0 90.0 60.0 33.60 90.0 33.60 60.0 90.0 0.0 60.0 90.0 ] Patch "bicubic" "P" [ 0.0 56.0 90.0 -31.36 56.0 90.0 -56.0 31.36 90.0 -56.0 0.0 90.0 0.0 53.50 95.25 -29.96 53.50 95.25 -53.50 29.96 95.25 -53.50 0.0 95.25 0.0 57.50 95.25 -32.20 57.50 95.25 -57.50 32.20 95.25 -57.50 0.0 95.25 0.0 60.0 90.0 -33.60 60.0 90.0 -60.0 33.60 90.0 -60.0 0.0 90.0 ] AttributeEnd # Spout AttributeBegin Basis "bezier" 3 "bezier" 3 Sides 2 Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 68.0 0.0 51.0 68.0 26.40 51.0 68.0 26.40 18.0 68.0 0.0 18.0 104.0 0.0 51.0 104.0 26.40 51.0 124.0 26.40 27.0 124.0 0.0 27.0 92.0 0.0 78.0 92.0 10.0 78.0 96.0 10.0 75.0 96.0 0.0 75.0 108.0 0.0 90.0 108.0 10.0 90.0 132.0 10.0 90.0 132.0 0.0 90.0 ] Patch "bicubic" "P" [ 68.0 0.0 18.0 68.0 -26.40 18.0 68.0 -26.40 51.0 68.0 0.0 51.0 124.0 0.0 27.0 124.0 -26.40 27.0 104.0 -26.40 51.0 104.0 0.0 51.0 96.0 0.0 75.0 96.0 -10.0 75.0 92.0 -10.0 78.0 92.0 0.0 78.0 132.0 0.0 90.0 132.0 -10.0 90.0 108.0 -10.0 90.0 108.0 0.0 90.0 ] Patch "bicubic" "P" [ 108.0 0.0 90.0 108.0 10.0 90.0 132.0 10.0 90.0 132.0 0.0 90.0 112.0 0.0 93.0 112.0 10.0 93.0 141.0 10.0 93.75 141.0 0.0 93.75 116.0 0.0 93.0 116.0 6.0 93.0 138.0 6.0 94.50 138.0 0.0 94.50 112.0 0.0 90.0 112.0 6.0 90.0 128.0 6.0 90.0 128.0 0.0 90.0 ] Patch "bicubic" "P" [ 132.0 0.0 90.0 132.0 -10.0 90.0 108.0 -10.0 90.0 108.0 0.0 90.0 141.0 0.0 93.75 141.0 -10.0 93.75 112.0 -10.0 93.0 112.0 0.0 93.0 138.0 0.0 94.50 138.0 -6.0 94.50 116.0 -6.0 93.0 116.0 0.0 93.0 128.0 0.0 90.0 128.0 -6.0 90.0 112.0 -6.0 90.0 112.0 0.0 90.0 ] AttributeEnd # Handle AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ -64.0 0.0 75.0 -64.0 12.0 75.0 -60.0 12.0 84.0 -60.0 0.0 84.0 -92.0 0.0 75.0 -92.0 12.0 75.0 -100.0 12.0 84.0 -100.0 0.0 84.0 -108.0 0.0 75.0 -108.0 12.0 75.0 -120.0 12.0 84.0 -120.0 0.0 84.0 -108.0 0.0 66.0 -108.0 12.0 66.0 -120.0 12.0 66.0 -120.0 0.0 66.0 ] Patch "bicubic" "P" [ -60.0 0.0 84.0 -60.0 -12.0 84.0 -64.0 -12.0 75.0 -64.0 0.0 75.0 -100.0 0.0 84.0 -100.0 -12.0 84.0 -92.0 -12.0 75.0 -92.0 0.0 75.0 -120.0 0.0 84.0 -120.0 -12.0 84.0 -108.0 -12.0 75.0 -108.0 0.0 75.0 -120.0 0.0 66.0 -120.0 -12.0 66.0 -108.0 -12.0 66.0 -108.0 0.0 66.0 ] Patch "bicubic" "P" [ -108.0 0.0 66.0 -108.0 12.0 66.0 -120.0 12.0 66.0 -120.0 0.0 66.0 -108.0 0.0 57.0 -108.0 12.0 57.0 -120.0 12.0 48.0 -120.0 0.0 48.0 -100.0 0.0 39.0 -100.0 12.0 39.0 -106.0 12.0 31.50 -106.0 0.0 31.50 -80.0 0.0 30.0 -80.0 12.0 30.0 -76.0 12.0 18.0 -76.0 0.0 18.0 ] Patch "bicubic" "P" [ -120.0 0.0 66.0 -120.0 -12.0 66.0 -108.0 -12.0 66.0 -108.0 0.0 66.0 -120.0 0.0 48.0 -120.0 -12.0 48.0 -108.0 -12.0 57.0 -108.0 0.0 57.0 -106.0 0.0 31.50 -106.0 -12.0 31.50 -100.0 -12.0 39.0 -100.0 0.0 39.0 -76.0 0.0 18.0 -76.0 -12.0 18.0 -80.0 -12.0 30.0 -80.0 0.0 30.0 ] AttributeEnd # Lid AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 8.0 0.0 102.0 8.0 4.48 102.0 4.48 8.0 102.0 0.0 8.0 102.0 16.0 0.0 96.0 16.0 8.96 96.0 8.96 16.0 96.0 0.0 16.0 96.0 52.0 0.0 96.0 52.0 29.12 96.0 29.12 52.0 96.0 0.0 52.0 96.0 52.0 0.0 90.0 52.0 29.12 90.0 29.12 52.0 90.0 0.0 52.0 90.0 ] Patch "bicubic" "P" [ 0.0 8.0 102.0 -4.48 8.0 102.0 -8.0 4.48 102.0 -8.0 0.0 102.0 0.0 16.0 96.0 -8.96 16.0 96.0 -16.0 8.96 96.0 -16.0 0.0 96.0 0.0 52.0 96.0 -29.12 52.0 96.0 -52.0 29.12 96.0 -52.0 0.0 96.0 0.0 52.0 90.0 -29.12 52.0 90.0 -52.0 29.12 90.0 -52.0 0.0 90.0 ] Patch "bicubic" "P" [ -8.0 0.0 102.0 -8.0 -4.48 102.0 -4.48 -8.0 102.0 0.0 -8.0 102.0 -16.0 0.0 96.0 -16.0 -8.96 96.0 -8.96 -16.0 96.0 0.0 -16.0 96.0 -52.0 0.0 96.0 -52.0 -29.12 96.0 -29.12 -52.0 96.0 0.0 -52.0 96.0 -52.0 0.0 90.0 -52.0 -29.12 90.0 -29.12 -52.0 90.0 0.0 -52.0 90.0 ] Patch "bicubic" "P" [ 0.0 -8.0 102.0 4.48 -8.0 102.0 8.0 -4.48 102.0 8.0 0.0 102.0 0.0 -16.0 96.0 8.96 -16.0 96.0 16.0 -8.96 96.0 16.0 0.0 96.0 0.0 -52.0 96.0 29.12 -52.0 96.0 52.0 -29.12 96.0 52.0 0.0 96.0 0.0 -52.0 90.0 29.12 -52.0 90.0 52.0 -29.12 90.0 52.0 0.0 90.0 ] AttributeEnd # Knob AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 32.0 0.0 120.0 32.0 18.0 120.0 18.0 32.0 120.0 0.0 32.0 120.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 8.0 0.0 102.0 8.0 4.48 102.0 4.48 8.0 102.0 0.0 8.0 102.0 ] Patch "bicubic" "P" [ 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 32.0 120.0 -18.0 32.0 120.0 -32.0 18.0 120.0 -32.0 0.0 120.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 8.0 102.0 -4.48 8.0 102.0 -8.0 4.48 102.0 -8.0 0.0 102.0 ] Patch "bicubic" "P" [ 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 -32.0 0.0 120.0 -32.0 -18.0 120.0 -18.0 -32.0 120.0 0.0 -32.0 120.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 -8.0 0.0 102.0 -8.0 -4.48 102.0 -4.48 -8.0 102.0 0.0 -8.0 102.0 ] Patch "bicubic" "P" [ 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 -32.0 120.0 18.0 -32.0 120.0 32.0 -18.0 120.0 32.0 0.0 120.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 -8.0 102.0 4.48 -8.0 102.0 8.0 -4.48 102.0 8.0 0.0 102.0 ] AttributeEnd # Lip AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 50.0 0.0 90.0 50.0 28.0 90.0 28.0 50.0 90.0 0.0 50.0 90.0 52.0 0.0 90.0 52.0 29.12 90.0 29.12 52.0 90.0 0.0 52.0 90.0 54.0 0.0 90.0 54.0 30.24 90.0 30.24 54.0 90.0 0.0 54.0 90.0 56.0 0.0 90.0 56.0 31.36 90.0 31.36 56.0 90.0 0.0 56.0 90.0 ] Patch "bicubic" "P" [ 0.0 50.0 90.0 -28.0 50.0 90.0 -50.0 28.0 90.0 -50.0 0.0 90.0 0.0 52.0 90.0 -29.12 52.0 90.0 -52.0 29.12 90.0 -52.0 0.0 90.0 0.0 54.0 90.0 -30.24 54.0 90.0 -54.0 30.24 90.0 -54.0 0.0 90.0 0.0 56.0 90.0 -31.36 56.0 90.0 -56.0 31.36 90.0 -56.0 0.0 90.0 ] Patch "bicubic" "P" [ -50.0 0.0 90.0 -50.0 -28.0 90.0 -28.0 -50.0 90.0 0.0 -50.0 90.0 -52.0 0.0 90.0 -52.0 -29.12 90.0 -29.12 -52.0 90.0 0.0 -52.0 90.0 -54.0 0.0 90.0 -54.0 -30.24 90.0 -30.24 -54.0 90.0 0.0 -54.0 90.0 -56.0 0.0 90.0 -56.0 -31.36 90.0 -31.36 -56.0 90.0 0.0 -56.0 90.0 ] Patch "bicubic" "P" [ 0.0 -50.0 90.0 28.0 -50.0 90.0 50.0 -28.0 90.0 50.0 0.0 90.0 0.0 -52.0 90.0 29.12 -52.0 90.0 52.0 -29.12 90.0 52.0 0.0 90.0 0.0 -54.0 90.0 30.24 -54.0 90.0 54.0 -30.24 90.0 54.0 0.0 90.0 0.0 -56.0 90.0 31.36 -56.0 90.0 56.0 -31.36 90.0 56.0 0.0 90.0 ] AttributeEnd Index: torus.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/torus.rib,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** torus.rib 22 May 2003 22:17:43 -0000 1.10 --- torus.rib 26 May 2003 01:47:59 -0000 1.11 *************** *** 2,6 **** #Option "limits" "gridsize" 1024 PixelSamples 4 4 ! Exposure 1 2.5 Projection "perspective" "fov" 20 Surface "fakedlight" --- 2,6 ---- #Option "limits" "gridsize" 1024 PixelSamples 4 4 ! Exposure 1 2.2 Projection "perspective" "fov" 20 Surface "fakedlight" *************** *** 105,107 **** Disk -8 30 360 TransformEnd ! WorldEnd \ No newline at end of file --- 105,107 ---- Disk -8 30 360 TransformEnd ! WorldEnd Index: disk.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/disk.rib,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** disk.rib 21 May 2003 04:58:40 -0000 1.3 --- disk.rib 26 May 2003 01:47:59 -0000 1.4 *************** *** 1,5 **** Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.5 Projection "perspective" "fov" 20 Surface "fakedlight" --- 1,5 ---- Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.2 Projection "perspective" "fov" 20 Surface "fakedlight" *************** *** 42,44 **** Disk 2 1 90 AttributeEnd ! WorldEnd \ No newline at end of file --- 42,44 ---- Disk 2 1 90 AttributeEnd ! WorldEnd Index: ManySpheres2.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/ManySpheres2.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ManySpheres2.rib 7 May 2003 07:08:28 -0000 1.1 --- ManySpheres2.rib 26 May 2003 01:47:59 -0000 1.2 *************** *** 1,5 **** Format 320 240 1 PixelSamples 4 4 ! Exposure 1 2.5 Display "ManySpheres.tif" "framebuffer" "rgb" #Display "ManySpheres.tif" "file" "rgb" --- 1,5 ---- Format 320 240 1 PixelSamples 4 4 ! Exposure 1 2.2 Display "ManySpheres.tif" "framebuffer" "rgb" #Display "ManySpheres.tif" "file" "rgb" Index: capsules.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/capsules.rib,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** capsules.rib 23 May 2003 06:47:00 -0000 1.7 --- capsules.rib 26 May 2003 01:47:59 -0000 1.8 *************** *** 2,7 **** Format 400 300 1 PixelSamples 4 4 ! Exposure 1 2.5 ! Clipping 20 150 Projection "perspective" "fov" 40 Translate 0 0 75 --- 2,7 ---- Format 400 300 1 PixelSamples 4 4 ! Exposure 1 2.2 ! Clipping 10 150 Projection "perspective" "fov" 40 Translate 0 0 75 Index: ManySpheres.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/ManySpheres.rib,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ManySpheres.rib 23 May 2003 06:47:00 -0000 1.20 --- ManySpheres.rib 26 May 2003 01:47:59 -0000 1.21 *************** *** 1,5 **** ! Format 320 240 1 ! PixelSamples 8 8 ! Exposure 1 2.5 Clipping 30 100 Display "ManySpheres.tif" "framebuffer" "rgb" --- 1,5 ---- ! Format 800 600 1 ! PixelSamples 4 4 ! Exposure 1 2.2 Clipping 30 100 Display "ManySpheres.tif" "framebuffer" "rgb" *************** *** 32,36 **** Color 1 1 0 AttributeBegin ! Surface "metal" Translate 1 0 2 Rotate 30 0 1 0 --- 32,36 ---- Color 1 1 0 AttributeBegin ! Surface "plastic" Translate 1 0 2 Rotate 30 0 1 0 *************** *** 39,43 **** AttributeEnd AttributeBegin ! Surface "metal" Translate -1 0 2.5 Rotate 60 1 0 0 --- 39,43 ---- AttributeEnd AttributeBegin ! Surface "plastic" Translate -1 0 2.5 Rotate 60 1 0 0 Index: rings.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/rings.rib,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rings.rib 12 May 2003 16:46:17 -0000 1.3 --- rings.rib 26 May 2003 01:47:59 -0000 1.4 *************** *** 2,6 **** Display "rings.rib" "framebuffer" "rgb" PixelSamples 4 4 ! Exposure 1 2.5 Clipping 1 1000 Projection "perspective" "fov" 10 --- 2,6 ---- Display "rings.rib" "framebuffer" "rgb" PixelSamples 4 4 ! Exposure 1 2.2 Clipping 1 1000 Projection "perspective" "fov" 10 Index: cubeScene.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/cubeScene.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cubeScene.rib 11 May 2003 02:53:43 -0000 1.4 --- cubeScene.rib 26 May 2003 01:47:59 -0000 1.5 *************** *** 1,5 **** Format 800 600 1 PixelSamples 4 4 ! Exposure 1 2.5 Display "cubeScene.tif" "framebuffer" "rgb" PixelFilter "box" 1 1 --- 1,5 ---- Format 800 600 1 PixelSamples 4 4 ! Exposure 1 2.2 Display "cubeScene.tif" "framebuffer" "rgb" PixelFilter "box" 1 1 Index: uteapot.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/uteapot.rib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** uteapot.rib 23 May 2003 06:47:00 -0000 1.2 --- uteapot.rib 26 May 2003 01:47:59 -0000 1.3 *************** *** 11,15 **** #Display "uteapot.tiff" "file" "rgb" Display "teapot" "framebuffer" "rgb" ! Format 512 384 1.0 PixelSamples 4 4 PixelFilter "box" 1 1 --- 11,16 ---- #Display "uteapot.tiff" "file" "rgb" Display "teapot" "framebuffer" "rgb" ! Format 400 300 1.0 ! #Option "limits" "bucketsize" [32 32] "gridsize" 1024 PixelSamples 4 4 PixelFilter "box" 1 1 *************** *** 17,21 **** Exposure 1.0 2.2 ! Projection "perspective" "fov" 30 Translate 0 0 400 --- 18,22 ---- Exposure 1.0 2.2 ! Projection "perspective" "fov" 28 Translate 0 0 400 Index: cone.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/cone.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cone.rib 10 May 2003 20:37:51 -0000 1.1 --- cone.rib 26 May 2003 01:47:59 -0000 1.2 *************** *** 1,5 **** Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.5 Projection "perspective" "fov" 20 Surface "fakedlight" --- 1,5 ---- Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.2 Projection "perspective" "fov" 20 Surface "fakedlight" *************** *** 43,45 **** Cone 4 1 90 AttributeEnd ! WorldEnd \ No newline at end of file --- 43,45 ---- Cone 4 1 90 AttributeEnd ! WorldEnd Index: cubeSceneInstances.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/cubeSceneInstances.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cubeSceneInstances.rib 11 May 2003 02:53:43 -0000 1.1 --- cubeSceneInstances.rib 26 May 2003 01:47:59 -0000 1.2 *************** *** 1,5 **** Format 800 600 1 PixelSamples 4 4 ! Exposure 1 2.5 Display "cubeSceneInstances.tif" "framebuffer" "rgb" PixelFilter "box" 1 1 --- 1,5 ---- Format 800 600 1 PixelSamples 4 4 ! Exposure 1 2.2 Display "cubeSceneInstances.tif" "framebuffer" "rgb" PixelFilter "box" 1 1 Index: ManySpheres3.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/ManySpheres3.rib,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ManySpheres3.rib 22 May 2003 04:50:14 -0000 1.5 --- ManySpheres3.rib 26 May 2003 01:47:59 -0000 1.6 *************** *** 1,5 **** Format 800 600 1 PixelSamples 4 4 ! Exposure 1 2.5 Display "ManySpheres.tif" "framebuffer" "rgb" #Display "ManySpheres.tif" "file" "rgb" --- 1,5 ---- Format 800 600 1 PixelSamples 4 4 ! Exposure 1 2.2 Display "ManySpheres.tif" "framebuffer" "rgb" #Display "ManySpheres.tif" "file" "rgb" Index: bezier.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/bezier.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bezier.rib 22 May 2003 22:17:43 -0000 1.1 --- bezier.rib 26 May 2003 01:47:59 -0000 1.2 *************** *** 1,5 **** Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.5 Option "limits" "gridsize" 16384 Projection "perspective" "fov" 10 --- 1,5 ---- Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.2 Option "limits" "gridsize" 16384 Projection "perspective" "fov" 10 *************** *** 32,34 **** #Patch "bilinear" "P" [0 0 1 0 3 1 3 0 1 3 3 1] AttributeEnd ! WorldEnd \ No newline at end of file --- 32,34 ---- #Patch "bilinear" "P" [0 0 1 0 3 1 3 0 1 3 3 1] AttributeEnd ! WorldEnd Index: ManyToruses.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/ManyToruses.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ManyToruses.rib 5 May 2003 08:29:07 -0000 1.1 --- ManyToruses.rib 26 May 2003 01:47:59 -0000 1.2 *************** *** 1,5 **** Format 640 480 1 PixelSamples 4 4 ! Exposure 1 2.5 Clipping 1 1000 Projection "perspective" "fov" 20 --- 1,5 ---- Format 640 480 1 PixelSamples 4 4 ! Exposure 1 2.2 Clipping 1 1000 Projection "perspective" "fov" 20 *************** *** 12,14 **** Color .7 .7 1 ReadArchive "Toruses.rib" ! WorldEnd \ No newline at end of file --- 12,14 ---- Color .7 .7 1 ReadArchive "Toruses.rib" ! WorldEnd Index: points.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/points.rib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** points.rib 17 May 2003 21:47:57 -0000 1.2 --- points.rib 26 May 2003 01:47:59 -0000 1.3 *************** *** 1,5 **** Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.5 Projection "perspective" "fov" 20 Surface "fakedlight" --- 1,5 ---- Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.2 Projection "perspective" "fov" 20 Surface "fakedlight" *************** *** 17,19 **** "Os" [.3 .3 .3 1 1 1 1 1 1 1 1 1] AttributeEnd ! WorldEnd \ No newline at end of file --- 17,19 ---- "Os" [.3 .3 .3 1 1 1 1 1 1 1 1 1] AttributeEnd ! WorldEnd Index: shaderTest.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/shaderTest.rib,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shaderTest.rib 23 May 2003 06:47:00 -0000 1.6 --- shaderTest.rib 26 May 2003 01:47:59 -0000 1.7 *************** *** 4,8 **** PixelFilter "box" 1 1 PixelSamples 8 8 ! Exposure 1 2.5 Projection "perspective" "fov" 5.5 Translate 0 0 40 --- 4,8 ---- PixelFilter "box" 1 1 PixelSamples 8 8 ! Exposure 1 2.2 Projection "perspective" "fov" 5.5 Translate 0 0 40 Index: sphere.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/sphere.rib,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sphere.rib 7 May 2003 07:08:34 -0000 1.8 --- sphere.rib 26 May 2003 01:47:59 -0000 1.9 *************** *** 1,5 **** Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.5 Clipping 1 1000 Option "limits" "bucketsize" [24 24] "gridsize" [576] --- 1,5 ---- Format 480 360 1 PixelSamples 4 4 ! Exposure 1 2.2 Clipping 1 1000 Option "limits" "bucketsize" [24 24] "gridsize" [576] Index: elephant.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/elephant.rib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** elephant.rib 23 May 2003 06:47:00 -0000 1.2 --- elephant.rib 26 May 2003 01:47:59 -0000 1.3 *************** *** 1,6 **** ! Format 640 480 1 ! PixelSamples 16 16 ! Exposure 1 2.5 Clipping 40 80 Display "Elephant" "framebuffer" "rgb" PixelFilter "box" 1 1 --- 1,7 ---- ! Format 2000 1500 1 ! PixelSamples 4 4 ! Exposure 1 2.2 Clipping 40 80 + Option "limits" "gridsize" 1024 "bucketsize" [32 32] Display "Elephant" "framebuffer" "rgb" PixelFilter "box" 1 1 *************** *** 25,29 **** AttributeBegin Displacement "bumptest" ! Surface "metal" Color .3 .3 .3 Translate 0 0 -4 --- 26,30 ---- AttributeBegin Displacement "bumptest" ! Surface "metal" "roughness" 1 Color .3 .3 .3 Translate 0 0 -4 *************** *** 33,35 **** ReadArchive "gumbo.rib" AttributeEnd ! WorldEnd \ No newline at end of file --- 34,36 ---- ReadArchive "gumbo.rib" AttributeEnd ! WorldEnd |
From: <ma...@us...> - 2003-05-26 01:48:06
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1:/tmp/cvs-serv3271/src/org/jrman/shaders Modified Files: SurfaceShader.java Log Message: Improved "specular" Made z linear in projection perspective (and solved depth resolution problems). Added title and scrollpane to display. Fixed I (vector from camera) in orthographic projection. Fixed (?) bounding box enlargement by displacement bound. Index: SurfaceShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceShader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SurfaceShader.java 23 May 2003 06:47:01 -0000 1.11 --- SurfaceShader.java 26 May 2003 01:48:00 -0000 1.12 *************** *** 140,144 **** _fg2.dot(Nn, H); _fg2.max(_fg2, 0f); ! _fg2.pow(_fg2, 1f / roughness); nonspec.sub(1, nonspec); _fg2.mul(_fg2, nonspec); --- 140,144 ---- _fg2.dot(Nn, H); _fg2.max(_fg2, 0f); ! _fg2.pow(_fg2, 10f / roughness); nonspec.sub(1, nonspec); _fg2.mul(_fg2, nonspec); |
From: <ma...@us...> - 2003-05-23 06:47:06
|
Update of /cvsroot/jrman/drafts/src/org/jrman/render In directory sc8-pr-cvs1:/tmp/cvs-serv11999/src/org/jrman/render Modified Files: RendererHidden.java Log Message: Added plastic surface shader. Added fog and depthcue volume shaders. Better error handling. Index: RendererHidden.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/render/RendererHidden.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** RendererHidden.java 20 May 2003 01:08:38 -0000 1.20 --- RendererHidden.java 23 May 2003 06:47:01 -0000 1.21 *************** *** 46,49 **** --- 46,50 ---- import org.jrman.shaders.DisplacementShader; import org.jrman.shaders.SurfaceShader; + import org.jrman.shaders.VolumeShader; import org.jrman.util.Calc; *************** *** 265,268 **** --- 266,272 ---- surface = SurfaceShader.createShader("fakedlight", new HashMap(), attr); surface.shade(shaderVariables); + VolumeShader vs = attr.getAtmosphere(); + if (vs != null) + vs.shade(shaderVariables, frame.getNearClipping(), frame.getFarClipping()); shaderVariables.transform(cameraToRaster); shaderVariables.getMicropolygons(this); |
From: <ma...@us...> - 2003-05-23 06:47:05
|
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1:/tmp/cvs-serv11999/src/org/jrman/grid Modified Files: FloatGrid.java Log Message: Added plastic surface shader. Added fog and depthcue volume shaders. Better error handling. Index: FloatGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/FloatGrid.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FloatGrid.java 6 May 2003 02:15:13 -0000 1.7 --- FloatGrid.java 23 May 2003 06:47:01 -0000 1.8 *************** *** 1167,1188 **** */ ! public void depth(Point3fGrid p, Transform toCamera, float near, float far) { 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); } public void depth( Point3fGrid p, - Transform toCamera, float near, float far, BooleanGrid cond) { 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); } --- 1167,1185 ---- */ ! public void depth(Point3fGrid p, float near, float far) { Point3f[] pdata = (Point3f[]) p.data; for (int i = 0; i < size; i++) ! data[i] = Calc.depth(pdata[i], near, far); } public void depth( Point3fGrid p, float near, float far, BooleanGrid cond) { Point3f[] pdata = (Point3f[]) p.data; for (int i = 0; i < size; i++) if (cond.data[i]) ! data[i] = Calc.depth(pdata[i], near, far); } |
From: <ma...@us...> - 2003-05-23 06:47:05
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs1:/tmp/cvs-serv11999/src/org/jrman/util Modified Files: Calc.java Log Message: Added plastic surface shader. Added fog and depthcue volume shaders. Better error handling. Index: Calc.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Calc.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Calc.java 22 May 2003 07:36:27 -0000 1.8 --- Calc.java 23 May 2003 06:47:02 -0000 1.9 *************** *** 71,85 **** public static float depth( Point3f p, - Transform toCamera, float near, ! float far, ! Point3f tmp) { ! toCamera.transformPoint(p, tmp); ! return (tmp.z - near) / (far - near); ! } ! ! public static float depth(Point3f p, Transform toCamera, float near, float far) { ! Point3f tmp = new Point3f(); ! return depth(p, toCamera, near, far, tmp); } --- 71,77 ---- public static float depth( Point3f p, float near, ! float far) { ! return (p.z - near) / (far - near); } |
From: <ma...@us...> - 2003-05-23 06:47:05
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv11999/src/org/jrman/parser Modified Files: Parser.java Log Message: Added plastic surface shader. Added fog and depthcue volume shaders. Better error handling. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Parser.java 22 May 2003 07:36:26 -0000 1.47 --- Parser.java 23 May 2003 06:47:02 -0000 1.48 *************** *** 153,169 **** int tk; while ((tk = st.nextToken()) != StreamTokenizer.TT_EOF) { ! if (tk != StreamTokenizer.TT_WORD) ! throw new Exception("Expected keyword at line " + st.lineno()); ! String keyword = st.sval; ! KeywordParser kp = getKeyWordParser(keyword); ! if (!kp.getValidStates().contains(state)) ! throw new IllegalStateException( ! "Keyword" ! + kp ! + " is not valid in state " ! + state ! + ", at line " ! + st.lineno()); ! kp.parse(st); } fis.close(); --- 153,173 ---- int tk; while ((tk = st.nextToken()) != StreamTokenizer.TT_EOF) { ! try { ! if (tk != StreamTokenizer.TT_WORD) ! throw new Exception("Expected keyword at line " + st.lineno()); ! String keyword = st.sval; ! KeywordParser kp = getKeyWordParser(keyword); ! if (!kp.getValidStates().contains(state)) ! throw new IllegalStateException( ! "Keyword" ! + kp ! + " is not valid in state " ! + state ! + ", at line " ! + st.lineno()); ! kp.parse(st); ! } catch (Exception pe) { ! System.err.println("Error: " + pe); ! } } fis.close(); |
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1:/tmp/cvs-serv11999/src/org/jrman/shaders Modified Files: SurfaceShader.java DisplacementShader.java LightShader.java VolumeShader.java Added Files: VolumeDepthcue.java SurfacePlastic.java VolumeFog.java Log Message: Added plastic surface shader. Added fog and depthcue volume shaders. Better error handling. --- NEW FILE: VolumeDepthcue.java --- /* VolumeDepthcue.java Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.shaders; import javax.vecmath.Color3f; import org.jrman.grid.FloatGrid; import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; public class VolumeDepthcue extends VolumeShader { private final static Color3f OPAQUE = new Color3f(1f, 1f, 1f); private static FloatGrid fg1 = new FloatGrid(); protected void initDefaults() { float[][] mindistance = new float[1][]; mindistance[0] = new float[1]; mindistance[0][0] = 0f; Parameter param = new Parameter(new Declaration("mindistance", "uniform float"), mindistance); defaultParameters.put("mindistance", param); float[][] maxdistance = new float[1][]; maxdistance[0] = new float[1]; maxdistance[0][0] = 1f; param = new Parameter(new Declaration("maxdistance", "uniform float"), maxdistance); defaultParameters.put("maxdistance", param); Color3f[][] background = new Color3f[1][]; background[0] = new Color3f[1]; background[0][0] = new Color3f(0f, 0f, 0f); param = new Parameter(new Declaration("background", "uniform color"), background); defaultParameters.put("background", param); } public void shade(ShaderVariables sv, float near, float far) { super.shade(sv, near, far); Parameter param = (Parameter) getParameter(sv, "mindistance"); float[][] f = (float[][]) param.getData(); final float mindistance = f[0][0]; param = (Parameter) getParameter(sv, "maxdistance"); f = (float[][]) param.getData(); final float maxdistance = f[0][0]; param = (Parameter) getParameter(sv, "background"); Color3f[][] c = (Color3f[][]) param.getData(); final Color3f background = c[0][0]; fg1.depth(sv.P, near, far); fg1.sub(fg1, mindistance); fg1.div(fg1, maxdistance - mindistance); fg1.clamp(fg1, 0f, 1f); sv.Ci.mix(sv.Ci, background, fg1); sv.Oi.mix(sv.Oi, OPAQUE, fg1); } } --- NEW FILE: SurfacePlastic.java --- /* SurfaceMetal.java Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.shaders; import javax.vecmath.Color3f; import org.jrman.grid.Color3fGrid; import org.jrman.grid.Vector3fGrid; import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; public class SurfacePlastic extends SurfaceShader { private static Vector3fGrid vg1 = new Vector3fGrid(); private static Vector3fGrid vg2 = new Vector3fGrid(); private static Color3fGrid cg1 = new Color3fGrid(); private static Color3fGrid cg2 = new Color3fGrid(); private static Color3fGrid cg3 = new Color3fGrid(); protected void initDefaults() { float[][] Ka = new float[1][]; Ka[0] = new float[1]; Ka[0][0] = 1f; Parameter param = new Parameter(new Declaration("Ka", "uniform float"), Ka); defaultParameters.put("Ka", param); float[][] Kd = new float[1][]; Kd[0] = new float[1]; Kd[0][0] = 1f; param = new Parameter(new Declaration("Kd", "uniform float"), Kd); defaultParameters.put("Kd", param); float[][] Ks = new float[1][]; Ks[0] = new float[1]; Ks[0][0] = 1f; param = new Parameter(new Declaration("Ks", "uniform float"), Ks); defaultParameters.put("Ks", param); float[][] roughness = new float[1][]; roughness[0] = new float[1]; roughness[0][0] = .1f; param = new Parameter(new Declaration("roughness", "uniform float"), roughness); defaultParameters.put("roughness", param); Color3f[][] specularcolor = new Color3f[1][]; specularcolor[0] = new Color3f[1]; specularcolor[0][0] = new Color3f(1f, 1f, 1f); param = new Parameter(new Declaration("specularcolor", "uniform color"), specularcolor); defaultParameters.put("specularcolor", param); } public void shade(ShaderVariables sv) { super.shade(sv); Parameter param = (Parameter) getParameter(sv, "Ka"); float[][] f = (float[][]) param.getData(); final float Ka = f[0][0]; param = (Parameter) getParameter(sv, "Kd"); f = (float[][]) param.getData(); final float Kd = f[0][0]; param = (Parameter) getParameter(sv, "Ks"); f = (float[][]) param.getData(); final float Ks = f[0][0]; param = (Parameter) getParameter(sv, "roughness"); f = (float[][]) param.getData(); final float roughness = f[0][0]; param = (Parameter) getParameter(sv, "specularcolor"); Color3f[][] c = (Color3f[][]) param.getData(); final Color3f specularcolor = c[0][0]; vg1.normalize(sv.N); vg1.faceforward(vg1, sv.I); vg2.normalize(sv.I); vg2.negate(vg2); sv.Oi.set(sv.Os); ambient(sv, cg1); cg3.set(Ka); cg1.mul(cg1, cg3); diffuse(sv, vg1, cg2); cg3.set(Kd); cg2.mul(cg2, cg3); cg1.add(cg1, cg2); cg1.mul(cg1, sv.Cs); specular(sv, vg1, vg2, roughness, cg2); cg3.set(Ks); cg2.mul(cg2, cg3); cg3.set(specularcolor); cg2.mul(cg2, cg3); cg1.add(cg1, cg2); sv.Ci.mul(sv.Os, cg1); } } --- NEW FILE: VolumeFog.java --- /* VolumeDepthcue.java Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.shaders; import javax.vecmath.Color3f; import org.jrman.grid.FloatGrid; import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; public class VolumeFog extends VolumeShader { private final static Color3f OPAQUE = new Color3f(1f, 1f, 1f); private static FloatGrid fg1 = new FloatGrid(); protected void initDefaults() { float[][] distance = new float[1][]; distance[0] = new float[1]; distance[0][0] = 1f; Parameter param = new Parameter(new Declaration("distance", "uniform float"), distance); defaultParameters.put("distance", param); Color3f[][] background = new Color3f[1][]; background[0] = new Color3f[1]; background[0][0] = new Color3f(0f, 0f, 0f); param = new Parameter(new Declaration("background", "uniform color"), background); defaultParameters.put("background", param); } public void shade(ShaderVariables sv, float near, float far) { super.shade(sv, near, far); Parameter param = (Parameter) getParameter(sv, "distance"); float[][] f = (float[][]) param.getData(); final float distance = f[0][0]; param = (Parameter) getParameter(sv, "background"); Color3f[][] c = (Color3f[][]) param.getData(); final Color3f background = c[0][0]; fg1.length(sv.I); fg1.negate(fg1); fg1.div(fg1, distance); fg1.exp(fg1); fg1.sub(1f, fg1); sv.Ci.mix(sv.Ci, background, fg1); sv.Oi.mix(sv.Oi, OPAQUE, fg1); } } Index: SurfaceShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceShader.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SurfaceShader.java 21 May 2003 04:58:40 -0000 1.10 --- SurfaceShader.java 23 May 2003 06:47:01 -0000 1.11 *************** *** 72,77 **** else if (className.equals("SurfaceMatte")) result = new SurfaceMatte(); ! else if (className.equals("SurfaceMetal")) result = new SurfaceMetal(); else if (className.equals("SurfaceFakedlight")) result = new SurfaceFakedlight(); --- 72,79 ---- else if (className.equals("SurfaceMatte")) result = new SurfaceMatte(); ! else if (className.equals("SurfaceMetal") || className.equals("SurfaceShinymetal")) result = new SurfaceMetal(); + else if (className.equals("SurfacePlastic") || className.equals("SurfacePaintedplastic")) + result = new SurfacePlastic(); else if (className.equals("SurfaceFakedlight")) result = new SurfaceFakedlight(); *************** *** 81,85 **** } catch (Exception e) { System.out.println( ! "Unkown surface shader: " + name + ", replacing with fakedlight surface shader"); --- 83,87 ---- } catch (Exception e) { System.out.println( ! "Unknown surface shader: " + name + ", replacing with fakedlight surface shader"); Index: DisplacementShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/DisplacementShader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DisplacementShader.java 20 May 2003 01:08:38 -0000 1.4 --- DisplacementShader.java 23 May 2003 06:47:01 -0000 1.5 *************** *** 50,54 **** .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unkown displacement shader: " + name); } } --- 50,54 ---- .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown displacement shader: " + name); } } Index: LightShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/LightShader.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** LightShader.java 21 May 2003 04:58:40 -0000 1.8 --- LightShader.java 23 May 2003 06:47:01 -0000 1.9 *************** *** 67,71 **** .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unkown light shader: " + name); } } --- 67,71 ---- .newInstance(); } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown light shader: " + name); } } Index: VolumeShader.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/VolumeShader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VolumeShader.java 19 May 2003 08:15:28 -0000 1.4 --- VolumeShader.java 23 May 2003 06:47:01 -0000 1.5 *************** *** 23,26 **** --- 23,27 ---- import org.jrman.attributes.Attributes; + import org.jrman.render.ShaderVariables; public class VolumeShader extends Shader { *************** *** 30,34 **** Map parameters, Attributes attributes) { ! return null; // Just for now.... } --- 31,54 ---- Map parameters, Attributes attributes) { ! VolumeShader result; ! String className = ! "Volume" + name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase(); ! try { ! result = (VolumeShader) Class.forName(className).newInstance(); ! } catch (Exception e) { ! try { ! result = ! (VolumeShader) Class ! .forName("org.jrman.shaders." + className) ! .newInstance(); ! } catch (Exception e2) { ! throw new IllegalArgumentException("Unknown Volume shader: " + name); ! } ! } ! result.init(name, parameters, attributes); ! return result; ! } ! ! public void shade(ShaderVariables sv, float near, float far) { } |
From: <ma...@us...> - 2003-05-23 06:47:05
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv11999/sampleData Modified Files: shaderTest.rib uteapot.rib capsules.rib elephant.rib ManySpheres.rib Log Message: Added plastic surface shader. Added fog and depthcue volume shaders. Better error handling. Index: shaderTest.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/shaderTest.rib,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shaderTest.rib 22 May 2003 04:50:14 -0000 1.5 --- shaderTest.rib 23 May 2003 06:47:00 -0000 1.6 *************** *** 1,7 **** ! Format 800 600 1 Display "shaderTest" "framebufer" "rgb" Option "limits" "gridsize" 1024 PixelFilter "box" 1 1 ! PixelSamples 4 4 Exposure 1 2.5 Projection "perspective" "fov" 5.5 --- 1,7 ---- ! Format 400 300 1 Display "shaderTest" "framebufer" "rgb" Option "limits" "gridsize" 1024 PixelFilter "box" 1 1 ! PixelSamples 8 8 Exposure 1 2.5 Projection "perspective" "fov" 5.5 Index: uteapot.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/uteapot.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** uteapot.rib 23 May 2003 00:26:13 -0000 1.1 --- uteapot.rib 23 May 2003 06:47:00 -0000 1.2 *************** *** 11,15 **** #Display "uteapot.tiff" "file" "rgb" Display "teapot" "framebuffer" "rgb" ! Format 800 600 1.0 PixelSamples 4 4 PixelFilter "box" 1 1 --- 11,15 ---- #Display "uteapot.tiff" "file" "rgb" Display "teapot" "framebuffer" "rgb" ! Format 512 384 1.0 PixelSamples 4 4 PixelFilter "box" 1 1 *************** *** 38,43 **** Color [1 .5 .3] ! #Surface "plastic" "Ka" 0.1 "Kd" 0.05 "Ks" 1.0 "roughness" 0.1 "specularcolor" [1 .4 .1] ! Surface "metal" # xBodyBack --- 38,43 ---- Color [1 .5 .3] ! Surface "plastic" "Ka" 0.1 "Kd" 0.05 "Ks" 1.0 "roughness" 0.1 "specularcolor" [1 .4 .1] ! #Surface "metal" # xBodyBack Index: capsules.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/capsules.rib,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** capsules.rib 23 May 2003 00:26:13 -0000 1.6 --- capsules.rib 23 May 2003 06:47:00 -0000 1.7 *************** *** 1,7 **** #Option "limits" "bucketsize" [24 24] ! Format 800 600 1 PixelSamples 4 4 Exposure 1 2.5 ! Clipping 1 1000 Projection "perspective" "fov" 40 Translate 0 0 75 --- 1,7 ---- #Option "limits" "bucketsize" [24 24] ! Format 400 300 1 PixelSamples 4 4 Exposure 1 2.5 ! Clipping 20 150 Projection "perspective" "fov" 40 Translate 0 0 75 Index: elephant.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/elephant.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** elephant.rib 22 May 2003 22:17:43 -0000 1.1 --- elephant.rib 23 May 2003 06:47:00 -0000 1.2 *************** *** 1,5 **** ! Format 1000 750 1 PixelSamples 16 16 Exposure 1 2.5 Display "Elephant" "framebuffer" "rgb" PixelFilter "box" 1 1 --- 1,6 ---- ! Format 640 480 1 PixelSamples 16 16 Exposure 1 2.5 + Clipping 40 80 Display "Elephant" "framebuffer" "rgb" PixelFilter "box" 1 1 *************** *** 14,18 **** LightSource "spotlight" 3 "from" [4 8 2] "to" [0 0 0] "lightcolor" [0 0 1] "intensity" 75 ! # Floor AttributeBegin Color 1 1 1 --- 15,19 ---- LightSource "spotlight" 3 "from" [4 8 2] "to" [0 0 0] "lightcolor" [0 0 1] "intensity" 75 ! #Atmosphere "fog" "background" [1 1 1] "distance" 200 AttributeBegin Color 1 1 1 Index: ManySpheres.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/ManySpheres.rib,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ManySpheres.rib 22 May 2003 04:50:14 -0000 1.19 --- ManySpheres.rib 23 May 2003 06:47:00 -0000 1.20 *************** *** 1,5 **** ! Format 800 600 1 ! PixelSamples 4 4 Exposure 1 2.5 Display "ManySpheres.tif" "framebuffer" "rgb" #Display "ManySpheres.tif" "file" "rgb" --- 1,6 ---- ! Format 320 240 1 ! PixelSamples 8 8 Exposure 1 2.5 + Clipping 30 100 Display "ManySpheres.tif" "framebuffer" "rgb" #Display "ManySpheres.tif" "file" "rgb" *************** *** 21,24 **** --- 22,26 ---- LightSource "pointlight" 6 "from" [-6 7 6] "intensity" 300 "lightcolor" [1 1 0] LightSource "pointlight" 7 "from" [-6 7 -6] "intensity" 300 "lightcolor" [1 0 1] + #Atmosphere "depthcue" AttributeBegin Surface "metal" |
From: <ma...@us...> - 2003-05-23 00:26:17
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv6153/sampleData Modified Files: capsules.rib Added Files: uteapot.rib Log Message: Added utah teapot! --- NEW FILE: uteapot.rib --- # teapot.rib # Author: Stephen H. Westin, Ford Motor Company Corporate Design # <sw...@fo...> # Date: 9/5/95 # # This is the traditional Utah teapot from Martin Newell's breakfast table. # I got it from a demo directory for Apollo's 3D Graphics Metafile Resource # (GMR) on an Apollo DN10000. I translated it manually to RIB and set up # the view and light sources. #Display "uteapot.tiff" "file" "rgb" Display "teapot" "framebuffer" "rgb" Format 800 600 1.0 PixelSamples 4 4 PixelFilter "box" 1 1 # Correct for monitor gamma of 2.2 Exposure 1.0 2.2 Projection "perspective" "fov" 30 Translate 0 0 400 Rotate -115 1 0 0 Rotate 19 0 0 1 Translate -25 0 -50 WorldBegin LightSource "ambientlight" 1 "intensity" .4 "lightcolor" [.4 0 1] LightSource "distantlight" 2 "intensity" 1.0 "from" [-50 300 200] "to" [0 0 0] "lightcolor" [1 .8 .7] LightSource "distantlight" 2 "intensity" 0.2 "from" [-50 -300 200] "to" [0 0 0] LightSource "distantlight" 2 "intensity" 0.1 "from" [50 -200 10] "to" [0 0 0] "lightcolor" [.4 .3 1] Color [1 .5 .3] #Surface "plastic" "Ka" 0.1 "Kd" 0.05 "Ks" 1.0 "roughness" 0.1 "specularcolor" [1 .4 .1] Surface "metal" # xBodyBack AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ -80.0 0.0 30.0 -80.0 -44.8 30.0 -44.8 -80.0 30.0 0.0 -80.0 30.0 -80.0 0.0 12.0 -80.0 -44.8 12.0 -44.8 -80.0 12.0 0.0 -80.0 12.0 -60.0 0.0 3.0 -60.0 -33.6 3.0 -33.6 -60.0 3.0 0.0 -60.0 3.0 -60.0 0.0 0.0 -60.0 -33.6 0.0 -33.6 -60.0 0.0 0.0 -60.0 0.0 ] Patch "bicubic" "P" [ 0.0 -80.0 30.0 44.8 -80.0 30.0 80.0 -44.8 30.0 80.0 0.0 30.0 0.0 -80.0 12.0 44.8 -80.0 12.0 80.0 -44.8 12.0 80.0 0.0 12.0 0.0 -60.0 3.0 33.6 -60.0 3.0 60.0 -33.6 3.0 60.0 0.0 3.0 0.0 -60.0 0.0 33.6 -60.0 0.0 60.0 -33.6 0.0 60.0 0.0 0.0 ] Patch "bicubic" "P" [ -60.0 0.0 90.0 -60.0 -33.6 90.0 -33.6 -60.0 90.0 0.0 -60.0 90.0 -70.0 0.0 69.0 -70.0 -39.20 69.0 -39.20 -70.0 69.0 0.0 -70.0 69.0 -80.0 0.0 48.0 -80.0 -44.8 48.0 -44.8 -80.0 48.0 0.0 -80.0 48.0 -80.0 0.0 30.0 -80.0 -44.8 30.0 -44.8 -80.0 30.0 0.0 -80.0 30.0 ] Patch "bicubic" "P" [ 0.0 -60.0 90.0 33.6 -60.0 90.0 60.0 -33.6 90.0 60.0 0.0 90.0 0.0 -70.0 69.0 39.20 -70.0 69.0 70.0 -39.20 69.0 70.0 0.0 69.0 0.0 -80.0 48.0 44.8 -80.0 48.0 80.0 -44.8 48.0 80.0 0.0 48.0 0.0 -80.0 30.0 44.8 -80.0 30.0 80.0 -44.8 30.0 80.0 0.0 30.0 ] Patch "bicubic" "P" [ -56.0 0.0 90.0 -56.0 -31.36 90.0 -31.36 -56.0 90.0 0.0 -56.0 90.0 -53.5 0.0 95.25 -53.5 -29.96 95.25 -29.96 -53.5 95.25 0.0 -53.5 95.25 -57.5 0.0 95.25 -57.5 -32.20 95.25 -32.20 -57.5 95.25 0.0 -57.5 95.25 -60.0 0.0 90.0 -60.0 -33.6 90.0 -33.6 -60.0 90.0 0.0 -60.0 90.0 ] Patch "bicubic" "P" [ 0.0 -56.0 90.0 31.36 -56.0 90.0 56.0 -31.36 90.0 56.0 0.0 90.0 0.0 -53.5 95.25 29.96 -53.5 95.25 53.5 -29.96 95.25 53.5 0.0 95.25 0.0 -57.5 95.25 32.20 -57.5 95.25 57.5 -32.20 95.25 57.5 0.0 95.25 0.0 -60.0 90.0 33.6 -60.0 90.0 60.0 -33.6 90.0 60.0 0.0 90.0 ] AttributeEnd # xBody_Front AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 80.0 0.0 30.0 80.0 44.80 30.0 44.80 80.0 30.0 0.0 80.0 30.0 80.0 0.0 12.0 80.0 44.80 12.0 44.80 80.0 12.0 0.0 80.0 12.0 60.0 0.0 3.0 60.0 33.60 3.0 33.60 60.0 3.0 0.0 60.0 3.0 60.0 0.0 0.0 60.0 33.60 0.0 33.60 60.0 0.0 0.0 60.0 0.0 ] Patch "bicubic" "P" [ 0.0 80.0 30.0 -44.80 80.0 30.0 -80.0 44.80 30.0 -80.0 0.0 30.0 0.0 80.0 12.0 -44.80 80.0 12.0 -80.0 44.80 12.0 -80.0 0.0 12.0 0.0 60.0 3.0 -33.60 60.0 3.0 -60.0 33.60 3.0 -60.0 0.0 3.0 0.0 60.0 0.0 -33.60 60.0 0.0 -60.0 33.60 0.0 -60.0 0.0 0.0 ] Patch "bicubic" "P" [ 60.0 0.0 90.0 60.0 33.60 90.0 33.60 60.0 90.0 0.0 60.0 90.0 70.0 0.0 69.0 70.0 39.20 69.0 39.20 70.0 69.0 0.0 70.0 69.0 80.0 0.0 48.0 80.0 44.80 48.0 44.80 80.0 48.0 0.0 80.0 48.0 80.0 0.0 30.0 80.0 44.80 30.0 44.80 80.0 30.0 0.0 80.0 30.0 ] Patch "bicubic" "P" [ 0.0 60.0 90.0 -33.60 60.0 90.0 -60.0 33.60 90.0 -60.0 0.0 90.0 0.0 70.0 69.0 -39.20 70.0 69.0 -70.0 39.20 69.0 -70.0 0.0 69.0 0.0 80.0 48.0 -44.80 80.0 48.0 -80.0 44.80 48.0 -80.0 0.0 48.0 0.0 80.0 30.0 -44.80 80.0 30.0 -80.0 44.80 30.0 -80.0 0.0 30.0 ] Patch "bicubic" "P" [ 56.0 0.0 90.0 56.0 31.36 90.0 31.36 56.0 90.0 0.0 56.0 90.0 53.50 0.0 95.25 53.50 29.96 95.25 29.96 53.50 95.25 0.0 53.50 95.25 57.50 0.0 95.25 57.50 32.20 95.25 32.20 57.50 95.25 0.0 57.50 95.25 60.0 0.0 90.0 60.0 33.60 90.0 33.60 60.0 90.0 0.0 60.0 90.0 ] Patch "bicubic" "P" [ 0.0 56.0 90.0 -31.36 56.0 90.0 -56.0 31.36 90.0 -56.0 0.0 90.0 0.0 53.50 95.25 -29.96 53.50 95.25 -53.50 29.96 95.25 -53.50 0.0 95.25 0.0 57.50 95.25 -32.20 57.50 95.25 -57.50 32.20 95.25 -57.50 0.0 95.25 0.0 60.0 90.0 -33.60 60.0 90.0 -60.0 33.60 90.0 -60.0 0.0 90.0 ] AttributeEnd # Spout AttributeBegin Basis "bezier" 3 "bezier" 3 Sides 2 Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 68.0 0.0 51.0 68.0 26.40 51.0 68.0 26.40 18.0 68.0 0.0 18.0 104.0 0.0 51.0 104.0 26.40 51.0 124.0 26.40 27.0 124.0 0.0 27.0 92.0 0.0 78.0 92.0 10.0 78.0 96.0 10.0 75.0 96.0 0.0 75.0 108.0 0.0 90.0 108.0 10.0 90.0 132.0 10.0 90.0 132.0 0.0 90.0 ] Patch "bicubic" "P" [ 68.0 0.0 18.0 68.0 -26.40 18.0 68.0 -26.40 51.0 68.0 0.0 51.0 124.0 0.0 27.0 124.0 -26.40 27.0 104.0 -26.40 51.0 104.0 0.0 51.0 96.0 0.0 75.0 96.0 -10.0 75.0 92.0 -10.0 78.0 92.0 0.0 78.0 132.0 0.0 90.0 132.0 -10.0 90.0 108.0 -10.0 90.0 108.0 0.0 90.0 ] Patch "bicubic" "P" [ 108.0 0.0 90.0 108.0 10.0 90.0 132.0 10.0 90.0 132.0 0.0 90.0 112.0 0.0 93.0 112.0 10.0 93.0 141.0 10.0 93.75 141.0 0.0 93.75 116.0 0.0 93.0 116.0 6.0 93.0 138.0 6.0 94.50 138.0 0.0 94.50 112.0 0.0 90.0 112.0 6.0 90.0 128.0 6.0 90.0 128.0 0.0 90.0 ] Patch "bicubic" "P" [ 132.0 0.0 90.0 132.0 -10.0 90.0 108.0 -10.0 90.0 108.0 0.0 90.0 141.0 0.0 93.75 141.0 -10.0 93.75 112.0 -10.0 93.0 112.0 0.0 93.0 138.0 0.0 94.50 138.0 -6.0 94.50 116.0 -6.0 93.0 116.0 0.0 93.0 128.0 0.0 90.0 128.0 -6.0 90.0 112.0 -6.0 90.0 112.0 0.0 90.0 ] AttributeEnd # Handle AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ -64.0 0.0 75.0 -64.0 12.0 75.0 -60.0 12.0 84.0 -60.0 0.0 84.0 -92.0 0.0 75.0 -92.0 12.0 75.0 -100.0 12.0 84.0 -100.0 0.0 84.0 -108.0 0.0 75.0 -108.0 12.0 75.0 -120.0 12.0 84.0 -120.0 0.0 84.0 -108.0 0.0 66.0 -108.0 12.0 66.0 -120.0 12.0 66.0 -120.0 0.0 66.0 ] Patch "bicubic" "P" [ -60.0 0.0 84.0 -60.0 -12.0 84.0 -64.0 -12.0 75.0 -64.0 0.0 75.0 -100.0 0.0 84.0 -100.0 -12.0 84.0 -92.0 -12.0 75.0 -92.0 0.0 75.0 -120.0 0.0 84.0 -120.0 -12.0 84.0 -108.0 -12.0 75.0 -108.0 0.0 75.0 -120.0 0.0 66.0 -120.0 -12.0 66.0 -108.0 -12.0 66.0 -108.0 0.0 66.0 ] Patch "bicubic" "P" [ -108.0 0.0 66.0 -108.0 12.0 66.0 -120.0 12.0 66.0 -120.0 0.0 66.0 -108.0 0.0 57.0 -108.0 12.0 57.0 -120.0 12.0 48.0 -120.0 0.0 48.0 -100.0 0.0 39.0 -100.0 12.0 39.0 -106.0 12.0 31.50 -106.0 0.0 31.50 -80.0 0.0 30.0 -80.0 12.0 30.0 -76.0 12.0 18.0 -76.0 0.0 18.0 ] Patch "bicubic" "P" [ -120.0 0.0 66.0 -120.0 -12.0 66.0 -108.0 -12.0 66.0 -108.0 0.0 66.0 -120.0 0.0 48.0 -120.0 -12.0 48.0 -108.0 -12.0 57.0 -108.0 0.0 57.0 -106.0 0.0 31.50 -106.0 -12.0 31.50 -100.0 -12.0 39.0 -100.0 0.0 39.0 -76.0 0.0 18.0 -76.0 -12.0 18.0 -80.0 -12.0 30.0 -80.0 0.0 30.0 ] AttributeEnd # Lid AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 8.0 0.0 102.0 8.0 4.48 102.0 4.48 8.0 102.0 0.0 8.0 102.0 16.0 0.0 96.0 16.0 8.96 96.0 8.96 16.0 96.0 0.0 16.0 96.0 52.0 0.0 96.0 52.0 29.12 96.0 29.12 52.0 96.0 0.0 52.0 96.0 52.0 0.0 90.0 52.0 29.12 90.0 29.12 52.0 90.0 0.0 52.0 90.0 ] Patch "bicubic" "P" [ 0.0 8.0 102.0 -4.48 8.0 102.0 -8.0 4.48 102.0 -8.0 0.0 102.0 0.0 16.0 96.0 -8.96 16.0 96.0 -16.0 8.96 96.0 -16.0 0.0 96.0 0.0 52.0 96.0 -29.12 52.0 96.0 -52.0 29.12 96.0 -52.0 0.0 96.0 0.0 52.0 90.0 -29.12 52.0 90.0 -52.0 29.12 90.0 -52.0 0.0 90.0 ] Patch "bicubic" "P" [ -8.0 0.0 102.0 -8.0 -4.48 102.0 -4.48 -8.0 102.0 0.0 -8.0 102.0 -16.0 0.0 96.0 -16.0 -8.96 96.0 -8.96 -16.0 96.0 0.0 -16.0 96.0 -52.0 0.0 96.0 -52.0 -29.12 96.0 -29.12 -52.0 96.0 0.0 -52.0 96.0 -52.0 0.0 90.0 -52.0 -29.12 90.0 -29.12 -52.0 90.0 0.0 -52.0 90.0 ] Patch "bicubic" "P" [ 0.0 -8.0 102.0 4.48 -8.0 102.0 8.0 -4.48 102.0 8.0 0.0 102.0 0.0 -16.0 96.0 8.96 -16.0 96.0 16.0 -8.96 96.0 16.0 0.0 96.0 0.0 -52.0 96.0 29.12 -52.0 96.0 52.0 -29.12 96.0 52.0 0.0 96.0 0.0 -52.0 90.0 29.12 -52.0 90.0 52.0 -29.12 90.0 52.0 0.0 90.0 ] AttributeEnd # Knob AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 32.0 0.0 120.0 32.0 18.0 120.0 18.0 32.0 120.0 0.0 32.0 120.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 8.0 0.0 102.0 8.0 4.48 102.0 4.48 8.0 102.0 0.0 8.0 102.0 ] Patch "bicubic" "P" [ 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 32.0 120.0 -18.0 32.0 120.0 -32.0 18.0 120.0 -32.0 0.0 120.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 8.0 102.0 -4.48 8.0 102.0 -8.0 4.48 102.0 -8.0 0.0 102.0 ] Patch "bicubic" "P" [ 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 -32.0 0.0 120.0 -32.0 -18.0 120.0 -18.0 -32.0 120.0 0.0 -32.0 120.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 -8.0 0.0 102.0 -8.0 -4.48 102.0 -4.48 -8.0 102.0 0.0 -8.0 102.0 ] Patch "bicubic" "P" [ 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 0.0 120.0 0.0 -32.0 120.0 18.0 -32.0 120.0 32.0 -18.0 120.0 32.0 0.0 120.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 0.0 108.0 0.0 -8.0 102.0 4.48 -8.0 102.0 8.0 -4.48 102.0 8.0 0.0 102.0 ] AttributeEnd # Lip AttributeBegin Basis "bezier" 3 "bezier" 3 Patch "bicubic" "P" [ 50.0 0.0 90.0 50.0 28.0 90.0 28.0 50.0 90.0 0.0 50.0 90.0 52.0 0.0 90.0 52.0 29.12 90.0 29.12 52.0 90.0 0.0 52.0 90.0 54.0 0.0 90.0 54.0 30.24 90.0 30.24 54.0 90.0 0.0 54.0 90.0 56.0 0.0 90.0 56.0 31.36 90.0 31.36 56.0 90.0 0.0 56.0 90.0 ] Patch "bicubic" "P" [ 0.0 50.0 90.0 -28.0 50.0 90.0 -50.0 28.0 90.0 -50.0 0.0 90.0 0.0 52.0 90.0 -29.12 52.0 90.0 -52.0 29.12 90.0 -52.0 0.0 90.0 0.0 54.0 90.0 -30.24 54.0 90.0 -54.0 30.24 90.0 -54.0 0.0 90.0 0.0 56.0 90.0 -31.36 56.0 90.0 -56.0 31.36 90.0 -56.0 0.0 90.0 ] Patch "bicubic" "P" [ -50.0 0.0 90.0 -50.0 -28.0 90.0 -28.0 -50.0 90.0 0.0 -50.0 90.0 -52.0 0.0 90.0 -52.0 -29.12 90.0 -29.12 -52.0 90.0 0.0 -52.0 90.0 -54.0 0.0 90.0 -54.0 -30.24 90.0 -30.24 -54.0 90.0 0.0 -54.0 90.0 -56.0 0.0 90.0 -56.0 -31.36 90.0 -31.36 -56.0 90.0 0.0 -56.0 90.0 ] Patch "bicubic" "P" [ 0.0 -50.0 90.0 28.0 -50.0 90.0 50.0 -28.0 90.0 50.0 0.0 90.0 0.0 -52.0 90.0 29.12 -52.0 90.0 52.0 -29.12 90.0 52.0 0.0 90.0 0.0 -54.0 90.0 30.24 -54.0 90.0 54.0 -30.24 90.0 54.0 0.0 90.0 0.0 -56.0 90.0 31.36 -56.0 90.0 56.0 -31.36 90.0 56.0 0.0 90.0 ] AttributeEnd WorldEnd Index: capsules.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/capsules.rib,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** capsules.rib 21 May 2003 06:04:31 -0000 1.5 --- capsules.rib 23 May 2003 00:26:13 -0000 1.6 *************** *** 1,4 **** #Option "limits" "bucketsize" [24 24] ! Format 400 300 1 PixelSamples 4 4 Exposure 1 2.5 --- 1,4 ---- #Option "limits" "bucketsize" [24 24] ! Format 800 600 1 PixelSamples 4 4 Exposure 1 2.5 *************** *** 13,15 **** ShadingRate 1 ReadArchive "capsulesData.rib" ! WorldEnd \ No newline at end of file --- 13,15 ---- ShadingRate 1 ReadArchive "capsulesData.rib" ! WorldEnd |
From: <ma...@us...> - 2003-05-22 22:17:47
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv27640/sampleData Modified Files: torus.rib unit.rib gumbo.rib Added Files: bezier.rib elephant.rib Log Message: Fixed bezier patches. --- NEW FILE: bezier.rib --- Format 480 360 1 PixelSamples 4 4 Exposure 1 2.5 Option "limits" "gridsize" 16384 Projection "perspective" "fov" 10 Surface "fakedlight" Translate 0 0 40 WorldBegin LightSource "distantlight" 1 "from" [0 1 0] "to" [0 0 0] "intensity" .7 LightSource "ambientlight" 2 "intensity" .2 Lightsource "spotlight" 3 "from" [0 6.5 0] "to" [0 0 0] "intensity" 30 LightSource "pointlight" 4 "from" [0 7.5 0] "intensity" 10 Illuminate 1 0 Illuminate 4 0 ShadingRate 1 AttributeBegin Color 1 1 1 Rotate -30 0 1 0 Rotate -90 1 0 0 #Rotate 45 0 1 0 Translate -1.5 -1.5 0 Scale .2 .2 .2 ReadArchive "gumbo.rib" Opacity .1 .1 .1 Patch "bicubic" "P" [ 0 0 0 1 0 0 2 0 0 3 0 0 0 1 0 1 1 0 2 1 0 3 1 0 0 2 0 1 2 0 2 2 0 3 2 0 0 3 0 1 3 0 2 3 0 3 3 0 ]"Cs" [1 0 0 0 1 0 0 0 1 1 1 0] Color 1 0 0 #Patch "bilinear" "P" [0 0 1 0 3 1 3 0 1 3 3 1] AttributeEnd WorldEnd --- NEW FILE: elephant.rib --- Format 1000 750 1 PixelSamples 16 16 Exposure 1 2.5 Display "Elephant" "framebuffer" "rgb" PixelFilter "box" 1 1 Projection "perspective" "fov" 10 Translate 0 0 60 Rotate -30 1 0 0 WorldBegin LightSource "spotlight" 1 "from" [0 8 -5] "to" [0 0 0] "lightcolor" [1 0 0] "intensity" 75 LightSource "spotlight" 2 "from" [-4 8 2] "to" [0 0 0] "lightcolor" [0 1 0] "intensity" 75 LightSource "spotlight" 3 "from" [4 8 2] "to" [0 0 0] "lightcolor" [0 0 1] "intensity" 75 # Floor AttributeBegin Color 1 1 1 Surface "matte" #Patch "bilinear" "P" [-50 0 -50 50 0 -50 -50 0 50 50 0 50] Rotate -90 1 0 0 Disk 0 50 360 AttributeEnd AttributeBegin Displacement "bumptest" Surface "metal" Color .3 .3 .3 Translate 0 0 -4 Rotate -120 0 1 0 Rotate -90 1 0 0 Scale .2 .2 .2 ReadArchive "gumbo.rib" AttributeEnd WorldEnd Index: torus.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/torus.rib,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** torus.rib 22 May 2003 07:36:25 -0000 1.9 --- torus.rib 22 May 2003 22:17:43 -0000 1.10 *************** *** 1,3 **** ! Format 480 360 1 PixelSamples 4 4 Exposure 1 2.5 --- 1,4 ---- ! Format 1000 750 1 ! #Option "limits" "gridsize" 1024 PixelSamples 4 4 Exposure 1 2.5 *************** *** 58,65 **** AttributeEnd AttributeBegin Scale .3 .3 .3 ! Rotate -30 0 1 0 Rotate -90 1 0 0 ! Color .6 .6 .6 ReadArchive "gumbo.rib" AttributeEnd --- 59,68 ---- AttributeEnd AttributeBegin + Translate -5.5 -9 -3 Scale .3 .3 .3 ! Rotate -120 0 1 0 Rotate -90 1 0 0 ! Color .2 .2 .2 ! Surface "matte" ReadArchive "gumbo.rib" AttributeEnd *************** *** 69,72 **** --- 72,76 ---- Color 1 .2 .2 Surface "metal" + Translate 3 0 0 Cylinder 2 -2 2 360 AttributeEnd *************** *** 82,86 **** AttributeEnd AttributeBegin ! Translate 0 -2 0 Rotate 90 1 0 0 Color .2 .2 1 --- 86,90 ---- AttributeEnd AttributeBegin ! Translate 3 -2 0 Rotate 90 1 0 0 Color .2 .2 1 Index: unit.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/unit.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** unit.rib 18 May 2003 20:10:51 -0000 1.4 --- unit.rib 22 May 2003 22:17:43 -0000 1.5 *************** *** 1,2 **** ! #ReadArchive "torusSphereUnit.rib" ! ObjectInstance 1 --- 1,2 ---- ! ReadArchive "torusSphereUnit.rib" ! #ObjectInstance 1 Index: gumbo.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/gumbo.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gumbo.rib 8 Apr 2003 20:02:30 -0000 1.1 --- gumbo.rib 22 May 2003 22:17:43 -0000 1.2 *************** *** 124,128 **** AttributeBegin Color [0.75 .75 .75] ! Surface "plastic" TransformBegin Translate 7.29999 3.5 10 --- 124,129 ---- AttributeBegin Color [0.75 .75 .75] ! #Surface "plastic" ! Surface "matte" TransformBegin Translate 7.29999 3.5 10 |
From: <ma...@us...> - 2003-05-22 22:17:47
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv27640/src/org/jrman/primitive Modified Files: BicubicPatch.java Log Message: Fixed bezier patches. Index: BicubicPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/BicubicPatch.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BicubicPatch.java 22 May 2003 07:36:26 -0000 1.1 --- BicubicPatch.java 22 May 2003 22:17:44 -0000 1.2 *************** *** 150,153 **** --- 150,155 ---- float uv11) { Map result = linearInterpolateParameters(uv00, uv10, uv01, uv11); + result.remove("u"); + result.remove("v"); extractPoints(); Point3f[][] p = new Point3f[16][]; |
From: <ma...@us...> - 2003-05-22 07:36:30
|
Update of /cvsroot/jrman/drafts/src/org/jrman/util In directory sc8-pr-cvs1:/tmp/cvs-serv23650/src/org/jrman/util Modified Files: Calc.java Log Message: Started work on bicubic patches. Index: Calc.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/util/Calc.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Calc.java 3 May 2003 18:02:48 -0000 1.7 --- Calc.java 22 May 2003 07:36:27 -0000 1.8 *************** *** 33,45 **** private Calc() { } ! public static int clamp(int v, int min, int max) { return Math.min(Math.max(v, min), max); } ! public static float log(float x, float base) { return (float) (Math.log(x) / Math.log(base)); } ! public static float sign(float x) { if (x < 0) --- 33,45 ---- private Calc() { } ! public static int clamp(int v, int min, int max) { return Math.min(Math.max(v, min), max); } ! public static float log(float x, float base) { return (float) (Math.log(x) / Math.log(base)); } ! public static float sign(float x) { if (x < 0) *************** *** 49,53 **** return 0f; } ! public static float step(float min, float value) { if (value < min) --- 49,53 ---- return 0f; } ! public static float step(float min, float value) { if (value < min) *************** *** 55,59 **** return 1f; } ! public static float smoothstep(float min, float max, float value) { if (value < min) --- 55,59 ---- return 1f; } ! public static float smoothstep(float min, float max, float value) { if (value < min) *************** *** 61,82 **** if (value >= max) return 1f; ! value = ( value - min) / (max - min); return value * value * (3 - 2 * value); } ! public static float clamp(float v, float min, float max) { return Math.min(Math.max(v, min), max); } ! ! public static float depth(Point3f p, Transform toCamera, float near, float far, Point3f tmp) { ! toCamera.transformPoint(p, tmp); ! return (tmp.z - near) / (far - near); } ! public static float depth(Point3f p, Transform toCamera, float near, float far) { Point3f tmp = new Point3f(); return depth(p, toCamera, near, far, tmp); } ! public static void perp(Tuple2f t, Tuple2f out) { out.set(-t.y, t.x); --- 61,87 ---- if (value >= max) return 1f; ! value = (value - min) / (max - min); return value * value * (3 - 2 * value); } ! public static float clamp(float v, float min, float max) { return Math.min(Math.max(v, min), max); } ! ! public static float depth( ! Point3f p, ! Transform toCamera, ! float near, ! float far, ! Point3f tmp) { ! toCamera.transformPoint(p, tmp); ! return (tmp.z - near) / (far - near); } ! public static float depth(Point3f p, Transform toCamera, float near, float far) { Point3f tmp = new Point3f(); return depth(p, toCamera, near, far, tmp); } ! public static void perp(Tuple2f t, Tuple2f out) { out.set(-t.y, t.x); *************** *** 208,212 **** alphaV); } ! public static float fovToFocalLength(float fov) { return (float) (1 / Math.tan(Math.toRadians(fov / 2))); --- 213,292 ---- alphaV); } ! ! public static float bezierInterpolate(float p1, float p2, float p3, float p4, float u) { ! float oneMinusU = 1f - u; ! return oneMinusU * oneMinusU * oneMinusU * p1 ! + 3f * u * oneMinusU * oneMinusU * p2 ! + 3f * u * u * oneMinusU * p3 ! + u * u * u * p4; ! } ! ! public static float bezierInterpolate( ! float p00, ! float p10, ! float p20, ! float p30, ! float p01, ! float p11, ! float p21, ! float p31, ! float p02, ! float p12, ! float p22, ! float p32, ! float p03, ! float p13, ! float p23, ! float p33, ! float u, ! float v) { ! return bezierInterpolate( ! bezierInterpolate(p00, p10, p20, p30, u), ! bezierInterpolate(p01, p11, p21, p31, u), ! bezierInterpolate(p02, p12, p22, p32, u), ! bezierInterpolate(p03, p13, p23, p33, u), ! v); ! } ! ! public static Point3f bezierInterpolate( ! Point3f p1, ! Point3f p2, ! Point3f p3, ! Point3f p4, ! float u) { ! Point3f result = new Point3f(); ! result.x = bezierInterpolate(p1.x, p2.x, p3.x, p4.x, u); ! result.y = bezierInterpolate(p1.y, p2.y, p3.y, p4.y, u); ! result.z = bezierInterpolate(p1.z, p2.z, p3.z, p4.z, u); ! return result; ! } ! ! public static Point3f bezierInterpolate( ! Point3f p00, ! Point3f p10, ! Point3f p20, ! Point3f p30, ! Point3f p01, ! Point3f p11, ! Point3f p21, ! Point3f p31, ! Point3f p02, ! Point3f p12, ! Point3f p22, ! Point3f p32, ! Point3f p03, ! Point3f p13, ! Point3f p23, ! Point3f p33, ! float u, ! float v) { ! return bezierInterpolate( ! bezierInterpolate(p00, p10, p20, p30, u), ! bezierInterpolate(p01, p11, p21, p31, u), ! bezierInterpolate(p02, p12, p22, p32, u), ! bezierInterpolate(p03, p13, p23, p33, u), ! v); ! } ! public static float fovToFocalLength(float fov) { return (float) (1 / Math.tan(Math.toRadians(fov / 2))); |
From: <ma...@us...> - 2003-05-22 07:36:29
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv23650/src/org/jrman/parser Modified Files: Parser.java Log Message: Started work on bicubic patches. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Parser.java 22 May 2003 04:50:14 -0000 1.46 --- Parser.java 22 May 2003 07:36:26 -0000 1.47 *************** *** 57,60 **** --- 57,61 ---- import org.jrman.options.Quantizer; import org.jrman.parser.keywords.KeywordParser; + import org.jrman.primitive.BicubicPatch; import org.jrman.primitive.BilinearPatch; import org.jrman.primitive.Cone; *************** *** 889,950 **** } ! public void addPoints(final Map parameters) { ! if (inAreaLightSource) ! return; ! Parameter pParam = (Parameter) parameters.get("P"); ! parameters.remove("P"); ! Parameter widthParam = (Parameter) parameters.get("width"); ! parameters.remove("width"); ! Parameter constantWidthParam = (Parameter) parameters.get("constantwidth"); ! parameters.remove("constantwidth"); ! Parameter csParam = (Parameter) parameters.get("Cs"); ! parameters.remove("Cs"); ! Parameter osParam = (Parameter) parameters.get("Os"); ! parameters.remove("Os"); ! Point3f[][] points = (Point3f[][]) pParam.getData(); ! float[][] widths; ! if (widthParam != null) ! widths = (float[][]) widthParam.getData(); ! else ! widths = (float[][]) constantWidthParam.getData(); ! Color3f[][] Cs = null; ! Declaration CsDecl = null; ! if (csParam != null) { ! Cs = (Color3f[][]) csParam.getData(); ! CsDecl = csParam.getDeclaration(); ! } ! Color3f[][] Os = null; ! Declaration OsDecl = null; ! if (osParam != null) { ! Os = (Color3f[][]) osParam.getData(); ! OsDecl = osParam.getDeclaration(); ! } ! for (int i = 0; i < points.length; i++) { ! final Point3f p = points[i][0]; ! float tw; ! if (widthParam != null) ! tw = widths[i][0]; ! else ! tw = widths[0][0]; ! final float w = tw; ! Map tparam; ! if (Cs == null && Os == null) ! tparam = parameters; ! else { ! tparam = new HashMap(parameters); ! if (Cs != null) { ! Color3f[][] cs = new Color3f[1][]; ! cs[0] = Cs[i]; ! tparam.put("Cs", new Parameter(CsDecl, cs)); ! } ! if (Os != null) { ! Color3f[][] os = new Color3f[1][]; ! os[0] = Os[i]; ! tparam.put("Os", new Parameter(OsDecl, os)); ! } ! } ! final Map param = tparam; if (!inObject) ! renderer.addPrimitive(new Point(w, p.x, p.y, p.z, param, getAttributes())); else { final Transform transform = currentAttributes.getTransform(); --- 890,898 ---- } ! public void addBicubicPatch(final Map parameters) { ! if (inAreaLightSource) ! return; if (!inObject) ! renderer.addPrimitive(new BicubicPatch(parameters, getAttributes())); else { final Transform transform = currentAttributes.getTransform(); *************** *** 952,961 **** .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { public Primitive create(Attributes attributes) { ! return new Point( ! w, ! p.x, ! p.y, ! p.z, ! param, createAttributes(transform, attributes)); } --- 900,905 ---- .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { public Primitive create(Attributes attributes) { ! return new BicubicPatch( ! parameters, createAttributes(transform, attributes)); } *************** *** 963,966 **** } } ! } } --- 907,985 ---- } } ! ! public void addPoints(final Map parameters) { ! if (inAreaLightSource) ! return; ! Parameter pParam = (Parameter) parameters.get("P"); ! parameters.remove("P"); ! Parameter widthParam = (Parameter) parameters.get("width"); ! parameters.remove("width"); ! Parameter constantWidthParam = (Parameter) parameters.get("constantwidth"); ! parameters.remove("constantwidth"); ! Parameter csParam = (Parameter) parameters.get("Cs"); ! parameters.remove("Cs"); ! Parameter osParam = (Parameter) parameters.get("Os"); ! parameters.remove("Os"); ! Point3f[][] points = (Point3f[][]) pParam.getData(); ! float[][] widths; ! if (widthParam != null) ! widths = (float[][]) widthParam.getData(); ! else ! widths = (float[][]) constantWidthParam.getData(); ! Color3f[][] Cs = null; ! Declaration CsDecl = null; ! if (csParam != null) { ! Cs = (Color3f[][]) csParam.getData(); ! CsDecl = csParam.getDeclaration(); ! } ! Color3f[][] Os = null; ! Declaration OsDecl = null; ! if (osParam != null) { ! Os = (Color3f[][]) osParam.getData(); ! OsDecl = osParam.getDeclaration(); ! } ! for (int i = 0; i < points.length; i++) { ! final Point3f p = points[i][0]; ! float tw; ! if (widthParam != null) ! tw = widths[i][0]; ! else ! tw = widths[0][0]; ! final float w = tw; ! Map tparam; ! if (Cs == null && Os == null) ! tparam = parameters; ! else { ! tparam = new HashMap(parameters); ! if (Cs != null) { ! Color3f[][] cs = new Color3f[1][]; ! cs[0] = Cs[i]; ! tparam.put("Cs", new Parameter(CsDecl, cs)); ! } ! if (Os != null) { ! Color3f[][] os = new Color3f[1][]; ! os[0] = Os[i]; ! tparam.put("Os", new Parameter(OsDecl, os)); ! } ! } ! final Map param = tparam; ! if (!inObject) ! renderer.addPrimitive(new Point(w, p.x, p.y, p.z, param, getAttributes())); ! else { ! final Transform transform = currentAttributes.getTransform(); ! currentObjectInstanceList ! .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { ! public Primitive create(Attributes attributes) { ! return new Point( ! w, ! p.x, ! p.y, ! p.z, ! param, ! createAttributes(transform, attributes)); ! } ! }); ! } ! } ! } } |
From: <ma...@us...> - 2003-05-22 07:36:29
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv23650/src/org/jrman/parser/keywords Modified Files: KeywordPatch.java Log Message: Started work on bicubic patches. Index: KeywordPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPatch.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KeywordPatch.java 22 May 2003 04:50:14 -0000 1.3 --- KeywordPatch.java 22 May 2003 07:36:26 -0000 1.4 *************** *** 32,37 **** // Expect parameter list Map parameters = parseParameterList(st); ! if (type.equals("bilinear")) parser.addBilinearPatch(parameters); } --- 32,41 ---- // Expect parameter list Map parameters = parseParameterList(st); ! if (type.equals("bilinear")) parser.addBilinearPatch(parameters); + else if (type.equals("bicubic")) + parser.addBicubicPatch(parameters); + else + throw new IllegalArgumentException("Unkown patch type: " + type); } |
From: <ma...@us...> - 2003-05-22 07:36:29
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv23650/src/org/jrman/primitive Modified Files: Primitive.java Added Files: BicubicPatch.java Log Message: Started work on bicubic patches. --- NEW FILE: BicubicPatch.java --- /* BilinearPatch.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.ConvexHull3f; import org.jrman.grid.Grid; import org.jrman.parser.Declaration; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; import org.jrman.util.Calc; public class BicubicPatch extends Primitive { private static Point3f P00; private static Point3f P10; private static Point3f P20; private static Point3f P30; private static Point3f P01; private static Point3f P11; private static Point3f P21; private static Point3f P31; private static Point3f P02; private static Point3f P12; private static Point3f P22; private static Point3f P32; private static Point3f P03; private static Point3f P13; private static Point3f P23; private static Point3f P33; private static Vector3f vtmp = new Vector3f(); public BicubicPatch(Map parameters, Attributes attributes) { super(parameters, attributes); } private void extractPoints() { Parameter param = (Parameter) parameters.get("P"); Point3f[][] P = (Point3f[][]) param.getData(); P00 = P[0][0]; P10 = P[1][0]; P20 = P[2][0]; P30 = P[3][0]; P01 = P[4][0]; P11 = P[5][0]; P21 = P[6][0]; P31 = P[7][0]; P02 = P[8][0]; P12 = P[9][0]; P22 = P[10][0]; P32 = P[11][0]; P03 = P[12][0]; P13 = P[13][0]; P23 = P[14][0]; P33 = P[15][0]; } public BoundingVolume getBoundingVolume() { ConvexHull3f ch = new ConvexHull3f(); extractPoints(); ch.addPoint(P00); ch.addPoint(P10); ch.addPoint(P20); ch.addPoint(P30); ch.addPoint(P01); ch.addPoint(P11); ch.addPoint(P21); ch.addPoint(P31); ch.addPoint(P02); ch.addPoint(P12); ch.addPoint(P22); ch.addPoint(P32); ch.addPoint(P03); ch.addPoint(P13); ch.addPoint(P23); ch.addPoint(P33); return ch; } public Primitive[] split() { Primitive[] result = new Primitive[2]; extractPoints(); vtmp.sub(P30, P00); float l1 = vtmp.length(); vtmp.sub(P33, P03); float l2 = vtmp.length(); float ul = (l1 + l2) / 2f; vtmp.sub(P03, P00); l1 = vtmp.length(); vtmp.sub(P33, P30); l2 = vtmp.length(); float vl = (l1 + l2) / 2f; if (ul > vl) { result[0] = new BicubicPatch(bezierInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = new BicubicPatch(bezierInterpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { result[0] = new BicubicPatch(bezierInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = new BicubicPatch(bezierInterpolateParameters(0f, 1f, .5f, 1f), attributes); } return result; } protected Map bezierInterpolateParameters( float uv00, float uv10, float uv01, float uv11) { Map result = linearInterpolateParameters(uv00, uv10, uv01, uv11); extractPoints(); Point3f[][] p = new Point3f[16][]; for (int i = 0; i < 16; i++) { p[i] = new Point3f[1]; p[i][0] = new Point3f(); } Point3f PS00 = p[0][0]; Point3f PS10 = p[1][0]; Point3f PS20 = p[2][0]; Point3f PS30 = p[3][0]; Point3f PS01 = p[4][0]; Point3f PS11 = p[5][0]; Point3f PS21 = p[6][0]; Point3f PS31 = p[7][0]; Point3f PS02 = p[8][0]; Point3f PS12 = p[9][0]; Point3f PS22 = p[10][0]; Point3f PS32 = p[11][0]; Point3f PS03 = p[12][0]; Point3f PS13 = p[13][0]; Point3f PS23 = p[14][0]; Point3f PS33 = p[15][0]; if (uv00 == .5f) { splitUpper(P00, P10, P20, P30, PS00, PS10, PS20, PS30); splitUpper(P01, P11, P21, P31, PS01, PS11, PS21, PS31); splitUpper(P02, P12, P22, P32, PS02, PS12, PS22, PS32); splitUpper(P03, P13, P23, P33, PS03, PS13, PS23, PS33); } else if (uv10 == .5f) { splitLower(P00, P10, P20, P30, PS00, PS10, PS20, PS30); splitLower(P01, P11, P21, P31, PS01, PS11, PS21, PS31); splitLower(P02, P12, P22, P32, PS02, PS12, PS22, PS32); splitLower(P03, P13, P23, P33, PS03, PS13, PS23, PS33); } else if (uv01 == .5f) { splitUpper(P00, P01, P02, P03, PS00, PS01, PS02, PS03); splitUpper(P10, P11, P12, P13, PS10, PS11, PS12, PS13); splitUpper(P20, P21, P22, P23, PS20, PS21, PS22, PS23); splitUpper(P30, P31, P32, P33, PS30, PS31, PS32, PS33); } else { splitLower(P00, P01, P02, P03, PS00, PS01, PS02, PS03); splitLower(P10, P11, P12, P13, PS10, PS11, PS12, PS13); splitLower(P20, P21, P22, P23, PS20, PS21, PS22, PS23); splitLower(P30, P31, P32, P33, PS30, PS31, PS32, PS33); } result.put("P", new Parameter(new Declaration("P", "vertex point"), p)); return result; } protected void splitLower( Point3f in0, Point3f in1, Point3f in2, Point3f in3, Point3f out0, Point3f out1, Point3f out2, Point3f out3) { out0.set(in0); out1.add(in0, in1); out1.scale(.5f); out2.set(in1); out2.scale(2f); out2.add(in0); out2.add(in2); out2.scale(.25f); out3.add(in1, in2); out3.scale(3f); out3.add(in0); out3.add(in3); out3.scale(.125f); } protected void splitUpper( Point3f in0, Point3f in1, Point3f in2, Point3f in3, Point3f out0, Point3f out1, Point3f out2, Point3f out3) { out3.set(in3); out2.add(in3, in2); out2.scale(.5f); out1.set(in2); out1.scale(2f); out1.add(in3); out1.add(in1); out1.scale(.25f); out0.add(in2, in1); out0.scale(3f); out0.add(in3); out0.add(in0); out0.scale(.125f); } protected void dice_P(ShaderVariables sv) { extractPoints(); Point3f[] pdata = (Point3f[]) sv.P.data; float[] udata = sv.u.data; float[] vdata = sv.v.data; for (int i = 0; i < Grid.getSize(); i++) pdata[i].set( Calc.bezierInterpolate( P00, P10, P20, P30, P01, P11, P21, P31, P02, P12, P22, P32, P03, P13, P23, P33, udata[i], vdata[i])); } protected void dice_Ng(ShaderVariables sv) { sv.Ng.cross(sv.dPdu, sv.dPdv); } } Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Primitive.java 22 May 2003 04:50:14 -0000 1.14 --- Primitive.java 22 May 2003 07:36:26 -0000 1.15 *************** *** 106,112 **** shaderVariables.attributes = attributes; shaderVariables.parameters = parameters; - dice_P(shaderVariables); dice_u(shaderVariables); dice_v(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); --- 106,112 ---- shaderVariables.attributes = attributes; shaderVariables.parameters = parameters; dice_u(shaderVariables); dice_v(shaderVariables); + dice_P(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); |
From: <ma...@us...> - 2003-05-22 07:36:29
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1:/tmp/cvs-serv23650/sampleData Modified Files: torus.rib Log Message: Started work on bicubic patches. Index: torus.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/torus.rib,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** torus.rib 22 May 2003 04:50:14 -0000 1.8 --- torus.rib 22 May 2003 07:36:25 -0000 1.9 *************** *** 58,61 **** --- 58,68 ---- AttributeEnd AttributeBegin + Scale .3 .3 .3 + Rotate -30 0 1 0 + Rotate -90 1 0 0 + Color .6 .6 .6 + ReadArchive "gumbo.rib" + AttributeEnd + AttributeBegin Translate 0 -4 0 Rotate -45 1 1 1 |
From: <ma...@us...> - 2003-05-22 07:36:29
|
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1:/tmp/cvs-serv23650/src/org/jrman/grid Modified Files: Grid.java Log Message: Started work on bicubic patches. Index: Grid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Grid.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Grid.java 6 May 2003 02:15:13 -0000 1.3 --- Grid.java 22 May 2003 07:36:26 -0000 1.4 *************** *** 52,55 **** --- 52,59 ---- return vSize; } + + public static int getSize() { + return size; + } } |
From: <ma...@us...> - 2003-05-22 04:50:19
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1:/tmp/cvs-serv20554/src/org/jrman/parser/keywords Modified Files: KeywordPatch.java Log Message: Implemented bilinear patches. Index: KeywordPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordPatch.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordPatch.java 7 Apr 2003 08:24:30 -0000 1.2 --- KeywordPatch.java 22 May 2003 04:50:14 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- package org.jrman.parser.keywords; + import java.util.Map; + import org.jrman.parser.Tokenizer; *************** *** 27,33 **** // Expect type match(st, TK_STRING); ! // Expect parameter list ! parseParameterList(st); } --- 29,37 ---- // Expect type match(st, TK_STRING); ! String type = st.sval; // Expect parameter list ! Map parameters = parseParameterList(st); ! if (type.equals("bilinear")) ! parser.addBilinearPatch(parameters); } |
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1:/tmp/cvs-serv20554/src/org/jrman/primitive Modified Files: Primitive.java Cylinder.java Quadric.java Cone.java Torus.java Disk.java Sphere.java Added Files: BilinearPatch.java Log Message: Implemented bilinear patches. --- NEW FILE: BilinearPatch.java --- /* BilinearPatch.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.MutableBounds3f; import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; public class BilinearPatch extends Primitive { private static Point3f P00; private static Point3f P10; private static Point3f P01; private static Point3f P11; private static Vector3f vtmp = new Vector3f(); public BilinearPatch(Map parameters, Attributes attributes) { super(parameters, attributes); } private void extractPoints() { Parameter param = (Parameter) parameters.get("P"); Point3f[][] P = (Point3f[][]) param.getData(); P00 = P[0][0]; P10 = P[1][0]; P01 = P[2][0]; P11 = P[3][0]; } public BoundingVolume getBoundingVolume() { MutableBounds3f mb = new MutableBounds3f(); extractPoints(); mb.addPoint(P00); mb.addPoint(P10); mb.addPoint(P01); mb.addPoint(P11); return mb; } public Primitive[] split() { Primitive[] result = new Primitive[2]; extractPoints(); vtmp.sub(P10, P00); float l1 = vtmp.length(); vtmp.sub(P11, P01); float l2 = vtmp.length(); float ul = (l1 + l2) / 2f; vtmp.sub(P01, P00); l1 = vtmp.length(); vtmp.sub(P11, P10); l2 = vtmp.length(); float vl = (l1 + l2) / 2f; if (ul > vl) { result[0] = new BilinearPatch(linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = new BilinearPatch(linearInterpolateParameters(.5f, 1f, 0f , 1f), attributes); } else { result[0] = new BilinearPatch(linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = new BilinearPatch(linearInterpolateParameters(0f, 1f, .5f , 1f), attributes); } return result; } protected void dice_P(ShaderVariables sv) { extractPoints(); dicePoint3f(sv.P, P00, P10, P01, P11); } protected void dice_Ng(ShaderVariables sv) { sv.Ng.cross(sv.dPdu, sv.dPdv); } } Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Primitive.java 17 May 2003 21:47:57 -0000 1.13 --- Primitive.java 22 May 2003 04:50:14 -0000 1.14 *************** *** 20,33 **** --- 20,54 ---- package org.jrman.primitive; + import java.util.HashMap; + import java.util.Iterator; import java.util.Map; + import javax.vecmath.Color3f; + import javax.vecmath.Matrix4f; + import javax.vecmath.Point3f; + import javax.vecmath.Point4f; + import javax.vecmath.Vector3f; + import org.jrman.attributes.Attributes; import org.jrman.geom.BoundingVolume; import org.jrman.geom.Bounds2f; import org.jrman.geom.Transform; + import org.jrman.grid.Color3fGrid; + import org.jrman.grid.FloatGrid; + import org.jrman.grid.Grid; + import org.jrman.grid.Point3fGrid; + import org.jrman.grid.Vector3fGrid; + import org.jrman.parser.Declaration; + import org.jrman.parser.Global; + import org.jrman.parser.Parameter; import org.jrman.render.ShaderVariables; + import org.jrman.util.Calc; public abstract class Primitive implements Comparable { + private static Declaration U_DECL = new Declaration("u", "vertex float"); + + private static Declaration V_DECL = new Declaration("v", "vertex float"); + protected Map parameters; *************** *** 41,44 **** --- 62,67 ---- this.parameters = parameters; this.attributes = attributes; + if (parameters != null) + setDefaultParameters(); } *************** *** 51,61 **** public abstract Primitive[] split(); ! public void dice(ShaderVariables shaderVariables, Transform worldToCamera) { ! shaderVariables.attributes = attributes; ! shaderVariables.parameters = parameters; } - public abstract boolean isReadyToBeDiced(int gridSize); - public void setRasterBounds(Bounds2f bounds) { this.rasterBounds = bounds; --- 74,81 ---- public abstract Primitive[] split(); ! public float getMinGridSize() { ! return 16f; } public void setRasterBounds(Bounds2f bounds) { this.rasterBounds = bounds; *************** *** 73,77 **** return rasterBounds; } ! public int compareTo(Object other) { Primitive op = (Primitive) other; --- 93,97 ---- return rasterBounds; } ! public int compareTo(Object other) { Primitive op = (Primitive) other; *************** *** 81,84 **** --- 101,494 ---- return 1; return 0; + } + + public void dice(ShaderVariables shaderVariables, Transform worldToCamera) { + shaderVariables.attributes = attributes; + shaderVariables.parameters = parameters; + dice_P(shaderVariables); + dice_u(shaderVariables); + dice_v(shaderVariables); + dice_du(shaderVariables); + dice_dv(shaderVariables); + dice_dPdu(shaderVariables); + dice_dPdv(shaderVariables); + dice_Ng(shaderVariables); + dice_N(shaderVariables); + dice_Cs(shaderVariables); + dice_Os(shaderVariables); + dice_s(shaderVariables); + dice_t(shaderVariables); + dice_others(shaderVariables); + Transform objectToCamera = worldToCamera.concat(attributes.getTransform()); + shaderVariables.transform(objectToCamera); + } + + protected void dice_P(ShaderVariables shaderVariables) { + } + + protected void dice_Ng(ShaderVariables shaderVariables) { + } + + protected void dice_N(ShaderVariables shaderVariables) { + Parameter parameter = (Parameter) parameters.get("N"); + if (parameter != null) { + Vector3f[][] data = (Vector3f[][]) parameter.getData(); + diceVector3f(shaderVariables.N, data[0][0], data[1][0], data[2][0], data[3][0]); + } else + shaderVariables.N.set(shaderVariables.Ng); + } + + protected void dice_Cs(ShaderVariables shaderVariables) { + Parameter parameter = (Parameter) parameters.get("Cs"); + if (parameter != null) { + Color3f[][] data = (Color3f[][]) parameter.getData(); + diceColor3f(shaderVariables.Cs, data[0][0], data[1][0], data[2][0], data[3][0]); + } else + shaderVariables.Cs.set(attributes.getColor()); + } + + protected void dice_Os(ShaderVariables shaderVariables) { + Parameter parameter = (Parameter) parameters.get("Os"); + if (parameter != null) { + Color3f[][] data = (Color3f[][]) parameter.getData(); + diceColor3f(shaderVariables.Os, data[0][0], data[1][0], data[2][0], data[3][0]); + } else + shaderVariables.Os.set(attributes.getOpacity()); + } + + protected void dice_u(ShaderVariables shaderVariables) { + Parameter parameter = (Parameter) parameters.get("u"); + float[][] data = (float[][]) parameter.getData(); + diceFloat(shaderVariables.u, data[0][0], data[1][0], data[2][0], data[3][0]); + } + + protected void dice_v(ShaderVariables shaderVariables) { + Parameter parameter = (Parameter) parameters.get("v"); + float[][] data = (float[][]) parameter.getData(); + diceFloat(shaderVariables.v, data[0][0], data[1][0], data[2][0], data[3][0]); + } + + protected void dice_s(ShaderVariables shaderVariables) { + Parameter parameter = (Parameter) parameters.get("s"); + float[][] data = (float[][]) parameter.getData(); + diceFloat(shaderVariables.s, data[0][0], data[1][0], data[2][0], data[3][0]); + } + + protected void dice_t(ShaderVariables shaderVariables) { + Parameter parameter = (Parameter) parameters.get("t"); + float[][] data = (float[][]) parameter.getData(); + diceFloat(shaderVariables.t, data[0][0], data[1][0], data[2][0], data[3][0]); + } + + protected void dice_du(ShaderVariables shaderVariables) { + shaderVariables.du.du(shaderVariables.u); + } + + protected void dice_dv(ShaderVariables shaderVariables) { + shaderVariables.dv.dv(shaderVariables.v); + } + + protected void dice_dPdu(ShaderVariables shaderVariables) { + shaderVariables.dPdu.Du(shaderVariables.P, shaderVariables.du); + } + + protected void dice_dPdv(ShaderVariables shaderVariables) { + shaderVariables.dPdv.Dv(shaderVariables.P, shaderVariables.dv); + } + + protected void dice_others(ShaderVariables shaderVariables) { + // TODO Auto-generated method stub + + } + + protected void diceFloat(FloatGrid g, float uv00, float uv10, float uv01, float uv11) { + int uSize = Grid.getUSize(); + int vSize = Grid.getVSize(); + float uStep = 1f / (uSize - 1); + float vStep = 1f / (vSize - 1); + float u = 0f; + for (int iu = 0; iu < uSize; iu++) { + float v = 0f; + for (int iv = 0; iv < vSize; iv++) { + g.set(iu, iv, Calc.interpolate(uv00, uv10, uv01, uv11, u, v)); + v += vStep; + } + u += uStep; + } + } + + protected void dicePoint3f( + Point3fGrid g, + Point3f uv00, + Point3f uv10, + Point3f uv01, + Point3f uv11) { + int uSize = Grid.getUSize(); + int vSize = Grid.getVSize(); + float uStep = 1f / (uSize - 1); + float vStep = 1f / (vSize - 1); + float u = 0f; + for (int iu = 0; iu < uSize; iu++) { + float v = 0f; + for (int iv = 0; iv < vSize; iv++) { + g.set(iu, iv, Calc.interpolate(uv00, uv10, uv01, uv11, u, v)); + v += vStep; + } + u += uStep; + } + } + + protected void diceVector3f( + Vector3fGrid g, + Vector3f uv00, + Vector3f uv10, + Vector3f uv01, + Vector3f uv11) { + int uSize = Grid.getUSize(); + int vSize = Grid.getVSize(); + float uStep = 1f / (uSize - 1); + float vStep = 1f / (vSize - 1); + float u = 0f; + for (int iu = 0; iu < uSize; iu++) { + float v = 0f; + for (int iv = 0; iv < vSize; iv++) { + g.set(iu, iv, Calc.interpolate(uv00, uv10, uv01, uv11, u, v)); + v += vStep; + } + u += uStep; + } + } + + protected void diceColor3f( + Color3fGrid g, + Color3f uv00, + Color3f uv10, + Color3f uv01, + Color3f uv11) { + int uSize = Grid.getUSize(); + int vSize = Grid.getVSize(); + float uStep = 1f / (uSize - 1); + float vStep = 1f / (vSize - 1); + float u = 0f; + for (int iu = 0; iu < uSize; iu++) { + float v = 0f; + for (int iv = 0; iv < vSize; iv++) { + g.set(iu, iv, Calc.interpolate(uv00, uv10, uv01, uv11, u, v)); + v += vStep; + } + u += uStep; + } + } + + protected void setDefaultParameters() { + Parameter parameter = (Parameter) parameters.get("u"); + if (parameter == null) { + float[][] u = new float[4][]; + u[0] = new float[1]; + u[1] = new float[1]; + u[2] = new float[1]; + u[3] = new float[1]; + u[0][0] = 0f; + u[1][0] = 1f; + u[2][0] = 0f; + u[3][0] = 1f; + parameters.put("u", new Parameter(U_DECL, u)); + } + parameter = (Parameter) parameters.get("v"); + if (parameter == null) { + float[][] v = new float[4][]; + v[0] = new float[1]; + v[1] = new float[1]; + v[2] = new float[1]; + v[3] = new float[1]; + v[0][0] = 0f; + v[1][0] = 0f; + v[2][0] = 1f; + v[3][0] = 1f; + parameters.put("v", new Parameter(V_DECL, v)); + } + parameter = (Parameter) parameters.get("s"); + if (parameter == null) { + float[][] s = new float[4][]; + s[0] = new float[1]; + s[1] = new float[1]; + s[2] = new float[1]; + s[3] = new float[1]; + Parameter uParam = (Parameter) parameters.get("u"); + float[][] u = (float[][]) uParam.getData(); + s[0][0] = u[0][0]; + s[1][0] = u[1][0]; + s[2][0] = u[2][0]; + s[3][0] = u[3][0]; + parameters.put("s", new Parameter(Global.getDeclaration("s"), s)); + } + parameter = (Parameter) parameters.get("t"); + if (parameter == null) { + float[][] t = new float[4][]; + t[0] = new float[1]; + t[1] = new float[1]; + t[2] = new float[1]; + t[3] = new float[1]; + Parameter vParam = (Parameter) parameters.get("v"); + float[][] v = (float[][]) vParam.getData(); + t[0][0] = v[0][0]; + t[1][0] = v[1][0]; + t[2][0] = v[2][0]; + t[3][0] = v[3][0]; + parameters.put("t", new Parameter(Global.getDeclaration("t"), t)); + } + } + + protected Map linearInterpolateParameters( + float uMin, + float uMax, + float vMin, + float vMax) { + Map result = new HashMap(); + for (Iterator iter = parameters.keySet().iterator(); iter.hasNext();) { + String name = (String) iter.next(); + Parameter parameter = (Parameter) parameters.get(name); + Declaration declaration = parameter.getDeclaration(); + Declaration.StorageClass storageClass = declaration.getStorageClass(); + if (storageClass == Declaration.StorageClass.CONSTANT + || storageClass == Declaration.StorageClass.UNIFORM) { + result.put(name, parameter); + continue; + } + Declaration.Type type = declaration.getType(); + if (type == Declaration.Type.INTEGER || type == Declaration.Type.STRING) { + result.put(name, parameter); + continue; + } + if (type == Declaration.Type.FLOAT) { + float[][] param = (float[][]) parameter.getData(); + float[][] sparam = new float[4][]; + int count = declaration.getCount(); + sparam[0] = new float[count]; + sparam[1] = new float[count]; + sparam[2] = new float[count]; + sparam[3] = new float[count]; + for (int i = 0; i < count; i++) { + float uv00 = param[0][i]; + float uv10 = param[1][i]; + float uv01 = param[2][i]; + float uv11 = param[3][i]; + sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); + sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); + sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); + sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); + } + result.put(name, new Parameter(declaration, sparam)); + } else if (type == Declaration.Type.POINT) { + Point3f[][] param = (Point3f[][]) parameter.getData(); + Point3f[][] sparam = new Point3f[4][]; + int count = declaration.getCount(); + sparam[0] = new Point3f[count]; + sparam[1] = new Point3f[count]; + sparam[2] = new Point3f[count]; + sparam[3] = new Point3f[count]; + for (int i = 0; i < count; i++) { + Point3f uv00 = param[0][i]; + Point3f uv10 = param[1][i]; + Point3f uv01 = param[2][i]; + Point3f uv11 = param[3][i]; + sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); + sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); + sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); + sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); + } + result.put(name, new Parameter(declaration, sparam)); + } else if (type == Declaration.Type.COLOR) { + Color3f[][] param = (Color3f[][]) parameter.getData(); + Color3f[][] sparam = new Color3f[4][]; + int count = declaration.getCount(); + sparam[0] = new Color3f[count]; + sparam[1] = new Color3f[count]; + sparam[2] = new Color3f[count]; + sparam[3] = new Color3f[count]; + for (int i = 0; i < count; i++) { + Color3f uv00 = param[0][i]; + Color3f uv10 = param[1][i]; + Color3f uv01 = param[2][i]; + Color3f uv11 = param[3][i]; + sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); + sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); + sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); + sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); + } + result.put(name, new Parameter(declaration, sparam)); + } else if (type == Declaration.Type.VECTOR || type == Declaration.Type.NORMAL) { + Vector3f[][] param = (Vector3f[][]) parameter.getData(); + Vector3f[][] sparam = new Vector3f[4][]; + int count = declaration.getCount(); + sparam[0] = new Vector3f[count]; + sparam[1] = new Vector3f[count]; + sparam[2] = new Vector3f[count]; + sparam[3] = new Vector3f[count]; + for (int i = 0; i < count; i++) { + Vector3f uv00 = param[0][i]; + Vector3f uv10 = param[1][i]; + Vector3f uv01 = param[2][i]; + Vector3f uv11 = param[3][i]; + sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); + sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); + sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); + sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); + } + result.put(name, new Parameter(declaration, sparam)); + } else if (type == Declaration.Type.HPOINT) { + Point4f[][] param = (Point4f[][]) parameter.getData(); + Point4f[][] sparam = new Point4f[4][]; + int count = declaration.getCount(); + sparam[0] = new Point4f[count]; + sparam[1] = new Point4f[count]; + sparam[2] = new Point4f[count]; + sparam[3] = new Point4f[count]; + for (int i = 0; i < count; i++) { + Point4f uv00 = param[0][i]; + Point4f uv10 = param[1][i]; + Point4f uv01 = param[2][i]; + Point4f uv11 = param[3][i]; + sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); + sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); + sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); + sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); + } + result.put(name, new Parameter(declaration, sparam)); + } else if (type == Declaration.Type.MATRIX) { + Matrix4f[][] param = (Matrix4f[][]) parameter.getData(); + Matrix4f[][] sparam = new Matrix4f[4][]; + int count = declaration.getCount(); + sparam[0] = new Matrix4f[count]; + sparam[1] = new Matrix4f[count]; + sparam[2] = new Matrix4f[count]; + sparam[3] = new Matrix4f[count]; + for (int i = 0; i < count; i++) { + Matrix4f uv00 = param[0][i]; + Matrix4f uv10 = param[1][i]; + Matrix4f uv01 = param[2][i]; + Matrix4f uv11 = param[3][i]; + sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); + sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); + sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); + sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); + } + result.put(name, new Parameter(declaration, sparam)); + } + } + return result; + } + + public boolean isReadyToBeDiced(int gridSize) { + float width = rasterBounds.getWidth(); + float height = rasterBounds.getHeight(); + boolean ready = width * height <= gridSize * attributes.getShadingRate(); + if (!ready) + return false; + float idealSize = (width * height) / attributes.getShadingRate(); + idealSize = Calc.clamp(idealSize, getMinGridSize(), gridSize); + int side = (int) (Math.ceil(Math.sqrt(idealSize))) + 1; + Grid.setSize(side, side); + return true; } Index: Cylinder.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Cylinder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Cylinder.java 17 May 2003 21:47:57 -0000 1.4 --- Cylinder.java 22 May 2003 04:50:14 -0000 1.5 *************** *** 107,111 **** thetaMin, (thetaMin + thetaMax) / 2f, ! interpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 107,111 ---- thetaMin, (thetaMin + thetaMax) / 2f, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 116,120 **** (thetaMin + thetaMax) / 2f, thetaMax, ! interpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { --- 116,120 ---- (thetaMin + thetaMax) / 2f, thetaMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { *************** *** 126,130 **** thetaMin, thetaMax, ! interpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 126,130 ---- thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 135,139 **** thetaMin, thetaMax, ! interpolateParameters(0f, 1f, .5f, 1f), attributes); } --- 135,139 ---- thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); } Index: Quadric.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Quadric.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Quadric.java 17 May 2003 21:47:57 -0000 1.12 --- Quadric.java 22 May 2003 04:50:14 -0000 1.13 *************** *** 20,439 **** package org.jrman.primitive; - import java.util.HashMap; - import java.util.Iterator; import java.util.Map; - import javax.vecmath.Color3f; - import javax.vecmath.Matrix4f; - import javax.vecmath.Point3f; - import javax.vecmath.Point4f; - import javax.vecmath.Vector3f; - import org.jrman.attributes.Attributes; - import org.jrman.geom.Transform; - import org.jrman.grid.Color3fGrid; - import org.jrman.grid.FloatGrid; - import org.jrman.grid.Grid; - import org.jrman.grid.Point3fGrid; - import org.jrman.grid.Vector3fGrid; - import org.jrman.parser.Declaration; - import org.jrman.parser.Global; - import org.jrman.parser.Parameter; - import org.jrman.render.ShaderVariables; - import org.jrman.util.Calc; public abstract class Quadric extends Primitive { ! private static Declaration U_DECL = new Declaration("u", "vertex float"); ! ! private static Declaration V_DECL = new Declaration("v", "vertex float"); ! ! public Quadric(Map parameters, Attributes attributes) { super(parameters, attributes); ! setDefaultParameters(); ! } ! ! public void dice(ShaderVariables shaderVariables, Transform worldToCamera) { ! super.dice(shaderVariables, worldToCamera); ! dice_P(shaderVariables); ! dice_Ng(shaderVariables); ! dice_N(shaderVariables); ! dice_Cs(shaderVariables); ! dice_Os(shaderVariables); ! dice_u(shaderVariables); ! dice_v(shaderVariables); ! dice_s(shaderVariables); ! dice_t(shaderVariables); ! dice_du(shaderVariables); ! dice_dv(shaderVariables); ! dice_dPdu(shaderVariables); ! dice_dPdv(shaderVariables); ! dice_others(shaderVariables); ! Transform objectToCamera = worldToCamera.concat(attributes.getTransform()); ! shaderVariables.transform(objectToCamera); ! } ! ! protected abstract void dice_P(ShaderVariables shaderVariables); ! ! protected abstract void dice_Ng(ShaderVariables shaderVariables); ! ! protected void dice_N(ShaderVariables shaderVariables) { ! Parameter parameter = (Parameter) parameters.get("N"); ! if (parameter != null) { ! Vector3f[][] data = (Vector3f[][]) parameter.getData(); ! diceVector3f(shaderVariables.N, data[0][0], data[1][0], data[2][0], data[3][0]); ! } else ! shaderVariables.N.set(shaderVariables.Ng); ! } ! ! protected void dice_Cs(ShaderVariables shaderVariables) { ! Parameter parameter = (Parameter) parameters.get("Cs"); ! if (parameter != null) { ! Color3f[][] data = (Color3f[][]) parameter.getData(); ! diceColor3f(shaderVariables.Cs, data[0][0], data[1][0], data[2][0], data[3][0]); ! } else ! shaderVariables.Cs.set(attributes.getColor()); ! } ! ! protected void dice_Os(ShaderVariables shaderVariables) { ! Parameter parameter = (Parameter) parameters.get("Os"); ! if (parameter != null) { ! Color3f[][] data = (Color3f[][]) parameter.getData(); ! diceColor3f(shaderVariables.Os, data[0][0], data[1][0], data[2][0], data[3][0]); ! } else ! shaderVariables.Os.set(attributes.getOpacity()); ! } ! ! protected void dice_u(ShaderVariables shaderVariables) { ! Parameter parameter = (Parameter) parameters.get("u"); ! float[][] data = (float[][]) parameter.getData(); ! diceFloat(shaderVariables.u, data[0][0], data[1][0], data[2][0], data[3][0]); ! } ! ! protected void dice_v(ShaderVariables shaderVariables) { ! Parameter parameter = (Parameter) parameters.get("v"); ! float[][] data = (float[][]) parameter.getData(); ! diceFloat(shaderVariables.v, data[0][0], data[1][0], data[2][0], data[3][0]); ! } ! ! protected void dice_s(ShaderVariables shaderVariables) { ! Parameter parameter = (Parameter) parameters.get("s"); ! float[][] data = (float[][]) parameter.getData(); ! diceFloat(shaderVariables.s, data[0][0], data[1][0], data[2][0], data[3][0]); ! } ! ! protected void dice_t(ShaderVariables shaderVariables) { ! Parameter parameter = (Parameter) parameters.get("t"); ! float[][] data = (float[][]) parameter.getData(); ! diceFloat(shaderVariables.t, data[0][0], data[1][0], data[2][0], data[3][0]); ! } ! ! protected void dice_du(ShaderVariables shaderVariables) { ! shaderVariables.du.du(shaderVariables.u); ! } ! ! protected void dice_dv(ShaderVariables shaderVariables) { ! shaderVariables.dv.dv(shaderVariables.v); ! } ! ! protected void dice_dPdu(ShaderVariables shaderVariables) { ! shaderVariables.dPdu.Du(shaderVariables.P, shaderVariables.du); ! } ! ! protected void dice_dPdv(ShaderVariables shaderVariables) { ! shaderVariables.dPdv.Dv(shaderVariables.P, shaderVariables.dv); ! } ! ! protected void dice_others(ShaderVariables shaderVariables) { ! // TODO Auto-generated method stub ! ! } ! ! protected void diceFloat(FloatGrid g, float uv00, float uv10, float uv01, float uv11) { ! int uSize = Grid.getUSize(); ! int vSize = Grid.getVSize(); ! float uStep = 1f / (uSize - 1); ! float vStep = 1f / (vSize - 1); ! float u = 0f; ! for (int iu = 0; iu < uSize; iu++) { ! float v = 0f; ! for (int iv = 0; iv < vSize; iv++) { ! g.set(iu, iv, Calc.interpolate(uv00, uv10, uv01, uv11, u, v)); ! v += vStep; ! } ! u += uStep; ! } ! } ! ! protected void dicePoint3f( ! Point3fGrid g, ! Point3f uv00, ! Point3f uv10, ! Point3f uv01, ! Point3f uv11) { ! int uSize = Grid.getUSize(); ! int vSize = Grid.getVSize(); ! float uStep = 1f / (uSize - 1); ! float vStep = 1f / (vSize - 1); ! float u = 0f; ! for (int iu = 0; iu < uSize; iu++) { ! float v = 0f; ! for (int iv = 0; iv < vSize; iv++) { ! g.set(iu, iv, Calc.interpolate(uv00, uv10, uv01, uv11, u, v)); ! v += vStep; ! } ! u += uStep; ! } ! } ! ! protected void diceVector3f( ! Vector3fGrid g, ! Vector3f uv00, ! Vector3f uv10, ! Vector3f uv01, ! Vector3f uv11) { ! int uSize = Grid.getUSize(); ! int vSize = Grid.getVSize(); ! float uStep = 1f / (uSize - 1); ! float vStep = 1f / (vSize - 1); ! float u = 0f; ! for (int iu = 0; iu < uSize; iu++) { ! float v = 0f; ! for (int iv = 0; iv < vSize; iv++) { ! g.set(iu, iv, Calc.interpolate(uv00, uv10, uv01, uv11, u, v)); ! v += vStep; ! } ! u += uStep; ! } ! } ! ! protected void diceColor3f( ! Color3fGrid g, ! Color3f uv00, ! Color3f uv10, ! Color3f uv01, ! Color3f uv11) { ! int uSize = Grid.getUSize(); ! int vSize = Grid.getVSize(); ! float uStep = 1f / (uSize - 1); ! float vStep = 1f / (vSize - 1); ! float u = 0f; ! for (int iu = 0; iu < uSize; iu++) { ! float v = 0f; ! for (int iv = 0; iv < vSize; iv++) { ! g.set(iu, iv, Calc.interpolate(uv00, uv10, uv01, uv11, u, v)); ! v += vStep; ! } ! u += uStep; ! } ! } ! ! protected void setDefaultParameters() { ! Parameter parameter = (Parameter) parameters.get("u"); ! if (parameter == null) { ! float[][] u = new float[4][]; ! u[0] = new float[1]; ! u[1] = new float[1]; ! u[2] = new float[1]; ! u[3] = new float[1]; ! u[0][0] = 0f; ! u[1][0] = 1f; ! u[2][0] = 0f; ! u[3][0] = 1f; ! parameters.put("u", new Parameter(U_DECL, u)); ! } ! parameter = (Parameter) parameters.get("v"); ! if (parameter == null) { ! float[][] v = new float[4][]; ! v[0] = new float[1]; ! v[1] = new float[1]; ! v[2] = new float[1]; ! v[3] = new float[1]; ! v[0][0] = 0f; ! v[1][0] = 0f; ! v[2][0] = 1f; ! v[3][0] = 1f; ! parameters.put("v", new Parameter(V_DECL, v)); ! } ! parameter = (Parameter) parameters.get("s"); ! if (parameter == null) { ! float[][] s = new float[4][]; ! s[0] = new float[1]; ! s[1] = new float[1]; ! s[2] = new float[1]; ! s[3] = new float[1]; ! Parameter uParam = (Parameter) parameters.get("u"); ! float[][] u = (float[][]) uParam.getData(); ! s[0][0] = u[0][0]; ! s[1][0] = u[1][0]; ! s[2][0] = u[2][0]; ! s[3][0] = u[3][0]; ! parameters.put("s", new Parameter(Global.getDeclaration("s"), s)); ! } ! parameter = (Parameter) parameters.get("t"); ! if (parameter == null) { ! float[][] t = new float[4][]; ! t[0] = new float[1]; ! t[1] = new float[1]; ! t[2] = new float[1]; ! t[3] = new float[1]; ! Parameter vParam = (Parameter) parameters.get("v"); ! float[][] v = (float[][]) vParam.getData(); ! t[0][0] = v[0][0]; ! t[1][0] = v[1][0]; ! t[2][0] = v[2][0]; ! t[3][0] = v[3][0]; ! parameters.put("t", new Parameter(Global.getDeclaration("t"), t)); ! } ! } ! ! protected Map interpolateParameters(float uMin, float uMax, float vMin, float vMax) { ! Map result = new HashMap(); ! for (Iterator iter = parameters.keySet().iterator(); iter.hasNext();) { ! String name = (String) iter.next(); ! Parameter parameter = (Parameter) parameters.get(name); ! Declaration declaration = parameter.getDeclaration(); ! Declaration.StorageClass storageClass = declaration.getStorageClass(); ! if (storageClass == Declaration.StorageClass.CONSTANT ! || storageClass == Declaration.StorageClass.UNIFORM) { ! result.put(name, parameter); ! continue; ! } ! Declaration.Type type = declaration.getType(); ! if (type == Declaration.Type.INTEGER || type == Declaration.Type.STRING) { ! result.put(name, parameter); ! continue; ! } ! if (type == Declaration.Type.FLOAT) { ! float[][] param = (float[][]) parameter.getData(); ! float[][] sparam = new float[4][]; ! int count = declaration.getCount(); ! sparam[0] = new float[count]; ! sparam[1] = new float[count]; ! sparam[2] = new float[count]; ! sparam[3] = new float[count]; ! for (int i = 0; i < count; i++) { ! float uv00 = param[0][i]; ! float uv10 = param[1][i]; ! float uv01 = param[2][i]; ! float uv11 = param[3][i]; ! sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); ! sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); ! sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); ! sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); ! } ! result.put(name, new Parameter(declaration, sparam)); ! } else if (type == Declaration.Type.POINT) { ! Point3f[][] param = (Point3f[][]) parameter.getData(); ! Point3f[][] sparam = new Point3f[4][]; ! int count = declaration.getCount(); ! sparam[0] = new Point3f[count]; ! sparam[1] = new Point3f[count]; ! sparam[2] = new Point3f[count]; ! sparam[3] = new Point3f[count]; ! for (int i = 0; i < count; i++) { ! Point3f uv00 = param[0][i]; ! Point3f uv10 = param[1][i]; ! Point3f uv01 = param[2][i]; ! Point3f uv11 = param[3][i]; ! sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); ! sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); ! sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); ! sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); ! } ! result.put(name, new Parameter(declaration, sparam)); ! } else if (type == Declaration.Type.COLOR) { ! Color3f[][] param = (Color3f[][]) parameter.getData(); ! Color3f[][] sparam = new Color3f[4][]; ! int count = declaration.getCount(); ! sparam[0] = new Color3f[count]; ! sparam[1] = new Color3f[count]; ! sparam[2] = new Color3f[count]; ! sparam[3] = new Color3f[count]; ! for (int i = 0; i < count; i++) { ! Color3f uv00 = param[0][i]; ! Color3f uv10 = param[1][i]; ! Color3f uv01 = param[2][i]; ! Color3f uv11 = param[3][i]; ! sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); ! sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); ! sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); ! sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); ! } ! result.put(name, new Parameter(declaration, sparam)); ! } else if (type == Declaration.Type.VECTOR || type == Declaration.Type.NORMAL) { ! Vector3f[][] param = (Vector3f[][]) parameter.getData(); ! Vector3f[][] sparam = new Vector3f[4][]; ! int count = declaration.getCount(); ! sparam[0] = new Vector3f[count]; ! sparam[1] = new Vector3f[count]; ! sparam[2] = new Vector3f[count]; ! sparam[3] = new Vector3f[count]; ! for (int i = 0; i < count; i++) { ! Vector3f uv00 = param[0][i]; ! Vector3f uv10 = param[1][i]; ! Vector3f uv01 = param[2][i]; ! Vector3f uv11 = param[3][i]; ! sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); ! sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); ! sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); ! sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); ! } ! result.put(name, new Parameter(declaration, sparam)); ! } else if (type == Declaration.Type.HPOINT) { ! Point4f[][] param = (Point4f[][]) parameter.getData(); ! Point4f[][] sparam = new Point4f[4][]; ! int count = declaration.getCount(); ! sparam[0] = new Point4f[count]; ! sparam[1] = new Point4f[count]; ! sparam[2] = new Point4f[count]; ! sparam[3] = new Point4f[count]; ! for (int i = 0; i < count; i++) { ! Point4f uv00 = param[0][i]; ! Point4f uv10 = param[1][i]; ! Point4f uv01 = param[2][i]; ! Point4f uv11 = param[3][i]; ! sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); ! sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); ! sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); ! sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); ! } ! result.put(name, new Parameter(declaration, sparam)); ! } else if (type == Declaration.Type.MATRIX) { ! Matrix4f[][] param = (Matrix4f[][]) parameter.getData(); ! Matrix4f[][] sparam = new Matrix4f[4][]; ! int count = declaration.getCount(); ! sparam[0] = new Matrix4f[count]; ! sparam[1] = new Matrix4f[count]; ! sparam[2] = new Matrix4f[count]; ! sparam[3] = new Matrix4f[count]; ! for (int i = 0; i < count; i++) { ! Matrix4f uv00 = param[0][i]; ! Matrix4f uv10 = param[1][i]; ! Matrix4f uv01 = param[2][i]; ! Matrix4f uv11 = param[3][i]; ! sparam[0][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMin); ! sparam[1][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMin); ! sparam[2][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMin, vMax); ! sparam[3][i] = Calc.interpolate(uv00, uv10, uv01, uv11, uMax, vMax); ! } ! result.put(name, new Parameter(declaration, sparam)); ! } ! } ! return result; ! } ! ! public boolean isReadyToBeDiced(int gridSize) { ! float width = rasterBounds.getWidth(); ! float height = rasterBounds.getHeight(); ! boolean ready = width * height <= gridSize * attributes.getShadingRate(); ! if (!ready) ! return false; ! 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 true; ! } } --- 20,36 ---- package org.jrman.primitive; import java.util.Map; import org.jrman.attributes.Attributes; public abstract class Quadric extends Primitive { ! public Quadric(Map parameters, Attributes attributes) { super(parameters, attributes); ! } ! ! public float getMinGridSize() { ! return 36f; ! } } Index: Cone.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Cone.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Cone.java 21 May 2003 04:58:40 -0000 1.4 --- Cone.java 22 May 2003 04:50:14 -0000 1.5 *************** *** 123,127 **** (thetaMin + thetaMax) / 2f, height, ! interpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 123,127 ---- (thetaMin + thetaMax) / 2f, height, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 133,137 **** thetaMax, height, ! interpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { --- 133,137 ---- thetaMax, height, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { *************** *** 144,148 **** thetaMax, height, ! interpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 144,148 ---- thetaMax, height, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 154,158 **** thetaMax, height, ! interpolateParameters(0f, 1f, .5f, 1f), attributes); } --- 154,158 ---- thetaMax, height, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); } Index: Torus.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Torus.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Torus.java 17 May 2003 21:47:57 -0000 1.5 --- Torus.java 22 May 2003 04:50:14 -0000 1.6 *************** *** 140,144 **** thetaMin, (thetaMin + thetaMax) / 2f, ! interpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 140,144 ---- thetaMin, (thetaMin + thetaMax) / 2f, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 150,154 **** (thetaMin + thetaMax) / 2f, thetaMax, ! interpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { --- 150,154 ---- (thetaMin + thetaMax) / 2f, thetaMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { *************** *** 161,165 **** thetaMin, thetaMax, ! interpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 161,165 ---- thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 171,175 **** thetaMin, thetaMax, ! interpolateParameters(0f, 1f, .5f, 1f), attributes); } --- 171,175 ---- thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); } Index: Disk.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Disk.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Disk.java 21 May 2003 04:58:40 -0000 1.5 --- Disk.java 22 May 2003 04:50:14 -0000 1.6 *************** *** 116,120 **** rMin, rMax, ! interpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 116,120 ---- rMin, rMax, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 125,129 **** rMin, rMax, ! interpolateParameters(.5f, 1f, 0f, 1f), attributes); } --- 125,129 ---- rMin, rMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); } *************** *** 136,140 **** rMin, (rMax + rMin)/2f, ! interpolateParameters(0f, 1f, .5f, 1f), attributes); result[1] = --- 136,140 ---- rMin, (rMax + rMin)/2f, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[1] = *************** *** 145,149 **** (rMax + rMin)/2f, rMax, ! interpolateParameters(0f, 1f, 0f, .5f), attributes); } --- 145,149 ---- (rMax + rMin)/2f, rMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); } Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Sphere.java 17 May 2003 21:47:57 -0000 1.18 --- Sphere.java 22 May 2003 04:50:14 -0000 1.19 *************** *** 131,135 **** thetaMin, (thetaMin + thetaMax) / 2f, ! interpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 131,135 ---- thetaMin, (thetaMin + thetaMax) / 2f, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 140,144 **** (thetaMin + thetaMax) / 2f, thetaMax, ! interpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { --- 140,144 ---- (thetaMin + thetaMax) / 2f, thetaMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { *************** *** 150,154 **** thetaMin, thetaMax, ! interpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 150,154 ---- thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 159,163 **** thetaMin, thetaMax, ! interpolateParameters(0f, 1f, .5f, 1f), attributes); } --- 159,163 ---- thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); } |
From: <ma...@us...> - 2003-05-22 04:50:18
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1:/tmp/cvs-serv20554/src/org/jrman/parser Modified Files: Parser.java Log Message: Implemented bilinear patches. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Parser.java 21 May 2003 04:58:41 -0000 1.45 --- Parser.java 22 May 2003 04:50:14 -0000 1.46 *************** *** 57,60 **** --- 57,61 ---- import org.jrman.options.Quantizer; import org.jrman.parser.keywords.KeywordParser; + import org.jrman.primitive.BilinearPatch; import org.jrman.primitive.Cone; import org.jrman.primitive.Cylinder; *************** *** 851,862 **** if (!inObject) renderer.addPrimitive( ! new Disk( ! height, ! 0f, ! thetaMax, ! 0f, ! radius, ! parameters, ! getAttributes())); else { final Transform transform = currentAttributes.getTransform(); --- 852,856 ---- if (!inObject) renderer.addPrimitive( ! new Disk(height, 0f, thetaMax, 0f, radius, parameters, getAttributes())); else { final Transform transform = currentAttributes.getTransform(); *************** *** 877,954 **** } ! public void addPoints(final Map parameters) { if (inAreaLightSource) return; ! Parameter pParam = (Parameter) parameters.get("P"); ! parameters.remove("P"); ! Parameter widthParam = (Parameter) parameters.get("width"); ! parameters.remove("width"); ! Parameter constantWidthParam = (Parameter) parameters.get("constantwidth"); ! parameters.remove("constantwidth"); ! Parameter csParam = (Parameter) parameters.get("Cs"); ! parameters.remove("Cs"); ! Parameter osParam = (Parameter) parameters.get("Os"); ! parameters.remove("Os"); ! Point3f[][] points = (Point3f[][]) pParam.getData(); ! float[][] widths; if (widthParam != null) ! widths = (float[][]) widthParam.getData(); else ! widths = (float[][]) constantWidthParam.getData(); ! Color3f[][] Cs = null; ! Declaration CsDecl = null; ! if (csParam != null) { ! Cs = (Color3f[][]) csParam.getData(); ! CsDecl = csParam.getDeclaration(); ! } ! Color3f[][] Os = null; ! Declaration OsDecl = null; ! if (osParam != null) { ! Os = (Color3f[][]) osParam.getData(); ! OsDecl = osParam.getDeclaration(); ! } ! for (int i = 0; i < points.length; i++) { ! final Point3f p = points[i][0]; ! float tw; ! if (widthParam != null) ! tw = widths[i][0]; ! else ! tw = widths[0][0]; ! final float w = tw; ! Map tparam; ! if (Cs == null && Os == null) ! tparam = parameters; ! else { ! tparam = new HashMap(parameters); ! if (Cs != null) { ! Color3f[][] cs = new Color3f[1][]; ! cs[0] = Cs[i]; ! tparam.put("Cs", new Parameter(CsDecl, cs)); ! } ! if (Os != null) { ! Color3f[][] os = new Color3f[1][]; ! os[0] = Os[i]; ! tparam.put("Os", new Parameter(OsDecl, os)); ! } } ! final Map param = tparam; ! if (!inObject) ! renderer.addPrimitive(new Point(w, p.x, p.y, p.z, param, getAttributes())); ! else { ! final Transform transform = currentAttributes.getTransform(); ! currentObjectInstanceList ! .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { ! public Primitive create(Attributes attributes) { ! return new Point( ! w, ! p.x, ! p.y, ! p.z, ! param, ! createAttributes(transform, attributes)); ! } ! }); } } } } --- 871,966 ---- } ! public void addBilinearPatch(final Map parameters) { if (inAreaLightSource) return; ! if (!inObject) ! renderer.addPrimitive(new BilinearPatch(parameters, getAttributes())); ! else { ! final Transform transform = currentAttributes.getTransform(); ! currentObjectInstanceList ! .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { ! public Primitive create(Attributes attributes) { ! return new BilinearPatch( ! parameters, ! createAttributes(transform, attributes)); ! } ! }); ! } ! } ! ! public void addPoints(final Map parameters) { ! if (inAreaLightSource) ! return; ! Parameter pParam = (Parameter) parameters.get("P"); ! parameters.remove("P"); ! Parameter widthParam = (Parameter) parameters.get("width"); ! parameters.remove("width"); ! Parameter constantWidthParam = (Parameter) parameters.get("constantwidth"); ! parameters.remove("constantwidth"); ! Parameter csParam = (Parameter) parameters.get("Cs"); ! parameters.remove("Cs"); ! Parameter osParam = (Parameter) parameters.get("Os"); ! parameters.remove("Os"); ! Point3f[][] points = (Point3f[][]) pParam.getData(); ! float[][] widths; ! if (widthParam != null) ! widths = (float[][]) widthParam.getData(); ! else ! widths = (float[][]) constantWidthParam.getData(); ! Color3f[][] Cs = null; ! Declaration CsDecl = null; ! if (csParam != null) { ! Cs = (Color3f[][]) csParam.getData(); ! CsDecl = csParam.getDeclaration(); ! } ! Color3f[][] Os = null; ! Declaration OsDecl = null; ! if (osParam != null) { ! Os = (Color3f[][]) osParam.getData(); ! OsDecl = osParam.getDeclaration(); ! } ! for (int i = 0; i < points.length; i++) { ! final Point3f p = points[i][0]; ! float tw; if (widthParam != null) ! tw = widths[i][0]; else ! tw = widths[0][0]; ! final float w = tw; ! Map tparam; ! if (Cs == null && Os == null) ! tparam = parameters; ! else { ! tparam = new HashMap(parameters); ! if (Cs != null) { ! Color3f[][] cs = new Color3f[1][]; ! cs[0] = Cs[i]; ! tparam.put("Cs", new Parameter(CsDecl, cs)); } ! if (Os != null) { ! Color3f[][] os = new Color3f[1][]; ! os[0] = Os[i]; ! tparam.put("Os", new Parameter(OsDecl, os)); } } + final Map param = tparam; + if (!inObject) + renderer.addPrimitive(new Point(w, p.x, p.y, p.z, param, getAttributes())); + else { + final Transform transform = currentAttributes.getTransform(); + currentObjectInstanceList + .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { + public Primitive create(Attributes attributes) { + return new Point( + w, + p.x, + p.y, + p.z, + param, + createAttributes(transform, attributes)); + } + }); + } } + } } |