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: Elmer G. <ega...@us...> - 2004-04-18 20:04:58
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24756/src/org/jrman/parser Modified Files: Parser.java Log Message: Added NuPatch support. Currently it works partially, I need to do more tests. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** Parser.java 16 Apr 2004 03:47:26 -0000 1.88 --- Parser.java 18 Apr 2004 20:04:49 -0000 1.89 *************** *** 72,75 **** --- 72,76 ---- import org.jrman.parser.keywords.KeywordParser; import org.jrman.primitive.BicubicPatch; + import org.jrman.primitive.NuPatch; import org.jrman.primitive.BilinearPatch; import org.jrman.primitive.Cone; *************** *** 92,95 **** --- 93,105 ---- import org.jrman.util.Constants; + import org.jrman.parameters.VaryingScalarHPoint; + + import javax.vecmath.Point4f; + + import java.util.List; + import java.util.ArrayList; + import java.util.Iterator; + + public class Parser { *************** *** 137,140 **** --- 147,152 ---- private int lastFrame = -1; + + private static Point4f P = new Point4f(); public static class State { *************** *** 942,946 **** if (!inObject) { BicubicPatch patch = new BicubicPatch(parameters, getAttributes()); - patch.applyBasis(); renderer.addPrimitive(patch); } else { --- 954,957 ---- *************** *** 951,955 **** BicubicPatch patch = new BicubicPatch(parameters, createAttributes(transform, attributes)); - patch.applyBasis(); return patch; } --- 962,965 ---- *************** *** 1079,1082 **** --- 1089,1103 ---- } + private void print(float[] array) + { + System.out.print("("); + + for(int i = 0; i < array.length - 1; i ++) + System.out.print(array[i] + ", "); + + System.out.print(array[array.length - 1]); + System.out.println(")"); + } + public void addNuPatch( final int nu, *************** *** 1085,1112 **** final float umin, final float umax, ! final int vu, final int vorder, final float[] vknot, final float vmin, final float vmax, ! final ParameterList parameterList) { if (inAreaLightSource) return; ! if (!inObject) { ! //NuPatch patch = new NuPatch(parameters, getAttributes()); ! //renderer.addPrimitive(patch); ! } else { ! final Transform transform = currentAttributes.getTransform(); ! currentObjectInstanceList ! .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { ! public Primitive create(Attributes attributes) { ! //NuPatch patch = ! //new NuPatch(parameters, createAttributes(transform, attributes)); ! //return patch; ! return null; ! } ! }); } } public void addPointsPolygons( --- 1106,1257 ---- final float umin, final float umax, ! final int nv, final int vorder, final float[] vknot, final float vmin, final float vmax, ! final ParameterList parameters) { if (inAreaLightSource) return; ! ! float[] points = extractPoints(nu * nv, parameters); ! ! float[] ualfa = insert(uknot, uorder, nu); ! float[] valfa = insert(vknot, vorder, nv); ! ! int mu = ualfa.length /nu; ! int mv = valfa.length /nv; ! ! float[] result = new float[mu * mv * 4]; ! ! for(int i = 0; i < nv; i++) ! { ! divide(ualfa, points, nu, i, result, mu); } + + for(int i = 0; i < mu; i++) + { + divide(valfa, result, nv, i, result, mv); + } + + for(int i = 0; i < result.length / 4; i++) + { + int pos = i * 4; + result[pos] = result[pos]; + result[pos + 1] = result[pos + 1]; + result[pos + 2] = result[pos + 2]; + result[pos + 3] = result[pos + 3]; + } + + parameters.addParameter(new VaryingScalarHPoint + (new Declaration("Pw", "vertex hpoint"), result)); + + addBicubicPatchMesh(mu, "periodic", mv, "nonperiodic", parameters); } + + private float[] insert(float[] x, int order, int n) + { + List l = new ArrayList(); + float prev = x[0]; + for(int i = 0; i < x.length; i++) + { + if(x[i] != prev) + { + insert(l, prev, order); + prev = x[i]; + + } + } + insert(l, prev, order); + + float[] y = new float[l.size()]; + int c = 0; + for(Iterator it = l.iterator(); it.hasNext(); c++) + { + y[c] = ((Float) it.next()).floatValue(); + } + + int m = y.length - order; + + float[] result = new float[m * n]; + + for(int j = 0; j < m; j++) + { + for(int i = 0; i < n; i++) + { + float alfa = evaluate(x, y, i, j, order, ""); + result[(j * n) + i] = alfa; + } + } + return result; + } + + + private void divide(float[] alfa, float[] points, int n, int offset, + float[] result, int m) + { + int noffset = n * offset * 4; + int moffset = m * offset * 4; + + for(int j = 0; j < m; j++) + { + for(int i = 0; i < n; i++) + { + float a = alfa[(j * n) + i]; + result[moffset + j * 4] += points[noffset + i * 4] * a; + result[moffset + j * 4 + 1] += points[noffset + i * 4 + 1] * a; + result[moffset + j * 4 + 2] += points[noffset + i * 4+ 2] * a; + result[moffset + j * 4 + 3] += points[noffset + i * 4+ 3] * a; + } + } + } + + + private float evaluate(float[] x, float[] y, int i, int j, int k, String indent) + { + if(k == 1) + if(x[i] <= y[j] && y[j] < x[i+1]) + return 1; + else + return 0; + + float a1 = evaluate(x, y, i, j, k - 1, indent + " ") ; + float a2 = evaluate(x, y, i + 1, j, k - 1, indent + " "); + + return ( a1 != 0 ? ((y[j + k - 1] - x[i]) / (x[i + k - 1] - x[i])) : 0) + + (a2 != 0 ? ((x[i + k] - y[j + k - 1]) / (x[i + k] - x[i + 1])) : 0); + } + + private void insert(List l, float x, int order) + { + Float f = new Float(x); + for(int c = 0; c < order ; c++) + l.add(f); + } + + private float[] extractPoints(int points, ParameterList parameters) { + VaryingScalarTuple3f param3f = (VaryingScalarTuple3f) parameters.getParameter("P"); + + if(param3f != null) + { + parameters.removeParameter("P"); + parameters.addParameter(new VaryingScalarHPoint + (new Declaration("Pw", "vertex hpoint"), param3f)); + } + VaryingScalarHPoint paramHp = (VaryingScalarHPoint) parameters.getParameter("Pw"); + parameters.removeParameter("Pw"); + + float[] controlPoints = new float[points * 4]; + for(int i = 0; i < points; i ++) + { + paramHp.getValue(i, P); + controlPoints[(4 * i)] = P.x; + controlPoints[(4 * i) + 1] = P.y; + controlPoints[(4 * i) + 2] = P.z; + controlPoints[(4 * i) + 3] = P.w; + } + return controlPoints; + } + public void addPointsPolygons( |
From: Elmer G. <ega...@us...> - 2004-04-18 20:04:57
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24756/sampleData Modified Files: vase.rib Added Files: testNu.rib Log Message: Added NuPatch support. Currently it works partially, I need to do more tests. --- NEW FILE: testNu.rib --- Display "bicubic" "framebuffer" "rgba" PixelFilter "gaussian" 2 2 Format 400 300 1 PixelSamples 4 4 Exposure 1 2.2 Projection "perspective" "fov" [20] WorldBegin Translate 0 0 20 Rotate 205 1 0 0 LightSource "ambientlight" 1 "intensity" [0.2] LightSource "distantlight" 2 "intensity" [0.8] "from" [-10 -10 10] "to" [0 0 0] ShadingRate .25 # Surface "paintedplastic" "texturename" "checkerboard.txr" NuPatch 9 3 [ 0 0 0 1 1 2 2 3 3 4 4 4 ] 0 4 2 2 [ 0 0 1 1 ] 0 1 "Pw" [ 1 0 0 1 1 1 0 1 0 2 0 2 -1 1 0 1 -1 0 0 1 -1 -1 0 1 0 -2 0 2 1 -1 0 1 1 0 0 1 1 0 -3 1 1 1 -3 1 0 2 -6 2 -1 1 -3 1 -1 0 -3 1 -1 -1 -3 1 0 -2 -6 2 1 -1 -3 1 1 0 -3 1 ] WorldEnd Index: vase.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/vase.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** vase.rib 8 Apr 2003 20:02:30 -0000 1.1 --- vase.rib 18 Apr 2004 20:04:49 -0000 1.2 *************** *** 8,10 **** NuPatch 11 3 [0 0 0 0.0833333 0.0833333 0.333333 0.333333 0.583333 0.583333 0.833333 0.833333 1 1 1] 0.000000 1.000000 20 3 [0 0 0 0.0555556 0.111111 0.166667 0.222222 0.277778 0.333333 0.388889 0.444444 0.5 0.555556 0.611111 0.666667 0.722222 0.777778 0.833333 0.888889 0.944444 1 1 1] 0.000000 1.000000 "Pw" [0 0 0 0.869825 0 0 0 0.902369 0 0 0 1 0 0 0 0.707107 0 0 0 1 0 0 0 0.707107 0 0 0 1 0 0 0 0.707107 0 0 0 1 0 0 0 0.804738 0 0 0 0.869825 2.1269 3.79357 0 0.869825 1.17851 4.51184 0 0.902369 0 5 0 1 -3.53553 3.53553 0 0.707107 -5 3.06152e-016 0 1 -3.53553 -3.53553 0 0.707107 -6.12303e-016 -5 0 1 3.53553 -3.53553 0 0.707107 5 -9.18455e-016 0 1 4.02369 2.35702 0 0.804738 2.1269 3.79357 0 0.869825 12.1872 21.7372 0 4.9841 6.75287 25.8529 0 5.17057 0 28.65 0 5.73 -20.2586 20.2586 0 4.05172 -28.65 1.75425e-015 0 5.73 -20.2586 -20.2586 0 4.05172 -3.5085e-015 -28.65 0 5.73 20.2586 -20.2586 0 4.05172 28.65 -5.26275e-015 0 5.73 23.0557 13.5057 0 4.61115 12.1872 21.7372 0 4.9841 2.1269 3.79357 0.260948 0.869825 1.17851 4.51184 0.270711 0.902369 0 5 0.3 1 -3.53553 3.53553 0.212132 0.707107 -5 3.06152e-016 0.3 1 -3.53553 -3.53553 0.212132 0.707107 -6.12303e-016 -5 0.3 1 3.53553 -3.53553 0.212132 0.707107 5 -9.18455e-016 0.3 1 4.02369 2.35702 0.241421 0.804738 2.1269 3.79357 0.260948 0.869825 6.38071 11.3807 0.782843 2.60948 3.53553 13.5355 0.812132 2.70711 0 15 0.9 3 -10.6066 10.6066 0.636396 2.12132 -15 9.18455e-016 0.9 3 -10.6066 -10.6066 0.636396 2.12132 -1.83691e-015 -15 0.9 3 10.6066 -10.6066 0.636396 2.12132 15 -2.75536e-015 0.9 3 12.0711 7.07107 0.724264 2.41421 6.38071 11.3807 0.782843 2.60948 2.72244 4.85577 2.0006 0.869825 1.50849 5.77516 2.07545 0.902369 0 6.4 2.3 1 -4.52548 4.52548 1.62635 0.707107 -6.4 3.91874e-016 2.3 1 -4.52548 -4.52548 1.62635 0.707107 -7.83748e-016 -6.4 2.3 1 4.52548 -4.52548 1.62635 0.707107 6.4 -1.17562e-015 2.3 1 5.15032 3.01699 1.8509 0.804738 2.72244 4.85577 2.0006 0.869825 2.97767 5.311 4.34913 0.869825 1.64992 6.31658 4.51184 0.902369 0 7 5 1 -4.94975 4.94975 3.53553 0.707107 -7 4.28612e-016 5 1 -4.94975 -4.94975 3.53553 0.707107 -8.57224e-016 -7 5 1 4.94975 -4.94975 3.53553 0.707107 7 -1.28584e-015 5 1 5.63316 3.29983 4.02369 0.804738 2.97767 5.311 4.34913 0.869825 2.55228 4.55228 6.9586 0.869825 1.41421 5.41421 7.21895 0.902369 0 6 8 1 -4.24264 4.24264 5.65685 0.707107 -6 3.67382e-016 8 1 -4.24264 -4.24264 5.65685 0.707107 -7.34764e-016 -6 8 1 4.24264 -4.24264 5.65685 0.707107 6 -1.10215e-015 8 1 4.82843 2.82843 6.4379 0.804738 2.55228 4.55228 6.9586 0.869825 1.27614 2.27614 8.69825 0.869825 0.707107 2.70711 9.02369 0.902369 0 3 10 1 -2.12132 2.12132 7.07107 0.707107 -3 1.83691e-016 10 1 -2.12132 -2.12132 7.07107 0.707107 -3.67382e-016 -3 10 1 2.12132 -2.12132 7.07107 0.707107 3 -5.51073e-016 10 1 2.41421 1.41421 8.04738 0.804738 1.27614 2.27614 8.69825 0.869825 1.27614 2.27614 10.4379 0.869825 0.707107 2.70711 10.8284 0.902369 0 3 12 1 -2.12132 2.12132 8.48528 0.707107 -3 1.83691e-016 12 1 -2.12132 -2.12132 8.48528 0.707107 -3.67382e-016 -3 12 1 2.12132 -2.12132 8.48528 0.707107 3 -5.51073e-016 12 1 2.41421 1.41421 9.65685 0.804738 1.27614 2.27614 10.4379 0.869825 1.44629 2.57963 10.4379 0.869825 0.801388 3.06805 10.8284 0.902369 0 3.4 12 1 -2.40416 2.40416 8.48528 0.707107 -3.4 2.08183e-016 12 1 -2.40416 -2.40416 8.48528 0.707107 -4.16366e-016 -3.4 12 1 2.40416 -2.40416 8.48528 0.707107 3.4 -6.24549e-016 12 1 2.73611 1.60278 9.65685 0.804738 1.44629 2.57963 10.4379 0.869825 1.44629 2.57963 11.3077 0.869825 0.801388 3.06805 11.7308 0.902369 0 3.4 13 1 -2.40416 2.40416 9.19239 0.707107 -3.4 2.08183e-016 13 1 -2.40416 -2.40416 9.19239 0.707107 -4.16366e-016 -3.4 13 1 2.40416 -2.40416 9.19239 0.707107 3.4 -6.24549e-016 13 1 2.73611 1.60278 10.4616 0.804738 1.44629 2.57963 11.3077 0.869825 1.19107 2.1244 11.3077 0.869825 0.659966 2.52663 11.7308 0.902369 0 2.8 13 1 -1.9799 1.9799 9.19239 0.707107 -2.8 1.71445e-016 13 1 -1.9799 -1.9799 9.19239 0.707107 -3.4289e-016 -2.8 13 1 1.9799 -1.9799 9.19239 0.707107 2.8 -5.14335e-016 13 1 2.25327 1.31993 10.4616 0.804738 1.19107 2.1244 11.3077 0.869825 1.19107 2.1244 10.4379 0.869825 0.659966 2.52663 10.8284 0.902369 0 2.8 12 1 -1.9799 1.9799 8.48528 0.707107 -2.8 1.71445e-016 12 1 -1.9799 -1.9799 8.48528 0.707107 -3.4289e-016 -2.8 12 1 1.9799 -1.9799 8.48528 0.707107 2.8 -5.14335e-016 12 1 2.25327 1.31993 9.65685 0.804738 1.19107 2.1244 10.4379 0.869825 1.14853 2.04853 8.78523 0.869825 0.636396 2.4364 9.11393 0.902369 0 2.7 10.1 1 -1.90919 1.90919 7.14178 0.707107 -2.7 1.65322e-016 10.1 1 -1.90919 -1.90919 7.14178 0.707107 -3.30644e-016 -2.7 10.1 1 1.90919 -1.90919 7.14178 0.707107 2.7 -4.95966e-016 10.1 1 2.17279 1.27279 8.12785 0.804738 1.14853 2.04853 8.78523 0.869825 2.38213 4.2488 6.9586 0.869825 1.31993 5.05327 7.21895 0.902369 0 5.6 8 1 -3.9598 3.9598 5.65685 0.707107 -5.6 3.4289e-016 8 1 -3.9598 -3.9598 5.65685 0.707107 -6.8578e-016 -5.6 8 1 3.9598 -3.9598 5.65685 0.707107 5.6 -1.02867e-015 8 1 4.50653 2.63987 6.4379 0.804738 2.38213 4.2488 6.9586 0.869825 2.80751 5.00751 4.34913 0.869825 1.55563 5.95564 4.51184 0.902369 0 6.6 5 1 -4.6669 4.6669 3.53553 0.707107 -6.6 4.0412e-016 5 1 -4.6669 -4.6669 3.53553 0.707107 -8.0824e-016 -6.6 5 1 4.6669 -4.6669 3.53553 0.707107 6.6 -1.21236e-015 5 1 5.31127 3.11127 4.02369 0.804738 2.80751 5.00751 4.34913 0.869825 2.59482 4.62816 2.43551 0.869825 1.43778 5.50445 2.52663 0.902369 0 6.1 2.8 1 -4.31335 4.31335 1.9799 0.707107 -6.1 3.73505e-016 2.8 1 -4.31335 -4.31335 1.9799 0.707107 -7.4701e-016 -6.1 2.8 1 4.31335 -4.31335 1.9799 0.707107 6.1 -1.12051e-015 2.8 1 4.9089 2.87557 2.25327 0.804738 2.59482 4.62816 2.43551 0.869825 1.99929 3.56596 0.34793 0.869825 1.1078 4.24113 0.360948 0.902369 0 4.7 0.4 1 -3.3234 3.3234 0.282843 0.707107 -4.7 2.87782e-016 0.4 1 -3.3234 -3.3234 0.282843 0.707107 -5.75565e-016 -4.7 0.4 1 3.3234 -3.3234 0.282843 0.707107 4.7 -8.63347e-016 0.4 1 3.78227 2.2156 0.321895 0.804738 1.99929 3.56596 0.34793 0.869825 0 0 0.173965 0.869825 0 0 0.180474 0.902369 0 0 0.2 1 0 0 0.141421 0.707107 0 0 0.2 1 0 0 0.141421 0.707107 0 0 0.2 1 0 0 0.141421 0.707107 0 0 0.2 1 0 0 0.160948 0.804738 0 0 0.173965 0.869825 ] AttributeEnd - --- 8,9 ---- |
From: Gerardo H. <ma...@us...> - 2004-04-16 05:11:41
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7806/sampleData Modified Files: TextureTest.rib testBicubic.rib DinningRoom.rib Log Message: MakeTexture -> "box" 1 1 Index: DinningRoom.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/DinningRoom.rib,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DinningRoom.rib 10 Jul 2003 14:48:26 -0000 1.14 --- DinningRoom.rib 16 Apr 2004 05:11:28 -0000 1.15 *************** *** 1,10 **** ! MakeTexture "brick.jpg" "brick.txr" "periodic" "periodic" "gaussian" 2 2 ! MakeTexture "woo12.jpg" "woo12.txr" "periodic" "periodic" "gaussian" 2 2 ! MakeTexture "rattan.gif" "rattan.txr" "periodic" "periodic" "gaussian" 2 2 ! MakeTexture "mosaic.gif" "mosaic.txr" "periodic" "periodic" "gaussian" 2 2 ! MakeTexture "gradient.png" "gradient.txr" "periodic" "periodic" "gaussian" 2 2 ! MakeTexture "marb2.gif" "marb2.txr" "periodic" "periodic" "gaussian" 2 2 ! MakeTexture "marble7.gif" "marble7.txr" "periodic" "periodic" "gaussian" 2 2 ! MakeTexture "clay.gif" "clay.txr" "periodic" "periodic" "gaussian" 2 2 Display "TableReflection.png" "file" "rgba" --- 1,10 ---- ! MakeTexture "brick.jpg" "brick.txr" "periodic" "periodic" "box" 1 1 ! MakeTexture "woo12.jpg" "woo12.txr" "periodic" "periodic" "box" 1 1 ! MakeTexture "rattan.gif" "rattan.txr" "periodic" "periodic" "box" 1 1 ! MakeTexture "mosaic.gif" "mosaic.txr" "periodic" "periodic" "box" 1 1 ! MakeTexture "gradient.png" "gradient.txr" "periodic" "periodic" "box" 1 1 ! MakeTexture "marb2.gif" "marb2.txr" "periodic" "periodic" "box" 1 1 ! MakeTexture "marble7.gif" "marble7.txr" "periodic" "periodic" "box" 1 1 ! MakeTexture "clay.gif" "clay.txr" "periodic" "periodic" "box" 1 1 Display "TableReflection.png" "file" "rgba" *************** *** 132,136 **** MakeTexture "TableReflection.png" "TableReflection.txr" ! "periodic" "periodic" "gaussian" 2 2 Display "FloorReflection.png" "file" "rgba" --- 132,136 ---- MakeTexture "TableReflection.png" "TableReflection.txr" ! "periodic" "periodic" "box" 1 1 Display "FloorReflection.png" "file" "rgba" *************** *** 262,266 **** WorldEnd MakeTexture "FloorReflection.png" "FloorReflection.txr" ! "periodic" "periodic" "gaussian" 2 2 #Display "DinningRoom.png" "file" "rgba" --- 262,266 ---- WorldEnd MakeTexture "FloorReflection.png" "FloorReflection.txr" ! "periodic" "periodic" "box" 1 1 #Display "DinningRoom.png" "file" "rgba" Index: testBicubic.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/testBicubic.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testBicubic.rib 23 Mar 2004 14:03:38 -0000 1.4 --- testBicubic.rib 16 Apr 2004 05:11:28 -0000 1.5 *************** *** 1,5 **** Display "bicubic" "framebuffer" "rgba" PixelFilter "gaussian" 2 2 ! Format 400 300 1 PixelSamples 4 4 Exposure 1 2.2 --- 1,5 ---- Display "bicubic" "framebuffer" "rgba" PixelFilter "gaussian" 2 2 ! Format 800 600 1 PixelSamples 4 4 Exposure 1 2.2 *************** *** 17,31 **** AttributeEnd ShadingRate .25 ! # Surface "paintedplastic" "texturename" "checkerboard.txr" Basis "bezier" 2 "bezier" 2 Patch "bicubic" "Pw" [ -3 -3 0 1 -1 -3 0 1 1 -3 0 1 3 -3 0 1 ! -3 -1 0 1 -1 -1 -5 100 1 -1 1 1 3 -1 0 1 -3 1 0 1 -1 1 1 1 1 1 1 1 3 1 0 1 -3 3 0 1 -1 3 0 1 1 3 -1 1 3 3 0 1 ] ! "s" [0 4 0 4] ! "t" [0 0 4 4] WorldEnd --- 17,31 ---- AttributeEnd ShadingRate .25 ! Surface "paintedplastic" "texturename" "checkerboard.txr" "uniform float blur" 0 Basis "bezier" 2 "bezier" 2 Patch "bicubic" "Pw" [ -3 -3 0 1 -1 -3 0 1 1 -3 0 1 3 -3 0 1 ! -3 -1 0 1 -1 -1 -5 1 1 -1 1 1 3 -1 0 1 -3 1 0 1 -1 1 1 1 1 1 1 1 3 1 0 1 -3 3 0 1 -1 3 0 1 1 3 -1 1 3 3 0 1 ] ! # "s" [0 3.99 0 3.99] ! # "t" [0 0 3.99 3.99] WorldEnd Index: TextureTest.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/TextureTest.rib,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TextureTest.rib 13 Apr 2004 20:37:03 -0000 1.11 --- TextureTest.rib 16 Apr 2004 05:11:28 -0000 1.12 *************** *** 12,17 **** Patch "bilinear" "P" [-1 -1 2 -1 1 2 1 -1 2 1 1 2] WorldEnd ! MakeTexture "checkerboard.png" "checkerboard.txr" "periodic" "periodic" "gaussian" 2 2 ! MakeTexture "mandrill.jpg" "mandrill.txr" "periodic" "periodic" "gaussian" 2 2 Declare "blur" "uniform float" Format 512 384 1 --- 12,17 ---- Patch "bilinear" "P" [-1 -1 2 -1 1 2 1 -1 2 1 1 2] WorldEnd ! MakeTexture "checkerboard.png" "checkerboard.txr" "periodic" "periodic" "box" 1 1 ! MakeTexture "mandrill.jpg" "mandrill.txr" "periodic" "periodic" "box" 1 1 Declare "blur" "uniform float" Format 512 384 1 |
From: Gerardo H. <ma...@us...> - 2004-04-16 03:47:34
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26956/sampleData Modified Files: space.rib Log Message: Fixed bug in PatchMesh Index: space.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/space.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** space.rib 25 Jun 2003 17:14:05 -0000 1.4 --- space.rib 16 Apr 2004 03:47:26 -0000 1.5 *************** *** 6,10 **** Display "Space.png" "framebuffer" "rgb" Format 800 600 1 ! PixelSamples 4 4 Exposure 1 2.2 ScreenWindow -400 400 -300 300 --- 6,10 ---- Display "Space.png" "framebuffer" "rgb" Format 800 600 1 ! PixelSamples 8 8 Exposure 1 2.2 ScreenWindow -400 400 -300 300 *************** *** 12,15 **** --- 12,16 ---- Translate 0 0 1000 WorldBegin + ShadingRate .25 LightSource "distantlight" 1 "from" [1 0 -1] "to" [0 0 0] LightSource "ambientlight" 2 "intensity" .1 *************** *** 50,53 **** --- 51,55 ---- AttributeBegin + LightSource "ambientlight" 3 "intensity" 1 Patch "bilinear" "P" [-400 -300 1000 -400 300 1000 400 -300 1000 400 300 100] |
From: Gerardo H. <ma...@us...> - 2004-04-16 03:47:34
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26956/src/org/jrman/parser Modified Files: Parser.java Log Message: Fixed bug in PatchMesh Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** Parser.java 12 Apr 2004 05:05:57 -0000 1.87 --- Parser.java 16 Apr 2004 03:47:26 -0000 1.88 *************** *** 990,994 **** if (vWrap.equals("periodic")) nV = nv; ! else if (uWrap.equals("nonperiodic")) nV = nv - 1; else --- 990,994 ---- if (vWrap.equals("periodic")) nV = nv; ! else if (vWrap.equals("nonperiodic")) nV = nv - 1; else *************** *** 1027,1031 **** if (vWrap.equals("periodic")) nV = nv / vStep; ! else if (uWrap.equals("nonperiodic")) nV = (nv - 4) / vStep + 1; else --- 1027,1031 ---- if (vWrap.equals("periodic")) nV = nv / vStep; ! else if (vWrap.equals("nonperiodic")) nV = (nv - 4) / vStep + 1; else |
From: Gerardo H. <ma...@us...> - 2004-04-13 20:51:09
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28272/sampleData Modified Files: TextureTest.rib teapot.rib Log Message: Fixed area calculation for Mipmapped textures. Added "blur" Index: TextureTest.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/TextureTest.rib,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TextureTest.rib 8 Apr 2004 21:29:26 -0000 1.10 --- TextureTest.rib 13 Apr 2004 20:37:03 -0000 1.11 *************** *** 14,20 **** MakeTexture "checkerboard.png" "checkerboard.txr" "periodic" "periodic" "gaussian" 2 2 MakeTexture "mandrill.jpg" "mandrill.txr" "periodic" "periodic" "gaussian" 2 2 Format 512 384 1 Display "TextureTest" "framebuffer" "rgba" ! PixelSamples 4 4 Exposure 1 2.2 ScreenWindow -1.33 1.33 -1 1 --- 14,21 ---- MakeTexture "checkerboard.png" "checkerboard.txr" "periodic" "periodic" "gaussian" 2 2 MakeTexture "mandrill.jpg" "mandrill.txr" "periodic" "periodic" "gaussian" 2 2 + Declare "blur" "uniform float" Format 512 384 1 Display "TextureTest" "framebuffer" "rgba" ! PixelSamples 8 8 Exposure 1 2.2 ScreenWindow -1.33 1.33 -1 1 *************** *** 30,34 **** 1000 -5 0 1000 -5 1000] ! "texturename" "mandrill.txr" TextureCoordinates 0 0 0 1000 1000 0 1000 1000 Patch "bilinear" "P" [-1000 5 0 --- 31,35 ---- 1000 -5 0 1000 -5 1000] ! "texturename" "mandrill.txr" TextureCoordinates 0 0 0 1000 1000 0 1000 1000 Patch "bilinear" "P" [-1000 5 0 *************** *** 36,39 **** 1000 5 0 1000 5 1000] ! "texturename" "checkerboard.txr" WorldEnd --- 37,40 ---- 1000 5 0 1000 5 1000] ! "texturename" "checkerboard.txr" "blur" 0 WorldEnd Index: teapot.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/teapot.rib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** teapot.rib 13 Feb 2004 06:46:24 -0000 1.2 --- teapot.rib 13 Apr 2004 20:37:03 -0000 1.3 *************** *** 19,29 **** Color [1 1 1] Surface "paintedplastic" "roughness" .01 ! "texturename" "brick.txr" ! Displacement "noisetest" "uniform float noisescale" 2 ! "uniform integer noiseoctaves" 4 ! "uniform float Km" 0.15 ! Attribute "displacementbound" "sphere" 0.15 AttributeBegin ShadingRate .25 Basis "bezier" 3 "bezier" 3 PatchMesh "bicubic" 13 "nonperiodic" 10 "nonperiodic" "P" [1.5 0 0 1.5 0.828427 0 0.828427 1.5 0 0 1.5 0 -0.828427 1.5 0 -1.5 0.828427 0 -1.5 0 0 -1.5 -0.828427 0 -0.828427 -1.5 0 0 -1.5 0 0.828427 -1.5 0 1.5 -0.828427 0 1.5 0 0 1.5 0 0.075 1.5 0.828427 0.075 0.828427 1.5 0.075 0 1.5 0.075 -0.828427 1.5 0.075 -1.5 0.828427 0.075 -1.5 0 0.075 -1.5 -0.828427 0.075 -0.828427 -1.5 0.075 0 -1.5 0.075 0.828427 -1.5 0.075 1.5 -0.828427 0.075 1.5 0 0.075 2 0 0.3 2 1.10457 0.3 1.10457 2 0.3 0 2 0.3 -1.10457 2 0.3 -2 1.10457 0.3 -2 0 0.3 -2 -1.10457 0.3 -1.10457 -2 0.3 0 -2 0.3 1.10457 -2 0.3 2 -1.10457 0.3 2 0 0.3 2 0 0.75 2 1.10457 0.75 1.10457 2 0.75 0 2 0.75 -1.10457 2 0.75 -2 1.10457 0.75 -2 0 0.75 -2 -1.10457 0.75 -1.10457 -2 0.75 0 -2 0.75 1.10457 -2 0.75 2 -1.10457 0.75 2 0 0.75 2 0 1.2 2 1.10457 1.2 1.10457 2 1.2 0 2 1.2 -1.10457 2 1.2 -2 1.10457 1.2 -2 0 1.2 -2 -1.10457 1.2 -1.10457 -2 1.2 0 -2 1.2 1.10457 -2 1.2 2 -1.10457 1.2 2 0 1.2 1.75 0 1.725 1.75 0.966498 1.725 0.966498 1.75 1.725 0 1.75 1.725 -0.966498 1.75 1.725 -1.75 0.966498 1.725 -1.75 0 1.725 -1.75 -0.966498 1.725 -0.966498 -1.75 1.725 0 -1.75 1.725 0.966498 -1.75 1.725 1.75 -0.966498 1.725 1.75 0 1.725 1.5 0 2.25 1.5 0.828427 2.25 0.828427 1.5 2.25 0 1.5 2.25 -0.828427 1.5 2.25 -1.5 0.828427 2.25 -1.5 0 2.25 -1.5 -0.828427 2.25 -0.828427 -1.5 2.25 0 -1.5 2.25 0.828427 -1.5 2.25 1.5 -0.828427 2.25 1.5 0 2.25 1.4375 0 2.38125 1.4375 0.793909 2.38125 0.793909 1.4375 2.38125 0 1.4375 2.38125 -0.793909 1.4375 2.38125 -1.4375 0.793909 2.38125 -1.4375 0 2.38125 -1.4375 -0.793909 2.38125 -0.793909 -1.4375 2.38125 0 -1.4375 2.38125 0.793909 -1.4375 2.38125 1.4375 -0.793909 2.38125 1.4375 0 2.38125 1.3375 0 2.38125 1.3375 0.738681 2.38125 0.738681 1.3375 2.38125 0 1.3375 2.38125 -0.738681 1.3375 2.38125 -1.3375 0.738681 2.38125 -1.3375 0 2.38125 -1.3375 -0.738681 2.38125 -0.738681 -1.3375 2.38125 0 -1.3375 2.38125 0.738681 -1.3375 2.38125 1.3375 -0.738681 2.38125 1.3375 0 2.38125 1.4 0 2.25 1.4 0.773198 2.25 0.773198 1.4 2.25 0 1.4 2.25 -0.773198 1.4 2.25 -1.4 0.773198 2.25 -1.4 0 2.25 -1.4 -0.773198 2.25 -0.773198 -1.4 2.25 0 -1.4 2.25 0.773198 -1.4 2.25 1.4 -0.773198 2.25 1.4 0 2.25 ] --- 19,30 ---- Color [1 1 1] Surface "paintedplastic" "roughness" .01 ! "texturename" "mandrill.txr" ! #Displacement "noisetest" "uniform float noisescale" 2 ! # "uniform integer noiseoctaves" 4 ! # "uniform float Km" 0.15 ! #Attribute "displacementbound" "sphere" 0.15 AttributeBegin ShadingRate .25 + TextureCoordinates 4 4 0 4 4 0 0 0 Basis "bezier" 3 "bezier" 3 PatchMesh "bicubic" 13 "nonperiodic" 10 "nonperiodic" "P" [1.5 0 0 1.5 0.828427 0 0.828427 1.5 0 0 1.5 0 -0.828427 1.5 0 -1.5 0.828427 0 -1.5 0 0 -1.5 -0.828427 0 -0.828427 -1.5 0 0 -1.5 0 0.828427 -1.5 0 1.5 -0.828427 0 1.5 0 0 1.5 0 0.075 1.5 0.828427 0.075 0.828427 1.5 0.075 0 1.5 0.075 -0.828427 1.5 0.075 -1.5 0.828427 0.075 -1.5 0 0.075 -1.5 -0.828427 0.075 -0.828427 -1.5 0.075 0 -1.5 0.075 0.828427 -1.5 0.075 1.5 -0.828427 0.075 1.5 0 0.075 2 0 0.3 2 1.10457 0.3 1.10457 2 0.3 0 2 0.3 -1.10457 2 0.3 -2 1.10457 0.3 -2 0 0.3 -2 -1.10457 0.3 -1.10457 -2 0.3 0 -2 0.3 1.10457 -2 0.3 2 -1.10457 0.3 2 0 0.3 2 0 0.75 2 1.10457 0.75 1.10457 2 0.75 0 2 0.75 -1.10457 2 0.75 -2 1.10457 0.75 -2 0 0.75 -2 -1.10457 0.75 -1.10457 -2 0.75 0 -2 0.75 1.10457 -2 0.75 2 -1.10457 0.75 2 0 0.75 2 0 1.2 2 1.10457 1.2 1.10457 2 1.2 0 2 1.2 -1.10457 2 1.2 -2 1.10457 1.2 -2 0 1.2 -2 -1.10457 1.2 -1.10457 -2 1.2 0 -2 1.2 1.10457 -2 1.2 2 -1.10457 1.2 2 0 1.2 1.75 0 1.725 1.75 0.966498 1.725 0.966498 1.75 1.725 0 1.75 1.725 -0.966498 1.75 1.725 -1.75 0.966498 1.725 -1.75 0 1.725 -1.75 -0.966498 1.725 -0.966498 -1.75 1.725 0 -1.75 1.725 0.966498 -1.75 1.725 1.75 -0.966498 1.725 1.75 0 1.725 1.5 0 2.25 1.5 0.828427 2.25 0.828427 1.5 2.25 0 1.5 2.25 -0.828427 1.5 2.25 -1.5 0.828427 2.25 -1.5 0 2.25 -1.5 -0.828427 2.25 -0.828427 -1.5 2.25 0 -1.5 2.25 0.828427 -1.5 2.25 1.5 -0.828427 2.25 1.5 0 2.25 1.4375 0 2.38125 1.4375 0.793909 2.38125 0.793909 1.4375 2.38125 0 1.4375 2.38125 -0.793909 1.4375 2.38125 -1.4375 0.793909 2.38125 -1.4375 0 2.38125 -1.4375 -0.793909 2.38125 -0.793909 -1.4375 2.38125 0 -1.4375 2.38125 0.793909 -1.4375 2.38125 1.4375 -0.793909 2.38125 1.4375 0 2.38125 1.3375 0 2.38125 1.3375 0.738681 2.38125 0.738681 1.3375 2.38125 0 1.3375 2.38125 -0.738681 1.3375 2.38125 -1.3375 0.738681 2.38125 -1.3375 0 2.38125 -1.3375 -0.738681 2.38125 -0.738681 -1.3375 2.38125 0 -1.3375 2.38125 0.738681 -1.3375 2.38125 1.3375 -0.738681 2.38125 1.3375 0 2.38125 1.4 0 2.25 1.4 0.773198 2.25 0.773198 1.4 2.25 0 1.4 2.25 -0.773198 1.4 2.25 -1.4 0.773198 2.25 -1.4 0 2.25 -1.4 -0.773198 2.25 -0.773198 -1.4 2.25 0 -1.4 2.25 0.773198 -1.4 2.25 1.4 -0.773198 2.25 1.4 0 2.25 ] |
From: Gerardo H. <ma...@us...> - 2004-04-13 20:51:09
|
Update of /cvsroot/jrman/drafts/src/org/jrman/shaders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28272/src/org/jrman/shaders Modified Files: SurfacePaintedplastic.java SurfaceReflectivepaintedplastic.java DisplacementBumpy.java Log Message: Fixed area calculation for Mipmapped textures. Added "blur" Index: DisplacementBumpy.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/DisplacementBumpy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DisplacementBumpy.java 17 Jan 2004 01:10:13 -0000 1.5 --- DisplacementBumpy.java 13 Apr 2004 20:37:03 -0000 1.6 *************** *** 39,42 **** --- 39,44 ---- defaultParameters.addParameter( new UniformScalarString(new Declaration("texturename", "string"), "")); + defaultParameters.addParameter( + new UniformScalarFloat(new Declaration("blur", "uniform float"),0f)); } *************** *** 48,53 **** (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); if (!texturename.equals("")) ! fg1.texture(texturename, sv.s, sv.t, 0); else fg1.set(0f); --- 50,57 ---- (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); + UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); + final float blur = paramBlur.getValue(); if (!texturename.equals("")) ! fg1.texture(texturename, sv.s, sv.t, blur, 0); else fg1.set(0f); Index: SurfacePaintedplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfacePaintedplastic.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SurfacePaintedplastic.java 20 Dec 2003 15:35:05 -0000 1.5 --- SurfacePaintedplastic.java 13 Apr 2004 20:37:03 -0000 1.6 *************** *** 61,64 **** --- 61,66 ---- defaultParameters.addParameter( new UniformScalarString(new Declaration("texturename", "string"), "")); + defaultParameters.addParameter( + new UniformScalarFloat(new Declaration("blur", "uniform float"), 0f)); } *************** *** 79,82 **** --- 81,86 ---- (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); + UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); + final float blur = paramBlur.getValue(); vg1.normalize(sv.N); vg1.faceforward(vg1, sv.I); *************** *** 93,97 **** cg1.mul(cg1, sv.Cs); if (!texturename.equals("")) { ! cg2.texture(texturename, sv.s, sv.t); cg1.mul(cg1, cg2); } --- 97,101 ---- cg1.mul(cg1, sv.Cs); if (!texturename.equals("")) { ! cg2.texture(texturename, sv.s, sv.t, blur); cg1.mul(cg1, cg2); } Index: SurfaceReflectivepaintedplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/shaders/SurfaceReflectivepaintedplastic.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SurfaceReflectivepaintedplastic.java 25 Nov 2003 16:34:08 -0000 1.3 --- SurfaceReflectivepaintedplastic.java 13 Apr 2004 20:37:03 -0000 1.4 *************** *** 74,77 **** --- 74,81 ---- defaultParameters.addParameter( new UniformScalarString(new Declaration("rtexturename", "string"), "")); + defaultParameters.addParameter( + new UniformScalarFloat(new Declaration("blur", "uniform float"), 0f)); + defaultParameters.addParameter( + new UniformScalarFloat(new Declaration("rblur", "uniform float"), 0f)); } *************** *** 95,98 **** --- 99,106 ---- (UniformScalarString) getParameter(sv, "rtexturename"); final String rtexturename = paramRtexturename.getValue(); + UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); + final float blur = paramBlur.getValue(); + UniformScalarFloat paramRblur = (UniformScalarFloat) getParameter(sv, "rblur"); + final float rblur = paramRblur.getValue(); vg1.normalize(sv.N); vg1.faceforward(vg1, sv.I); *************** *** 109,113 **** cg1.mul(cg1, sv.Cs); if (!texturename.equals("")) { ! cg2.texture(texturename, sv.s, sv.t); cg1.mul(cg1, cg2); } --- 117,121 ---- cg1.mul(cg1, sv.Cs); if (!texturename.equals("")) { ! cg2.texture(texturename, sv.s, sv.t, blur); cg1.mul(cg1, cg2); } *************** *** 124,128 **** s_NDC.xcomp(P_NDC); t_NDC.ycomp(P_NDC); ! cg2.texture(rtexturename, s_NDC, t_NDC); cg1.add(cg1, cg2); } --- 132,136 ---- s_NDC.xcomp(P_NDC); t_NDC.ycomp(P_NDC); ! cg2.texture(rtexturename, s_NDC, t_NDC, rblur); cg1.add(cg1, cg2); } |
From: Gerardo H. <ma...@us...> - 2004-04-13 20:51:09
|
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28272/src Modified Files: SurfaceAlphaplastic.java Log Message: Fixed area calculation for Mipmapped textures. Added "blur" Index: SurfaceAlphaplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceAlphaplastic.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfaceAlphaplastic.java 17 Jan 2004 01:10:13 -0000 1.2 --- SurfaceAlphaplastic.java 13 Apr 2004 20:37:03 -0000 1.3 *************** *** 63,66 **** --- 63,68 ---- defaultParameters.addParameter( new UniformScalarString(new Declaration("texturename", "string"), "")); + defaultParameters.addParameter( + new UniformScalarFloat(new Declaration("blur", "uniform float"), 0f)); } *************** *** 81,84 **** --- 83,88 ---- (UniformScalarString) getParameter(sv, "texturename"); final String texturename = paramTexturename.getValue(); + UniformScalarFloat paramBlur = (UniformScalarFloat) getParameter(sv, "blur"); + final float blur = paramBlur.getValue(); vg1.normalize(sv.N); vg1.faceforward(vg1, sv.I); *************** *** 95,99 **** cg1.mul(cg1, sv.Cs); if (!texturename.equals("")) { ! cg2.texture(texturename, sv.s, sv.t); cg1.mul(cg1, cg2); } --- 99,103 ---- cg1.mul(cg1, sv.Cs); if (!texturename.equals("")) { ! cg2.texture(texturename, sv.s, sv.t, blur); cg1.mul(cg1, cg2); } *************** *** 105,109 **** cg1.add(cg1, cg2); if (!texturename.equals("")) { ! fg.texture(texturename, sv.s, sv.t, 3); sv.Oi.set(fg); } --- 109,113 ---- cg1.add(cg1, cg2); if (!texturename.equals("")) { ! fg.texture(texturename, sv.s, sv.t, blur, 3); sv.Oi.set(fg); } |
From: Gerardo H. <ma...@us...> - 2004-04-13 20:51:08
|
Update of /cvsroot/jrman/drafts/src/org/jrman/grid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28272/src/org/jrman/grid Modified Files: Color3fGrid.java FloatGrid.java Log Message: Fixed area calculation for Mipmapped textures. Added "blur" Index: Color3fGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/Color3fGrid.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Color3fGrid.java 25 Oct 2003 05:46:46 -0000 1.8 --- Color3fGrid.java 13 Apr 2004 20:37:02 -0000 1.9 *************** *** 25,43 **** public class Color3fGrid extends Tuple3fGrid { ! private static float[] mmData = new float[4]; ! private static Color3f tmpc = new Color3f(); ! private static void getColor( ! MipMap texture, ! float s, ! float t, ! float area, ! Color3f out) { ! texture.getData(s, t, area, mmData); ! out.x = mmData[0]; ! out.y = mmData[1]; ! out.z = mmData[2]; } --- 25,38 ---- public class Color3fGrid extends Tuple3fGrid { ! private static float[] mmData = new float[4]; ! private static Color3f tmpc = new Color3f(); ! private static void getColor(MipMap texture, float s, float t, float area, Color3f out) { ! texture.getData(s, t, area, mmData); ! out.x = mmData[0]; ! out.y = mmData[1]; ! out.z = mmData[2]; } *************** *** 56,60 **** */ ! public void texture(String textureName, FloatGrid s, FloatGrid t) { MipMap texture = MipMap.getMipMap(textureName); for (int v = 0; v < vSize; v++) --- 51,55 ---- */ ! public void texture(String textureName, FloatGrid s, FloatGrid t, float blur) { MipMap texture = MipMap.getMipMap(textureName); for (int v = 0; v < vSize; v++) *************** *** 67,74 **** v1 = v - 1; float area = ! Math.abs(s.get(u1, v1) - s.get(u, v)) ! * Math.abs(t.get(u1, v1) - t.get(u, v)); ! getColor(texture, s.get(u, v), t.get(u, v), area, tmpc); ! set(u, v, tmpc); } } --- 62,75 ---- v1 = v - 1; float area = ! ((s.get(u, v) + s.get(u1, v)) * (t.get(u, v) - t.get(u1, v)) ! + (s.get(u1, v) + s.get(u1, v1)) * (t.get(u1, v) - t.get(u1, v1)) ! + (s.get(u1, v1) + s.get(u, v1)) * (t.get(u1, v1) - t.get(u, v1)) ! + (s.get(u, v1) + s.get(u, v)) * (t.get(u, v1) - t.get(u, v))) ! / 2f; ! area = Math.abs(area) + blur; ! float avgS = (s.get(u, v) + s.get(u1, v) + s.get(u1, v1) + s.get(u, v1)) / 4f; ! float avgT = (t.get(u, v) + t.get(u1, v) + t.get(u1, v1) + t.get(u, v1)) / 4f; ! getColor(texture, avgS, avgT, area, tmpc); ! set(u, v, tmpc); } } Index: FloatGrid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/grid/FloatGrid.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** FloatGrid.java 8 Feb 2004 08:54:55 -0000 1.24 --- FloatGrid.java 13 Apr 2004 20:37:02 -0000 1.25 *************** *** 1530,1534 **** */ ! public void texture(String textureName, FloatGrid s, FloatGrid t, int band) { MipMap texture = MipMap.getMipMap(textureName); for (int v = 0; v < vSize; v++) --- 1530,1534 ---- */ ! public void texture(String textureName, FloatGrid s, FloatGrid t, float blur, int band) { MipMap texture = MipMap.getMipMap(textureName); for (int v = 0; v < vSize; v++) *************** *** 1541,1547 **** v1 = v - 1; float area = ! Math.abs(s.get(u1, v) - s.get(u, v)) ! * Math.abs(t.get(u, v1) - t.get(u, v)); ! set(u, v, getFloat(texture, s.get(u, v), t.get(u, v), area, band)); } } --- 1541,1553 ---- v1 = v - 1; float area = ! ((s.get(u, v) + s.get(u1, v)) * (t.get(u, v) - t.get(u1, v)) ! + (s.get(u1, v) + s.get(u1, v1)) * (t.get(u1, v) - t.get(u1, v1)) ! + (s.get(u1, v1) + s.get(u, v1)) * (t.get(u1, v1) - t.get(u, v1)) ! + (s.get(u, v1) + s.get(u, v)) * (t.get(u, v1) - t.get(u, v))) ! / 2f; ! area = Math.abs(area) + blur; ! float avgS = (s.get(u, v) + s.get(u1, v) + s.get(u1, v1) + s.get(u, v1)) / 4f; ! float avgT = (t.get(u, v) + t.get(u1, v) + t.get(u1, v1) + t.get(u, v1)) / 4f; ! set(u, v, getFloat(texture, avgS, avgT, area, band)); } } |
From: Gerardo H. <ma...@us...> - 2004-04-12 05:19:42
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6063/src/org/jrman/parser Modified Files: Parser.java Log Message: Correct handling of s and t parameters in polygons. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** Parser.java 12 Apr 2004 04:37:26 -0000 1.86 --- Parser.java 12 Apr 2004 05:05:57 -0000 1.87 *************** *** 66,69 **** --- 66,70 ---- import org.jrman.parameters.UniformScalarInteger; import org.jrman.parameters.UniformScalarString; + import org.jrman.parameters.VaryingArrayFloat; import org.jrman.parameters.VaryingScalarFloat; import org.jrman.parameters.VaryingScalarTuple3f; *************** *** 1115,1118 **** --- 1116,1120 ---- if (inAreaLightSource) return; + setPolygonST(parameters); if (!inObject) renderer.addPrimitive( *************** *** 1133,1137 **** --- 1135,1153 ---- } + private void setPolygonST(ParameterList parameters) { + VaryingScalarFloat sParam = (VaryingScalarFloat) parameters.getParameter("s"); + VaryingScalarFloat tParam = (VaryingScalarFloat) parameters.getParameter("t"); + VaryingArrayFloat stParam = (VaryingArrayFloat) parameters.getParameter("st"); + VaryingScalarTuple3f pParam = (VaryingScalarTuple3f) parameters.getParameter("P"); + if (sParam == null && stParam == null) + parameters.addParameter(pParam.extract(Global.getDeclaration("s"), 0)); + if (tParam == null && stParam == null) + parameters.addParameter(pParam.extract(Global.getDeclaration("t"), 1)); + } + public void addPolygon(final ParameterList parameters) { + if (inAreaLightSource) + return; + setPolygonST(parameters); VaryingScalarTuple3f pParam = (VaryingScalarTuple3f) parameters.getParameter("P"); int[] uniformIndex = new int[1]; |
From: Gerardo H. <ma...@us...> - 2004-04-12 05:19:42
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6063/src/org/jrman/primitive Modified Files: Primitive.java Log Message: Correct handling of s and t parameters in polygons. Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Primitive.java 12 Apr 2004 04:37:24 -0000 1.32 --- Primitive.java 12 Apr 2004 05:05:56 -0000 1.33 *************** *** 255,264 **** VaryingArrayFloat stParam = (VaryingArrayFloat) parameters.getParameter("st"); if (stParam != null) { ! float[] s = new float[4]; ! s[0] = stParam.getValue(0, 0); ! s[1] = stParam.getValue(1, 0); ! s[2] = stParam.getValue(2, 0); ! s[3] = stParam.getValue(3, 0); ! parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("s"), s)); } else { float[] s = new float[4]; --- 255,259 ---- VaryingArrayFloat stParam = (VaryingArrayFloat) parameters.getParameter("st"); if (stParam != null) { ! parameters.addParameter(stParam.extract(Global.getDeclaration("s"), 0)); } else { float[] s = new float[4]; *************** *** 275,284 **** VaryingArrayFloat stParam = (VaryingArrayFloat) parameters.getParameter("st"); if (stParam != null) { ! float[] t = new float[4]; ! t[0] = stParam.getValue(0, 1); ! t[1] = stParam.getValue(1, 1); ! t[2] = stParam.getValue(2, 1); ! t[3] = stParam.getValue(3, 1); ! parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("t"), t)); } else { float[] t = new float[4]; --- 270,274 ---- VaryingArrayFloat stParam = (VaryingArrayFloat) parameters.getParameter("st"); if (stParam != null) { ! parameters.addParameter(stParam.extract(Global.getDeclaration("t"), 1)); } else { float[] t = new float[4]; |
From: Gerardo H. <ma...@us...> - 2004-04-12 05:19:41
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6063/src/org/jrman/parameters Modified Files: VaryingArrayFloat.java VaryingScalarTuple3f.java Log Message: Correct handling of s and t parameters in polygons. Index: VaryingScalarTuple3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingScalarTuple3f.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** VaryingScalarTuple3f.java 11 Apr 2004 23:40:09 -0000 1.9 --- VaryingScalarTuple3f.java 12 Apr 2004 05:05:56 -0000 1.10 *************** *** 129,131 **** --- 129,138 ---- } + public VaryingScalarFloat extract(Declaration decl, int index) { + float[] newValues = new float[values.length / 3]; + for (int i = 0; i < newValues.length; i++) + newValues[i] = values[i * 3 + index]; + return new VaryingScalarFloat(decl, newValues); + } + } Index: VaryingArrayFloat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingArrayFloat.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** VaryingArrayFloat.java 11 Apr 2004 23:40:09 -0000 1.9 --- VaryingArrayFloat.java 12 Apr 2004 05:05:56 -0000 1.10 *************** *** 106,109 **** --- 106,117 ---- } } + + public VaryingScalarFloat extract(Declaration decl, int arrayIndex) { + int n = declaration.getCount(); + float[] newValues = new float[values.length / n]; + for (int i = 0; i < newValues.length; i++) + newValues[i] = values[i * n + arrayIndex]; + return new VaryingScalarFloat(decl, newValues); + } } |
From: Gerardo H. <ma...@us...> - 2004-04-12 04:51:11
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2165/src/org/jrman/primitive Modified Files: Primitive.java BicubicPatch.java Log Message: Correct handling of u, v, s and t parameters in bicubic patches and patch meshes. Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Primitive.java 8 Apr 2004 21:29:25 -0000 1.31 --- Primitive.java 12 Apr 2004 04:37:24 -0000 1.32 *************** *** 40,46 **** 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"); private static Color3f c0 = new Color3f(); --- 40,46 ---- public abstract class Primitive implements Comparable { ! private static Declaration U_DECL = new Declaration("u", "varying float"); ! private static Declaration V_DECL = new Declaration("v", "varying float"); private static Color3f c0 = new Color3f(); Index: BicubicPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/BicubicPatch.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** BicubicPatch.java 29 Mar 2004 16:47:31 -0000 1.11 --- BicubicPatch.java 12 Apr 2004 04:37:24 -0000 1.12 *************** *** 103,107 **** private static Point3f P3F = new Point3f(); ! private static Vector4f vtmp = new Vector4f(); --- 103,107 ---- private static Point3f P3F = new Point3f(); ! private static Vector4f vtmp = new Vector4f(); *************** *** 116,127 **** private void extractPoints() { VaryingScalarTuple3f param3f = (VaryingScalarTuple3f) parameters.getParameter("P"); ! ! if(param3f != null) ! { parameters.removeParameter("P"); ! parameters.addParameter(new VaryingScalarHPoint(new Declaration("Pw", "vertex hpoint"), param3f)); } VaryingScalarHPoint paramHp = (VaryingScalarHPoint) parameters.getParameter("Pw"); ! paramHp.getValue(0, P00); paramHp.getValue(1, P10); --- 116,127 ---- private void extractPoints() { VaryingScalarTuple3f param3f = (VaryingScalarTuple3f) parameters.getParameter("P"); ! ! if (param3f != null) { parameters.removeParameter("P"); ! parameters.addParameter( ! new VaryingScalarHPoint(new Declaration("Pw", "vertex hpoint"), param3f)); } VaryingScalarHPoint paramHp = (VaryingScalarHPoint) parameters.getParameter("Pw"); ! paramHp.getValue(0, P00); paramHp.getValue(1, P10); *************** *** 161,170 **** param.setValue(15, P33); } ! public void applyBasis() { extractPoints(); Matrix4f hu = attributes.getUBasis().getToBezier(); Matrix4f hv = attributes.getVBasis().getToBezier(); ! applyBasis(P00, P10, P20, P30, hu); applyBasis(P01, P11, P21, P31, hu); --- 161,170 ---- param.setValue(15, P33); } ! public void applyBasis() { extractPoints(); Matrix4f hu = attributes.getUBasis().getToBezier(); Matrix4f hv = attributes.getVBasis().getToBezier(); ! applyBasis(P00, P10, P20, P30, hu); applyBasis(P01, P11, P21, P31, hu); *************** *** 176,189 **** applyBasis(P20, P21, P22, P23, hv); applyBasis(P30, P31, P32, P33, hv); ! setPoints(); } ! ! private void applyBasis( ! Point4f p0, ! Point4f p1, ! Point4f p2, ! Point4f p3, ! Matrix4f h) { applyBasis(p0.x, p1.x, p2.x, p3.x, h, PV0); p0.x = PV0.x; --- 176,184 ---- applyBasis(P20, P21, P22, P23, hv); applyBasis(P30, P31, P32, P33, hv); ! setPoints(); } ! ! private void applyBasis(Point4f p0, Point4f p1, Point4f p2, Point4f p3, Matrix4f h) { applyBasis(p0.x, p1.x, p2.x, p3.x, h, PV0); p0.x = PV0.x; *************** *** 208,219 **** } ! ! private void applyBasis(float p0, float p1, float p2, float p3, Matrix4f hu, ! Point4f result) { PV1.set(p0, p1, p2, p3); ! hu.transform(PV1, result); } - - public BoundingVolume getBoundingVolume() { --- 203,216 ---- } ! private void applyBasis( ! float p0, ! float p1, ! float p2, ! float p3, ! Matrix4f hu, ! Point4f result) { PV1.set(p0, p1, p2, p3); ! hu.transform(PV1, result); } public BoundingVolume getBoundingVolume() { *************** *** 241,246 **** public Primitive[] split() { Primitive[] result = new Primitive[2]; - parameters.removeParameter("u"); - parameters.removeParameter("v"); extractPoints(); vtmp.sub(P30, P00); --- 238,241 ---- *************** *** 273,280 **** protected ParameterList bezierInterpolateParameters( ! float uv00, ! float uv10, ! float uv01, ! float uv11) { ParameterList result = linearInterpolateParameters(uv00, uv10, uv01, uv11); extractPoints(); --- 268,275 ---- protected ParameterList bezierInterpolateParameters( ! float uv00, ! float uv10, ! float uv01, ! float uv11) { ParameterList result = linearInterpolateParameters(uv00, uv10, uv01, uv11); extractPoints(); *************** *** 323,334 **** protected void splitLower( ! Point4f in0, ! Point4f in1, ! Point4f in2, ! Point4f in3, ! Point4f out0, ! Point4f out1, ! Point4f out2, ! Point4f out3) { out0.set(in0); out1.add(in0, in1); --- 318,329 ---- protected void splitLower( ! Point4f in0, ! Point4f in1, ! Point4f in2, ! Point4f in3, ! Point4f out0, ! Point4f out1, ! Point4f out2, ! Point4f out3) { out0.set(in0); out1.add(in0, in1); *************** *** 347,358 **** protected void splitUpper( ! Point4f in0, ! Point4f in1, ! Point4f in2, ! Point4f in3, ! Point4f out0, ! Point4f out1, ! Point4f out2, ! Point4f out3) { out3.set(in3); out2.add(in3, in2); --- 342,353 ---- protected void splitUpper( ! Point4f in0, ! Point4f in1, ! Point4f in2, ! Point4f in3, ! Point4f out0, ! Point4f out1, ! Point4f out2, ! Point4f out3) { out3.set(in3); out2.add(in3, in2); *************** *** 373,403 **** 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++) { ! Calc.bezierInterpolate( ! P00, ! P10, ! P20, ! P30, ! P01, ! P11, ! P21, ! P31, ! P02, ! P12, ! P22, ! P32, ! P03, ! P13, ! P23, ! P33, ! udata[i], ! vdata[i], ! PS00); ! P3F.x = PS00.x / PS00.w; ! P3F.y = PS00.y / PS00.w; ! P3F.z = PS00.z / PS00.w; ! pdata[i].set(P3F); } } --- 368,408 ---- extractPoints(); Point3f[] pdata = (Point3f[]) sv.P.data; ! int nu = Grid.getUSize(); ! int nv = Grid.getVSize(); ! float uStep = 1f / (nu - 1); ! float vStep = 1f / (nv - 1); ! float fv = 0f; ! int offset = 0; ! for (int v = 0; v < nv; v++) { ! float fu = 0f; ! for (int u = 0; u < nu; u++) { ! Calc.bezierInterpolate( ! P00, ! P10, ! P20, ! P30, ! P01, ! P11, ! P21, ! P31, ! P02, ! P12, ! P22, ! P32, ! P03, ! P13, ! P23, ! P33, ! fu, ! fv, ! PS00); ! P3F.x = PS00.x / PS00.w; ! P3F.y = PS00.y / PS00.w; ! P3F.z = PS00.z / PS00.w; ! pdata[offset + u].set(P3F); ! fu += uStep; ! } ! fv += vStep; ! offset += nu; } } |
From: Gerardo H. <ma...@us...> - 2004-04-12 04:51:11
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2165/src/org/jrman/parser Modified Files: Parser.java Log Message: Correct handling of u, v, s and t parameters in bicubic patches and patch meshes. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** Parser.java 12 Apr 2004 00:06:08 -0000 1.85 --- Parser.java 12 Apr 2004 04:37:26 -0000 1.86 *************** *** 1,4 **** /* ! * Parser.java Copyright (C) 2003 Gerardo Horvilleur Martinez * * This program is free software; you can redistribute it and/or modify it --- 1,4 ---- /* ! * Parser.java Copyright (C) 2003, 2004 Gerardo Horvilleur Martinez * * This program is free software; you can redistribute it and/or modify it *************** *** 961,964 **** --- 961,976 ---- } + private void setPatchMeshDefaultParameters(int nu, int nv, ParameterList parameters) { + Primitive.setDefaultParameters(parameters, getAttributes()); + VaryingScalarFloat p = (VaryingScalarFloat) parameters.getParameter("u"); + p.expandTo(nu, nv); + p = (VaryingScalarFloat) parameters.getParameter("v"); + p.expandTo(nu, nv); + p = (VaryingScalarFloat) parameters.getParameter("s"); + p.expandTo(nu, nv); + p = (VaryingScalarFloat) parameters.getParameter("t"); + p.expandTo(nu, nv); + } + public void addBilinearPatchMesh( int nu, *************** *** 981,984 **** --- 993,997 ---- else throw new IllegalArgumentException("Unknown v wrap type: " + vWrap); + setPatchMeshDefaultParameters(nu, nv, parameters); int[] uniformIndex = new int[1]; uniformIndex[0] = 0; *************** *** 1017,1020 **** --- 1030,1044 ---- else throw new IllegalArgumentException("Unknown v wrap type: " + vWrap); + int blnu; + if (uWrap.equals("periodic")) + blnu = nU; + else + blnu = nU + 1; + int blnv; + if (vWrap.equals("periodic")) + blnv = nV; + else + blnv = nV + 1; + setPatchMeshDefaultParameters(blnu, blnv, parameters); int[] uniformIndex = new int[1]; uniformIndex[0] = 0; *************** *** 1024,1032 **** for (int jj = 0; jj < nV; jj++) { int i = 0; ! for (int ii = 0; ii < nV; ii++) { ! varyingIndexes[0] = evalIndex(ii, nU, jj, nV); ! varyingIndexes[1] = evalIndex(ii + 1, nU, jj, nV); ! varyingIndexes[2] = evalIndex(ii, nU, jj + 1, nV); ! varyingIndexes[3] = evalIndex(ii + 1, nU, jj + 1, nV); vertexIndexes[0] = evalIndex(i, nu, j, nv); vertexIndexes[1] = evalIndex(i + 1, nu, j, nv); --- 1048,1056 ---- for (int jj = 0; jj < nV; jj++) { int i = 0; ! for (int ii = 0; ii < nU; ii++) { ! varyingIndexes[0] = evalIndex(ii, blnu, jj, blnv); ! varyingIndexes[1] = evalIndex(ii + 1, blnu, jj, blnv); ! varyingIndexes[2] = evalIndex(ii, blnu, jj + 1, blnv); ! varyingIndexes[3] = evalIndex(ii + 1, blnu, jj + 1, blnv); vertexIndexes[0] = evalIndex(i, nu, j, nv); vertexIndexes[1] = evalIndex(i + 1, nu, j, nv); *************** *** 1045,1049 **** vertexIndexes[14] = evalIndex(i + 2, nu, j + 3, nv); vertexIndexes[15] = evalIndex(i + 3, nu, j + 3, nv); ! addBicubicPatch(parameters.selectValues(uniformIndex, varyingIndexes, vertexIndexes)); uniformIndex[0]++; i += uStep; --- 1069,1074 ---- vertexIndexes[14] = evalIndex(i + 2, nu, j + 3, nv); vertexIndexes[15] = evalIndex(i + 3, nu, j + 3, nv); ! addBicubicPatch( ! parameters.selectValues(uniformIndex, varyingIndexes, vertexIndexes)); uniformIndex[0]++; i += uStep; *************** *** 1145,1149 **** final float w = tw; indexes[0] = i; ! final ParameterList param = parameters.selectValues(uniformIndex, indexes, indexes); if (!inObject) renderer.addPrimitive(new Point(w, p.x, p.y, p.z, param, getAttributes())); --- 1170,1175 ---- final float w = tw; indexes[0] = i; ! final ParameterList param = ! parameters.selectValues(uniformIndex, indexes, indexes); if (!inObject) renderer.addPrimitive(new Point(w, p.x, p.y, p.z, param, getAttributes())); |
From: Gerardo H. <ma...@us...> - 2004-04-12 04:51:11
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2165/src/org/jrman/parameters Modified Files: VaryingScalarFloat.java Declaration.java Log Message: Correct handling of u, v, s and t parameters in bicubic patches and patch meshes. Index: Declaration.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/Declaration.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Declaration.java 11 Apr 2004 23:40:09 -0000 1.5 --- Declaration.java 12 Apr 2004 04:37:25 -0000 1.6 *************** *** 261,265 **** return new UniformArrayInteger(this, getInts(numbers, arraySize)); } else if (storageClass == StorageClass.UNIFORM) { ! return new UniformArrayInteger(this, getInts(numbers, arraySize)); } else throw new IllegalArgumentException("Can't handle varying integer: " + this); --- 261,268 ---- return new UniformArrayInteger(this, getInts(numbers, arraySize)); } else if (storageClass == StorageClass.UNIFORM) { ! if (arraySize == 1) ! return new UniformScalarInteger(this, (int) numbers[0]); ! else ! return new UniformArrayInteger(this, getInts(numbers, arraySize)); } else throw new IllegalArgumentException("Can't handle varying integer: " + this); *************** *** 271,275 **** return new UniformArrayString(this, getStrings(strings, arraySize)); } else if (storageClass == StorageClass.UNIFORM) { ! return new UniformArrayString(this, getStrings(strings, arraySize)); } else throw new IllegalArgumentException("Can't handle varying string: " + this); --- 274,281 ---- return new UniformArrayString(this, getStrings(strings, arraySize)); } else if (storageClass == StorageClass.UNIFORM) { ! if (arraySize == 1) ! return new UniformScalarString(this, strings[0]); ! else ! return new UniformArrayString(this, getStrings(strings, arraySize)); } else throw new IllegalArgumentException("Can't handle varying string: " + this); Index: VaryingScalarFloat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingScalarFloat.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** VaryingScalarFloat.java 11 Apr 2004 23:40:09 -0000 1.7 --- VaryingScalarFloat.java 12 Apr 2004 04:37:25 -0000 1.8 *************** *** 26,30 **** public class VaryingScalarFloat extends Parameter { ! final private float[] values; public VaryingScalarFloat(Declaration declaration, float[] values) { --- 26,30 ---- public class VaryingScalarFloat extends Parameter { ! private float[] values; public VaryingScalarFloat(Declaration declaration, float[] values) { *************** *** 82,84 **** --- 82,103 ---- } + public void expandTo(int nu, int nv) { + if (values.length == 4) { + float[] newValues = new float[nu * nv]; + float uStep = 1f / (nu - 1); + float vStep = 1f / (nv - 1); + float fv = 0f; + for (int v = 0; v < nv; v++) { + float fu = 0f; + for (int u = 0; u < nu; u++) { + newValues[v * nu + u] = + Calc.interpolate(values[0], values[1], values[2], values[3], fu, fv); + fu += uStep; + } + fv += vStep; + } + values = newValues; + } + } + } |
From: Gerardo H. <ma...@us...> - 2004-04-12 00:19:54
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28060/src/org/jrman/parser Modified Files: Parser.java Log Message: Default width for Points. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Parser.java 9 Apr 2004 23:00:34 -0000 1.84 --- Parser.java 12 Apr 2004 00:06:08 -0000 1.85 *************** *** 95,100 **** private final static String KEYWORD_PREFIX = "org.jrman.parser.keywords.Keyword"; - private static Color3f tmpColor = new Color3f(); - private boolean inAreaLightSource; --- 95,98 ---- *************** *** 1141,1146 **** if (widthParam != null) tw = widthParam.getValue(i); ! else tw = constantWidthParam.getValue(); final float w = tw; indexes[0] = i; --- 1139,1146 ---- if (widthParam != null) tw = widthParam.getValue(i); ! else if (constantWidthParam != null) tw = constantWidthParam.getValue(); + else + tw = 1f; final float w = tw; indexes[0] = i; |
From: Gerardo H. <ma...@us...> - 2004-04-11 23:53:54
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23899/src/org/jrman/parameters Modified Files: VaryingArrayTuple3f.java VaryingArrayFloat.java VaryingArrayHPoint.java VaryingScalarHPoint.java VaryingScalarFloat.java VaryingScalarTuple3f.java UniformArrayString.java Declaration.java UniformArrayInteger.java Log Message: Implemented correct handling for multiple uniform arguments (PatchMesh, PointsPolygons, etc.) Index: UniformArrayString.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/UniformArrayString.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UniformArrayString.java 8 Apr 2004 21:03:32 -0000 1.6 --- UniformArrayString.java 11 Apr 2004 23:40:09 -0000 1.7 *************** *** 23,27 **** public class UniformArrayString extends Parameter { ! final private String[] values; --- 23,27 ---- public class UniformArrayString extends Parameter { ! final private String[] values; *************** *** 30,34 **** this.values = values; } ! public String getValue(int index) { return values[index]; --- 30,34 ---- this.values = values; } ! public String getValue(int index) { return values[index]; *************** *** 40,48 **** public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Parameter not diceable: " + declaration); } public Parameter selectValues(int[] indexes) { ! return this; } --- 40,56 ---- public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Parameter not diceable: " + declaration); } public Parameter selectValues(int[] indexes) { ! int n = declaration.getCount(); ! if (n == values.length) ! return this; ! if (n == 1) ! return new UniformScalarString(declaration, values[indexes[0]]); ! String[] newValues = new String[n]; ! for (int i = 0; i < n; i++) ! newValues[i] = values[indexes[0] + i]; ! return new UniformArrayString(declaration, newValues); } Index: Declaration.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/Declaration.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Declaration.java 14 Dec 2003 22:28:28 -0000 1.4 --- Declaration.java 11 Apr 2004 23:40:09 -0000 1.5 *************** *** 230,239 **** public Parameter buildParameter(float[] numbers, String[] strings, int arraySize) { if (type == Type.FLOAT) { ! if (storageClass == StorageClass.CONSTANT ! || storageClass == StorageClass.UNIFORM) { if (count == 1) return new UniformScalarFloat(this, numbers[0]); else return new UniformArrayFloat(this, getFloats(numbers, arraySize)); } else { if (count == 1) --- 230,251 ---- public Parameter buildParameter(float[] numbers, String[] strings, int arraySize) { if (type == Type.FLOAT) { ! if (storageClass == StorageClass.CONSTANT) { if (count == 1) return new UniformScalarFloat(this, numbers[0]); else return new UniformArrayFloat(this, getFloats(numbers, arraySize)); + } + if (storageClass == StorageClass.UNIFORM) { + if (count == 1) { + if (arraySize == 1) + return new UniformScalarFloat(this, numbers[0]); + else + return new VaryingScalarFloat(this, getFloats(numbers, arraySize)); + } else { + if (arraySize == count) + return new UniformArrayFloat(this, getFloats(numbers, arraySize)); + else + return new VaryingArrayFloat(this, getFloats(numbers, arraySize)); + } } else { if (count == 1) *************** *** 243,261 **** } } else if (type == Type.INTEGER) { ! if (storageClass == StorageClass.CONSTANT ! || storageClass == StorageClass.UNIFORM) { if (count == 1) return new UniformScalarInteger(this, (int) numbers[0]); else return new UniformArrayInteger(this, getInts(numbers, arraySize)); ! } } else if (type == Type.STRING) { ! if (storageClass == StorageClass.CONSTANT ! || storageClass == StorageClass.UNIFORM) { if (count == 1) return new UniformScalarString(this, strings[0]); else return new UniformArrayString(this, getStrings(strings, arraySize)); ! } } else if ( type == Type.COLOR --- 255,277 ---- } } else if (type == Type.INTEGER) { ! if (storageClass == StorageClass.CONSTANT) { if (count == 1) return new UniformScalarInteger(this, (int) numbers[0]); else return new UniformArrayInteger(this, getInts(numbers, arraySize)); ! } else if (storageClass == StorageClass.UNIFORM) { ! return new UniformArrayInteger(this, getInts(numbers, arraySize)); ! } else ! throw new IllegalArgumentException("Can't handle varying integer: " + this); } else if (type == Type.STRING) { ! if (storageClass == StorageClass.CONSTANT) { if (count == 1) return new UniformScalarString(this, strings[0]); else return new UniformArrayString(this, getStrings(strings, arraySize)); ! } else if (storageClass == StorageClass.UNIFORM) { ! return new UniformArrayString(this, getStrings(strings, arraySize)); ! } else ! throw new IllegalArgumentException("Can't handle varying string: " + this); } else if ( type == Type.COLOR *************** *** 263,272 **** || type == Type.VECTOR || type == Type.NORMAL) { ! if (storageClass == StorageClass.CONSTANT ! || storageClass == StorageClass.UNIFORM) { if (count == 1) return new UniformScalarTuple3f(this, numbers[0], numbers[1], numbers[2]); else return new UniformArrayTuple3f(this, getFloats(numbers, arraySize)); } else { if (count == 1) --- 279,303 ---- || type == Type.VECTOR || type == Type.NORMAL) { ! if (storageClass == StorageClass.CONSTANT) { if (count == 1) return new UniformScalarTuple3f(this, numbers[0], numbers[1], numbers[2]); else return new UniformArrayTuple3f(this, getFloats(numbers, arraySize)); + } else if (storageClass == StorageClass.UNIFORM) { + if (count == 1) { + if (arraySize == 3) + return new UniformScalarTuple3f( + this, + numbers[0], + numbers[1], + numbers[2]); + else + return new VaryingScalarTuple3f(this, getFloats(numbers, arraySize)); + } else { + if (arraySize == count * 3) + return new UniformArrayTuple3f(this, getFloats(numbers, arraySize)); + else + return new VaryingArrayTuple3f(this, getFloats(numbers, arraySize)); + } } else { if (count == 1) *************** *** 276,281 **** } } else if (type == Type.HPOINT) { ! if (storageClass == StorageClass.CONSTANT ! || storageClass == StorageClass.UNIFORM) { if (count == 1) return new UniformScalarHPoint( --- 307,311 ---- } } else if (type == Type.HPOINT) { ! if (storageClass == StorageClass.CONSTANT) { if (count == 1) return new UniformScalarHPoint( *************** *** 287,290 **** --- 317,337 ---- else return new UniformArrayHPoint(this, getFloats(numbers, arraySize)); + } else if (storageClass == StorageClass.UNIFORM) { + if (count == 1) { + if (arraySize == 4) + return new UniformScalarHPoint( + this, + numbers[0], + numbers[1], + numbers[2], + numbers[3]); + else + return new VaryingScalarHPoint(this, getFloats(numbers, arraySize)); + } else { + if (arraySize == count * 4) + return new UniformArrayHPoint(this, getFloats(numbers, arraySize)); + else + return new VaryingArrayHPoint(this, getFloats(numbers, arraySize)); + } } else { if (count == 1) Index: VaryingArrayHPoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingArrayHPoint.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** VaryingArrayHPoint.java 8 Apr 2004 21:03:32 -0000 1.6 --- VaryingArrayHPoint.java 11 Apr 2004 23:40:09 -0000 1.7 *************** *** 26,30 **** public class VaryingArrayHPoint extends Parameter { ! final private float[] values; --- 26,30 ---- public class VaryingArrayHPoint extends Parameter { ! final private float[] values; *************** *** 33,37 **** this.values = values; } ! public void getValue(int index, int arrayIndex, Tuple4f out) { int offset = (index * declaration.getCount() + arrayIndex) * 4; --- 33,37 ---- this.values = values; } ! public void getValue(int index, int arrayIndex, Tuple4f out) { int offset = (index * declaration.getCount() + arrayIndex) * 4; *************** *** 49,56 **** float[] newValues = new float[n * 16]; for (int i = 0; i < off1; i++) { ! newValues[i] = Calc.interpolate(values[i], values[off1 + i], values[off2 + i], values[off3 + i], uMin, vMin); ! newValues[off1 + i] = Calc.interpolate(values[i], values[off1 + i], values[off2 + i], values[off3 + i], uMax, vMin); ! newValues[off1 + i] = Calc.interpolate(values[i], values[off1 + i], values[off2 + i], values[off3 + i], uMin, vMax); ! newValues[off1 + i] = Calc.interpolate(values[i], values[off1 + i], values[off2 + i], values[off3 + i], uMax, vMax); } return new VaryingArrayHPoint(declaration, newValues); --- 49,84 ---- float[] newValues = new float[n * 16]; for (int i = 0; i < off1; i++) { ! newValues[i] = ! Calc.interpolate( ! values[i], ! values[off1 + i], ! values[off2 + i], ! values[off3 + i], ! uMin, ! vMin); ! newValues[off1 + i] = ! Calc.interpolate( ! values[i], ! values[off1 + i], ! values[off2 + i], ! values[off3 + i], ! uMax, ! vMin); ! newValues[off1 + i] = ! Calc.interpolate( ! values[i], ! values[off1 + i], ! values[off2 + i], ! values[off3 + i], ! uMin, ! vMax); ! newValues[off1 + i] = ! Calc.interpolate( ! values[i], ! values[off1 + i], ! values[off2 + i], ! values[off3 + i], ! uMax, ! vMax); } return new VaryingArrayHPoint(declaration, newValues); *************** *** 58,74 **** public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Dice array not implemented: " + declaration); } public Parameter selectValues(int[] indexes) { int n = declaration.getCount() * 4; ! float[] newValues = new float[indexes.length * n]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * n; ! int dstOffset = i * n; ! for (int e = 0; e < n; e++) ! newValues[dstOffset + e] = values[srcOffset + e]; } - return new VaryingArrayHPoint(declaration, newValues); } --- 86,111 ---- public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Dice array not implemented: " + declaration); } public Parameter selectValues(int[] indexes) { int n = declaration.getCount() * 4; ! if (declaration.getStorageClass() == Declaration.StorageClass.UNIFORM ! && indexes.length == 1) { ! float[] newValues = new float[n]; ! int offset = indexes[0] * n; ! for (int i = 0; i < n; i++) ! newValues[i] = values[offset + i]; ! return new UniformArrayHPoint(declaration, newValues); ! } else { ! float[] newValues = new float[indexes.length * n]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * n; ! int dstOffset = i * n; ! for (int e = 0; e < n; e++) ! newValues[dstOffset + e] = values[srcOffset + e]; ! } ! return new VaryingArrayHPoint(declaration, newValues); } } Index: VaryingScalarFloat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingScalarFloat.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** VaryingScalarFloat.java 8 Apr 2004 21:03:32 -0000 1.6 --- VaryingScalarFloat.java 11 Apr 2004 23:40:09 -0000 1.7 *************** *** 25,29 **** public class VaryingScalarFloat extends Parameter { ! final private float[] values; --- 25,29 ---- public class VaryingScalarFloat extends Parameter { ! final private float[] values; *************** *** 32,36 **** this.values = values; } ! public float getValue(int index) { return values[index]; --- 32,36 ---- this.values = values; } ! public float getValue(int index) { return values[index]; *************** *** 39,51 **** public Parameter linearInterpolate(float uMin, float uMax, float vMin, float vMax) { float[] newValues = new float[4]; ! newValues[0] = Calc.interpolate(values[0], values[1], values[2], values[3], uMin, vMin); ! newValues[1] = Calc.interpolate(values[0], values[1], values[2], values[3], uMax, vMin); ! newValues[2] = Calc.interpolate(values[0], values[1], values[2], values[3], uMin, vMax); ! newValues[3] = Calc.interpolate(values[0], values[1], values[2], values[3], uMax, vMax); return new VaryingScalarFloat(declaration, newValues); } public void linearDice(Grid grid) { ! FloatGrid g = (FloatGrid) grid; int uSize = Grid.getUSize(); int vSize = Grid.getVSize(); --- 39,55 ---- public Parameter linearInterpolate(float uMin, float uMax, float vMin, float vMax) { float[] newValues = new float[4]; ! newValues[0] = ! Calc.interpolate(values[0], values[1], values[2], values[3], uMin, vMin); ! newValues[1] = ! Calc.interpolate(values[0], values[1], values[2], values[3], uMax, vMin); ! newValues[2] = ! Calc.interpolate(values[0], values[1], values[2], values[3], uMin, vMax); ! newValues[3] = ! Calc.interpolate(values[0], values[1], values[2], values[3], uMax, vMax); return new VaryingScalarFloat(declaration, newValues); } public void linearDice(Grid grid) { ! FloatGrid g = (FloatGrid) grid; int uSize = Grid.getUSize(); int vSize = Grid.getVSize(); *************** *** 56,60 **** float v = 0f; for (int iv = 0; iv < vSize; iv++) { ! g.set(iu, iv, Calc.interpolate(values[0], values[1], values[2], values[3], u, v)); v += vStep; } --- 60,67 ---- float v = 0f; for (int iv = 0; iv < vSize; iv++) { ! g.set( ! iu, ! iv, ! Calc.interpolate(values[0], values[1], values[2], values[3], u, v)); v += vStep; } *************** *** 64,71 **** public Parameter selectValues(int[] indexes) { ! float[] newValues = new float[indexes.length]; ! for (int i = 0; i < indexes.length; i++) ! newValues[i] = values[indexes[i]]; ! return new VaryingScalarFloat(declaration, newValues); } --- 71,83 ---- public Parameter selectValues(int[] indexes) { ! if (declaration.getStorageClass() == Declaration.StorageClass.UNIFORM ! && indexes.length == 1) { ! return new UniformScalarFloat(declaration, values[indexes[0]]); ! } else { ! float[] newValues = new float[indexes.length]; ! for (int i = 0; i < indexes.length; i++) ! newValues[i] = values[indexes[i]]; ! return new VaryingScalarFloat(declaration, newValues); ! } } Index: VaryingScalarTuple3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingScalarTuple3f.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VaryingScalarTuple3f.java 8 Apr 2004 21:03:32 -0000 1.8 --- VaryingScalarTuple3f.java 11 Apr 2004 23:40:09 -0000 1.9 *************** *** 28,34 **** public class VaryingScalarTuple3f extends Parameter { ! private static Point3f tmp = new Point3f(); ! final private float[] values; --- 28,34 ---- public class VaryingScalarTuple3f extends Parameter { ! private static Point3f tmp = new Point3f(); ! final private float[] values; *************** *** 37,41 **** this.values = values; } ! public void getValue(int index, Tuple3f out) { out.x = values[index * 3]; --- 37,41 ---- this.values = values; } ! public void getValue(int index, Tuple3f out) { out.x = values[index * 3]; *************** *** 43,47 **** out.z = values[index * 3 + 2]; } ! public void setValue(int index, Tuple3f in) { values[index * 3] = in.x; --- 43,47 ---- out.z = values[index * 3 + 2]; } ! public void setValue(int index, Tuple3f in) { values[index * 3] = in.x; *************** *** 50,57 **** } ! public float getValue(int index){ return values[index]; } ! public int getCount() { return values.length / 3; --- 50,57 ---- } ! public float getValue(int index) { return values[index]; } ! public int getCount() { return values.length / 3; *************** *** 60,75 **** public Parameter linearInterpolate(float uMin, float uMax, float vMin, float vMax) { float[] newValues = new float[12]; ! newValues[0] = Calc.interpolate(values[0], values[3], values[6], values[9], uMin, vMin); ! newValues[1] = Calc.interpolate(values[1], values[4], values[7], values[10], uMin, vMin); ! newValues[2] = Calc.interpolate(values[2], values[5], values[8], values[11], uMin, vMin); ! newValues[3] = Calc.interpolate(values[0], values[3], values[6], values[9], uMax, vMin); ! newValues[4] = Calc.interpolate(values[1], values[4], values[7], values[10], uMax, vMin); ! newValues[5] = Calc.interpolate(values[2], values[5], values[8], values[11], uMax, vMin); ! newValues[6] = Calc.interpolate(values[0], values[3], values[6], values[9], uMin, vMax); ! newValues[7] = Calc.interpolate(values[1], values[4], values[7], values[10], uMin, vMax); ! newValues[8] = Calc.interpolate(values[2], values[5], values[8], values[11], uMin, vMax); ! newValues[9] = Calc.interpolate(values[0], values[3], values[6], values[9], uMax, vMax); ! newValues[10] = Calc.interpolate(values[1], values[4], values[7], values[10], uMax, vMax); ! newValues[11] = Calc.interpolate(values[2], values[5], values[8], values[11], uMax, vMax); return new VaryingScalarTuple3f(declaration, newValues); } --- 60,87 ---- public Parameter linearInterpolate(float uMin, float uMax, float vMin, float vMax) { float[] newValues = new float[12]; ! newValues[0] = ! Calc.interpolate(values[0], values[3], values[6], values[9], uMin, vMin); ! newValues[1] = ! Calc.interpolate(values[1], values[4], values[7], values[10], uMin, vMin); ! newValues[2] = ! Calc.interpolate(values[2], values[5], values[8], values[11], uMin, vMin); ! newValues[3] = ! Calc.interpolate(values[0], values[3], values[6], values[9], uMax, vMin); ! newValues[4] = ! Calc.interpolate(values[1], values[4], values[7], values[10], uMax, vMin); ! newValues[5] = ! Calc.interpolate(values[2], values[5], values[8], values[11], uMax, vMin); ! newValues[6] = ! Calc.interpolate(values[0], values[3], values[6], values[9], uMin, vMax); ! newValues[7] = ! Calc.interpolate(values[1], values[4], values[7], values[10], uMin, vMax); ! newValues[8] = ! Calc.interpolate(values[2], values[5], values[8], values[11], uMin, vMax); ! newValues[9] = ! Calc.interpolate(values[0], values[3], values[6], values[9], uMax, vMax); ! newValues[10] = ! Calc.interpolate(values[1], values[4], values[7], values[10], uMax, vMax); ! newValues[11] = ! Calc.interpolate(values[2], values[5], values[8], values[11], uMax, vMax); return new VaryingScalarTuple3f(declaration, newValues); } *************** *** 96,108 **** public Parameter selectValues(int[] indexes) { ! float[] newValues = new float[indexes.length * 3]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * 3; ! int dstOffset = i * 3; ! newValues[dstOffset] = values[srcOffset]; ! newValues[dstOffset + 1] = values[srcOffset + 1]; ! newValues[dstOffset + 2] = values[srcOffset + 2]; } - return new VaryingScalarTuple3f(declaration, newValues); } --- 108,130 ---- public Parameter selectValues(int[] indexes) { ! if (declaration.getStorageClass() == Declaration.StorageClass.UNIFORM ! && indexes.length == 1) { ! int offset = indexes[0] * 3; ! return new UniformScalarTuple3f( ! declaration, ! values[offset], ! values[offset + 1], ! values[offset + 2]); ! } else { ! float[] newValues = new float[indexes.length * 3]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * 3; ! int dstOffset = i * 3; ! newValues[dstOffset] = values[srcOffset]; ! newValues[dstOffset + 1] = values[srcOffset + 1]; ! newValues[dstOffset + 2] = values[srcOffset + 2]; ! } ! return new VaryingScalarTuple3f(declaration, newValues); } } Index: UniformArrayInteger.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/UniformArrayInteger.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UniformArrayInteger.java 8 Apr 2004 21:03:32 -0000 1.6 --- UniformArrayInteger.java 11 Apr 2004 23:40:09 -0000 1.7 *************** *** 23,27 **** public class UniformArrayInteger extends Parameter { ! final private int[] values; --- 23,27 ---- public class UniformArrayInteger extends Parameter { ! final private int[] values; *************** *** 30,34 **** this.values = values; } ! public int getValue(int index) { return values[index]; --- 30,34 ---- this.values = values; } ! public int getValue(int index) { return values[index]; *************** *** 40,48 **** public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Parameter not diceable: " + declaration); } public Parameter selectValues(int[] indexes) { ! return this; } --- 40,56 ---- public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Parameter not diceable: " + declaration); } public Parameter selectValues(int[] indexes) { ! int n = declaration.getCount(); ! if (n == values.length) ! return this; ! if (n == 1) ! return new UniformScalarInteger(declaration, values[indexes[0]]); ! int[] newValues = new int[n]; ! for (int i = 0; i < n; i++) ! newValues[i] = values[indexes[0] + i]; ! return new UniformArrayInteger(declaration, newValues); } Index: VaryingScalarHPoint.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingScalarHPoint.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** VaryingScalarHPoint.java 8 Apr 2004 21:03:32 -0000 1.7 --- VaryingScalarHPoint.java 11 Apr 2004 23:40:09 -0000 1.8 *************** *** 26,30 **** public class VaryingScalarHPoint extends Parameter { ! final private float[] values; --- 26,30 ---- public class VaryingScalarHPoint extends Parameter { ! final private float[] values; *************** *** 36,42 **** public VaryingScalarHPoint(Declaration declaration, VaryingScalarTuple3f param) { super(declaration); ! values = new float[param.getCount() * 4]; ! for(int i = 0; i < param.getCount(); i++) ! { values[i * 4] = param.getValue(i * 3); values[i * 4 + 1] = param.getValue(i * 3 + 1); --- 36,41 ---- public VaryingScalarHPoint(Declaration declaration, VaryingScalarTuple3f param) { super(declaration); ! values = new float[param.getCount() * 4]; ! for (int i = 0; i < param.getCount(); i++) { values[i * 4] = param.getValue(i * 3); values[i * 4 + 1] = param.getValue(i * 3 + 1); *************** *** 46,50 **** } - public void getValue(int index, Tuple4f out) { out.x = values[index * 4]; --- 45,48 ---- *************** *** 53,57 **** out.w = values[index * 4 + 3]; } ! public void setValue(int index, Tuple4f in) { values[index * 4] = in.x; --- 51,55 ---- out.w = values[index * 4 + 3]; } ! public void setValue(int index, Tuple4f in) { values[index * 4] = in.x; *************** *** 63,100 **** public Parameter linearInterpolate(float uMin, float uMax, float vMin, float vMax) { float[] newValues = new float[16]; ! newValues[0] = Calc.interpolate(values[0], values[4], values[8], values[12], uMin, vMin); ! newValues[1] = Calc.interpolate(values[1], values[5], values[9], values[13], uMin, vMin); ! newValues[2] = Calc.interpolate(values[2], values[6], values[10], values[14], uMin, vMin); ! newValues[3] = Calc.interpolate(values[3], values[7], values[11], values[15], uMin, vMin); ! newValues[4] = Calc.interpolate(values[0], values[4], values[8], values[12], uMax, vMin); ! newValues[5] = Calc.interpolate(values[1], values[5], values[9], values[13], uMax, vMin); ! newValues[6] = Calc.interpolate(values[2], values[6], values[10], values[14], uMax, vMin); ! newValues[7] = Calc.interpolate(values[3], values[7], values[11], values[15], uMax, vMin); ! newValues[8] = Calc.interpolate(values[0], values[4], values[8], values[12], uMin, vMax); ! newValues[9] = Calc.interpolate(values[1], values[5], values[9], values[13], uMin, vMax); ! newValues[10] = Calc.interpolate(values[2], values[6], values[10], values[14], uMin, vMax); ! newValues[11] = Calc.interpolate(values[3], values[7], values[11], values[15], uMin, vMax); ! newValues[12] = Calc.interpolate(values[0], values[4], values[8], values[12], uMax, vMax); ! newValues[13] = Calc.interpolate(values[1], values[5], values[9], values[13], uMax, vMax); ! newValues[14] = Calc.interpolate(values[2], values[6], values[10], values[14], uMax, vMax); ! newValues[15] = Calc.interpolate(values[3], values[7], values[11], values[15], uMax, vMax); return new VaryingScalarHPoint(declaration, newValues); } public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Dice hpoint not implemented: " + declaration); } public Parameter selectValues(int[] indexes) { ! float[] newValues = new float[indexes.length * 4]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * 4; ! int dstOffset = i * 4; ! newValues[dstOffset] = values[srcOffset]; ! newValues[dstOffset + 1] = values[srcOffset + 1]; ! newValues[dstOffset + 2] = values[srcOffset + 2]; ! newValues[dstOffset + 3] = values[srcOffset + 3]; } - return new VaryingScalarHPoint(declaration, newValues); } } --- 61,125 ---- public Parameter linearInterpolate(float uMin, float uMax, float vMin, float vMax) { float[] newValues = new float[16]; ! newValues[0] = ! Calc.interpolate(values[0], values[4], values[8], values[12], uMin, vMin); ! newValues[1] = ! Calc.interpolate(values[1], values[5], values[9], values[13], uMin, vMin); ! newValues[2] = ! Calc.interpolate(values[2], values[6], values[10], values[14], uMin, vMin); ! newValues[3] = ! Calc.interpolate(values[3], values[7], values[11], values[15], uMin, vMin); ! newValues[4] = ! Calc.interpolate(values[0], values[4], values[8], values[12], uMax, vMin); ! newValues[5] = ! Calc.interpolate(values[1], values[5], values[9], values[13], uMax, vMin); ! newValues[6] = ! Calc.interpolate(values[2], values[6], values[10], values[14], uMax, vMin); ! newValues[7] = ! Calc.interpolate(values[3], values[7], values[11], values[15], uMax, vMin); ! newValues[8] = ! Calc.interpolate(values[0], values[4], values[8], values[12], uMin, vMax); ! newValues[9] = ! Calc.interpolate(values[1], values[5], values[9], values[13], uMin, vMax); ! newValues[10] = ! Calc.interpolate(values[2], values[6], values[10], values[14], uMin, vMax); ! newValues[11] = ! Calc.interpolate(values[3], values[7], values[11], values[15], uMin, vMax); ! newValues[12] = ! Calc.interpolate(values[0], values[4], values[8], values[12], uMax, vMax); ! newValues[13] = ! Calc.interpolate(values[1], values[5], values[9], values[13], uMax, vMax); ! newValues[14] = ! Calc.interpolate(values[2], values[6], values[10], values[14], uMax, vMax); ! newValues[15] = ! Calc.interpolate(values[3], values[7], values[11], values[15], uMax, vMax); return new VaryingScalarHPoint(declaration, newValues); } public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Dice hpoint not implemented: " + declaration); } public Parameter selectValues(int[] indexes) { ! if (declaration.getStorageClass() == Declaration.StorageClass.UNIFORM ! && indexes.length == 1) { ! int offset = indexes[0] * 4; ! return new UniformScalarHPoint( ! declaration, ! values[offset], ! values[offset + 1], ! values[offset + 2], ! values[offset + 3]); ! } else { ! float[] newValues = new float[indexes.length * 4]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * 4; ! int dstOffset = i * 4; ! newValues[dstOffset] = values[srcOffset]; ! newValues[dstOffset + 1] = values[srcOffset + 1]; ! newValues[dstOffset + 2] = values[srcOffset + 2]; ! newValues[dstOffset + 3] = values[srcOffset + 3]; ! } ! return new VaryingScalarHPoint(declaration, newValues); } } } Index: VaryingArrayFloat.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingArrayFloat.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VaryingArrayFloat.java 8 Apr 2004 21:03:31 -0000 1.8 --- VaryingArrayFloat.java 11 Apr 2004 23:40:09 -0000 1.9 *************** *** 83,99 **** public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Dice array not implemented: " + declaration); } public Parameter selectValues(int[] indexes) { int n = declaration.getCount(); ! float[] newValues = new float[indexes.length * n]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * n; ! int dstOffset = i * n; ! for (int e = 0; e < n; e++) ! newValues[dstOffset + e] = values[srcOffset + e]; } - return new VaryingArrayFloat(declaration, newValues); } --- 83,108 ---- public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Dice array not implemented: " + declaration); } public Parameter selectValues(int[] indexes) { int n = declaration.getCount(); ! if (declaration.getStorageClass() == Declaration.StorageClass.UNIFORM ! && indexes.length == 1) { ! float[] newValues = new float[n]; ! int offset = indexes[0] * n; ! for (int i = 0; i < n; i++) ! newValues[i] = values[offset + i]; ! return new UniformArrayFloat(declaration, values); ! } else { ! float[] newValues = new float[indexes.length * n]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * n; ! int dstOffset = i * n; ! for (int e = 0; e < n; e++) ! newValues[dstOffset + e] = values[srcOffset + e]; ! } ! return new VaryingArrayFloat(declaration, newValues); } } Index: VaryingArrayTuple3f.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/VaryingArrayTuple3f.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** VaryingArrayTuple3f.java 8 Apr 2004 21:03:32 -0000 1.6 --- VaryingArrayTuple3f.java 11 Apr 2004 23:40:09 -0000 1.7 *************** *** 26,30 **** public class VaryingArrayTuple3f extends Parameter { ! final private float[] values; --- 26,30 ---- public class VaryingArrayTuple3f extends Parameter { ! final private float[] values; *************** *** 33,37 **** this.values = values; } ! public void getValue(int index, int arrayIndex, Tuple3f out) { int offset = (index * declaration.getCount() + arrayIndex) * 3; --- 33,37 ---- this.values = values; } ! public void getValue(int index, int arrayIndex, Tuple3f out) { int offset = (index * declaration.getCount() + arrayIndex) * 3; *************** *** 48,55 **** float[] newValues = new float[n * 12]; for (int i = 0; i < off1; i++) { ! newValues[i] = Calc.interpolate(values[i], values[off1 + i], values[off2 + i], values[off3 + i], uMin, vMin); ! newValues[off1 + i] = Calc.interpolate(values[i], values[off1 + i], values[off2 + i], values[off3 + i], uMax, vMin); ! newValues[off1 + i] = Calc.interpolate(values[i], values[off1 + i], values[off2 + i], values[off3 + i], uMin, vMax); ! newValues[off1 + i] = Calc.interpolate(values[i], values[off1 + i], values[off2 + i], values[off3 + i], uMax, vMax); } return new VaryingArrayTuple3f(declaration, newValues); --- 48,83 ---- float[] newValues = new float[n * 12]; for (int i = 0; i < off1; i++) { ! newValues[i] = ! Calc.interpolate( ! values[i], ! values[off1 + i], ! values[off2 + i], ! values[off3 + i], ! uMin, ! vMin); ! newValues[off1 + i] = ! Calc.interpolate( ! values[i], ! values[off1 + i], ! values[off2 + i], ! values[off3 + i], ! uMax, ! vMin); ! newValues[off1 + i] = ! Calc.interpolate( ! values[i], ! values[off1 + i], ! values[off2 + i], ! values[off3 + i], ! uMin, ! vMax); ! newValues[off1 + i] = ! Calc.interpolate( ! values[i], ! values[off1 + i], ! values[off2 + i], ! values[off3 + i], ! uMax, ! vMax); } return new VaryingArrayTuple3f(declaration, newValues); *************** *** 57,73 **** public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Dice array not implemented: " + declaration); } public Parameter selectValues(int[] indexes) { int n = declaration.getCount() * 3; ! float[] newValues = new float[indexes.length * n]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * n; ! int dstOffset = i * n; ! for (int e = 0; e < n; e++) ! newValues[dstOffset + e] = values[srcOffset + e]; } - return new VaryingArrayTuple3f(declaration, newValues); } --- 85,110 ---- public void linearDice(Grid grid) { ! throw new UnsupportedOperationException("Dice array not implemented: " + declaration); } public Parameter selectValues(int[] indexes) { int n = declaration.getCount() * 3; ! if (declaration.getStorageClass() == Declaration.StorageClass.UNIFORM ! && indexes.length == 1) { ! float[] newValues = new float[n]; ! int offset = indexes[0] * n; ! for (int i = 0; i < n; i++) ! newValues[i] = values[offset + i]; ! return new UniformArrayTuple3f(declaration, newValues); ! } else { ! float[] newValues = new float[indexes.length * n]; ! for (int i = 0; i < indexes.length; i++) { ! int srcOffset = indexes[i] * n; ! int dstOffset = i * n; ! for (int e = 0; e < n; e++) ! newValues[dstOffset + e] = values[srcOffset + e]; ! } ! return new VaryingArrayTuple3f(declaration, newValues); } } |
From: Gerardo H. <ma...@us...> - 2004-04-09 23:13:59
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6297/src/org/jrman/parser Modified Files: Parser.java Log Message: Fixed parameters handling in Points primitive. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Parser.java 9 Apr 2004 22:33:22 -0000 1.83 --- Parser.java 9 Apr 2004 23:00:34 -0000 1.84 *************** *** 1132,1139 **** (UniformScalarFloat) parameters.getParameter("constantwidth"); parameters.removeParameter("constantwidth"); ! VaryingScalarTuple3f csParam = (VaryingScalarTuple3f) parameters.getParameter("Cs"); ! parameters.removeParameter("Cs"); ! VaryingScalarTuple3f osParam = (VaryingScalarTuple3f) parameters.getParameter("Os"); ! parameters.removeParameter("Os"); for (int i = 0; i < pParam.getCount(); i++) { final Point3f p = new Point3f(); --- 1132,1138 ---- (UniformScalarFloat) parameters.getParameter("constantwidth"); parameters.removeParameter("constantwidth"); ! int[] uniformIndex = new int[1]; ! uniformIndex[0] = 0; ! int[] indexes = new int[1]; for (int i = 0; i < pParam.getCount(); i++) { final Point3f p = new Point3f(); *************** *** 1145,1171 **** tw = constantWidthParam.getValue(); final float w = tw; ! ParameterList tparam; ! if (csParam == null && osParam == null) ! tparam = parameters; ! else { ! tparam = new ParameterList(parameters); ! if (csParam != null) { ! csParam.getValue(i, tmpColor); ! float[] f = new float[3]; ! f[0] = tmpColor.x; ! f[1] = tmpColor.y; ! f[2] = tmpColor.z; ! tparam.addParameter(new VaryingScalarTuple3f(csParam.getDeclaration(), f)); ! } ! if (osParam != null) { ! osParam.getValue(i, tmpColor); ! float[] f = new float[3]; ! f[0] = tmpColor.x; ! f[1] = tmpColor.y; ! f[2] = tmpColor.z; ! tparam.addParameter(new VaryingScalarTuple3f(osParam.getDeclaration(), f)); ! } ! } ! final ParameterList param = tparam; if (!inObject) renderer.addPrimitive(new Point(w, p.x, p.y, p.z, param, getAttributes())); --- 1144,1149 ---- tw = constantWidthParam.getValue(); final float w = tw; ! indexes[0] = i; ! final ParameterList param = parameters.selectValues(uniformIndex, indexes, indexes); if (!inObject) renderer.addPrimitive(new Point(w, p.x, p.y, p.z, param, getAttributes())); |
From: Gerardo H. <ma...@us...> - 2004-04-09 22:46:45
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1075/src/org/jrman/primitive Modified Files: PointsPolygons.java Log Message: Improved parameter selectValues(). Removed incorrect Pz declaration! Index: PointsPolygons.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/PointsPolygons.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PointsPolygons.java 8 Apr 2004 21:03:32 -0000 1.2 --- PointsPolygons.java 9 Apr 2004 22:33:22 -0000 1.3 *************** *** 65,69 **** int offset = 0; for (int i = 0; i < nVertices.length; i++) { ! result[i] = new Polygon(nVertices[i], offset, parameters, attributes); offset += nVertices[i]; } --- 65,69 ---- int offset = 0; for (int i = 0; i < nVertices.length; i++) { ! result[i] = new Polygon(i, nVertices[i], offset, parameters, attributes); offset += nVertices[i]; } *************** *** 76,79 **** --- 76,81 ---- private class Polygon extends Primitive { + + private int pos; private int n; *************** *** 81,85 **** private int offset; ! Polygon(int n, int offset, ParameterList parameters, Attributes attributes) { this.n = n; this.offset = offset; --- 83,88 ---- private int offset; ! Polygon(int pos, int n, int offset, ParameterList parameters, Attributes attributes) { ! this.pos = pos; this.n = n; this.offset = offset; *************** *** 99,107 **** public Primitive[] split() { Primitive[] result = new Primitive[n - 3 + 1]; int[] indexes = new int[] { vertices[offset], 0, vertices[offset], 0 }; for (int i = 1; i < n - 1; i++) { indexes[1] = vertices[offset + i]; indexes[3] = vertices[offset + i + 1]; ! ParameterList pl = parameters.selectValues(indexes); pl.addParameter(points.selectValues(indexes)); result[i - 1] = new BilinearPatch(pl, attributes); --- 102,112 ---- public Primitive[] split() { Primitive[] result = new Primitive[n - 3 + 1]; + int[] posIndex = new int[1]; + posIndex[0] = pos; int[] indexes = new int[] { vertices[offset], 0, vertices[offset], 0 }; for (int i = 1; i < n - 1; i++) { indexes[1] = vertices[offset + i]; indexes[3] = vertices[offset + i + 1]; ! ParameterList pl = parameters.selectValues(posIndex, indexes, indexes); pl.addParameter(points.selectValues(indexes)); result[i - 1] = new BilinearPatch(pl, attributes); |
From: Gerardo H. <ma...@us...> - 2004-04-09 22:46:45
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1075/sampleData Modified Files: points.rib Log Message: Improved parameter selectValues(). Removed incorrect Pz declaration! Index: points.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/points.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** points.rib 25 Nov 2003 16:34:09 -0000 1.4 --- points.rib 9 Apr 2004 22:33:23 -0000 1.5 *************** *** 1,3 **** ! Display "points" "framebuffer" "rgba" Format 480 360 1 PixelSamples 4 4 --- 1,3 ---- ! Display "points" "framebuffer" "rgb" Format 480 360 1 PixelSamples 4 4 |
From: Gerardo H. <ma...@us...> - 2004-04-09 22:46:44
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1075/src/org/jrman/parser Modified Files: Parser.java Global.java Log Message: Improved parameter selectValues(). Removed incorrect Pz declaration! Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Parser.java 8 Apr 2004 21:29:26 -0000 1.82 --- Parser.java 9 Apr 2004 22:33:22 -0000 1.83 *************** *** 494,499 **** } ! public void setTextureCoordinates(float s1, float t1, float s2, float t2, float s3, float t3, float s4, float t4) { ! currentAttributes.setTextureCoordinates(new TextureCoordinates(s1, t1, s2, t2, s3, t3, s4, t4)); } --- 494,508 ---- } ! public void setTextureCoordinates( ! float s1, ! float t1, ! float s2, ! float t2, ! float s3, ! float t3, ! float s4, ! float t4) { ! currentAttributes.setTextureCoordinates( ! new TextureCoordinates(s1, t1, s2, t2, s3, t3, s4, t4)); } *************** *** 974,985 **** else throw new IllegalArgumentException("Unknown v wrap type: " + vWrap); int[] indexes = new int[4]; ! for (int i = 0; i < nU; i++) ! for (int j = 0; j < nV; j++) { indexes[0] = evalIndex(i, nu, j, nv); indexes[1] = evalIndex(i + 1, nu, j, nv); indexes[2] = evalIndex(i, nu, j + 1, nv); indexes[3] = evalIndex(i + 1, nu, j + 1, nv); ! addBilinearPatch(parameters.selectValues(indexes)); } } --- 983,997 ---- else throw new IllegalArgumentException("Unknown v wrap type: " + vWrap); + int[] uniformIndex = new int[1]; + uniformIndex[0] = 0; int[] indexes = new int[4]; ! for (int j = 0; j < nV; j++) ! for (int i = 0; i < nU; i++) { indexes[0] = evalIndex(i, nu, j, nv); indexes[1] = evalIndex(i + 1, nu, j, nv); indexes[2] = evalIndex(i, nu, j + 1, nv); indexes[3] = evalIndex(i + 1, nu, j + 1, nv); ! addBilinearPatch(parameters.selectValues(uniformIndex, indexes, indexes)); ! uniformIndex[0]++; } } *************** *** 1007,1035 **** else throw new IllegalArgumentException("Unknown v wrap type: " + vWrap); ! int[] indexes = new int[16]; ! int i = 0; ! for (int ii = 0; ii < nU; ii++) { ! int j = 0; ! for (int jj = 0; jj < nV; jj++) { ! indexes[0] = evalIndex(i, nu, j, nv); ! indexes[1] = evalIndex(i + 1, nu, j, nv); ! indexes[2] = evalIndex(i + 2, nu, j, nv); ! indexes[3] = evalIndex(i + 3, nu, j, nv); ! indexes[4] = evalIndex(i, nu, j + 1, nv); ! indexes[5] = evalIndex(i + 1, nu, j + 1, nv); ! indexes[6] = evalIndex(i + 2, nu, j + 1, nv); ! indexes[7] = evalIndex(i + 3, nu, j + 1, nv); ! indexes[8] = evalIndex(i, nu, j + 2, nv); ! indexes[9] = evalIndex(i + 1, nu, j + 2, nv); ! indexes[10] = evalIndex(i + 2, nu, j + 2, nv); ! indexes[11] = evalIndex(i + 3, nu, j + 2, nv); ! indexes[12] = evalIndex(i, nu, j + 3, nv); ! indexes[13] = evalIndex(i + 1, nu, j + 3, nv); ! indexes[14] = evalIndex(i + 2, nu, j + 3, nv); ! indexes[15] = evalIndex(i + 3, nu, j + 3, nv); ! addBicubicPatch(parameters.selectValues(indexes)); ! j += vStep; } ! i += uStep; } } --- 1019,1055 ---- else throw new IllegalArgumentException("Unknown v wrap type: " + vWrap); ! int[] uniformIndex = new int[1]; ! uniformIndex[0] = 0; ! int[] varyingIndexes = new int[4]; ! int[] vertexIndexes = new int[16]; ! int j = 0; ! for (int jj = 0; jj < nV; jj++) { ! int i = 0; ! for (int ii = 0; ii < nV; ii++) { ! varyingIndexes[0] = evalIndex(ii, nU, jj, nV); ! varyingIndexes[1] = evalIndex(ii + 1, nU, jj, nV); ! varyingIndexes[2] = evalIndex(ii, nU, jj + 1, nV); ! varyingIndexes[3] = evalIndex(ii + 1, nU, jj + 1, nV); ! vertexIndexes[0] = evalIndex(i, nu, j, nv); ! vertexIndexes[1] = evalIndex(i + 1, nu, j, nv); ! vertexIndexes[2] = evalIndex(i + 2, nu, j, nv); ! vertexIndexes[3] = evalIndex(i + 3, nu, j, nv); ! vertexIndexes[4] = evalIndex(i, nu, j + 1, nv); ! vertexIndexes[5] = evalIndex(i + 1, nu, j + 1, nv); ! vertexIndexes[6] = evalIndex(i + 2, nu, j + 1, nv); ! vertexIndexes[7] = evalIndex(i + 3, nu, j + 1, nv); ! vertexIndexes[8] = evalIndex(i, nu, j + 2, nv); ! vertexIndexes[9] = evalIndex(i + 1, nu, j + 2, nv); ! vertexIndexes[10] = evalIndex(i + 2, nu, j + 2, nv); ! vertexIndexes[11] = evalIndex(i + 3, nu, j + 2, nv); ! vertexIndexes[12] = evalIndex(i, nu, j + 3, nv); ! vertexIndexes[13] = evalIndex(i + 1, nu, j + 3, nv); ! vertexIndexes[14] = evalIndex(i + 2, nu, j + 3, nv); ! vertexIndexes[15] = evalIndex(i + 3, nu, j + 3, nv); ! addBicubicPatch(parameters.selectValues(uniformIndex, varyingIndexes, vertexIndexes)); ! uniformIndex[0]++; ! i += uStep; } ! j += vStep; } } *************** *** 1092,1100 **** public void addPolygon(final ParameterList parameters) { VaryingScalarTuple3f pParam = (VaryingScalarTuple3f) parameters.getParameter("P"); int[] indexes = new int[] { 0, 0, 0, 0 }; for (int i = 1; i < pParam.getCount() - 1; i++) { indexes[1] = i; indexes[3] = i + 1; ! addBilinearPatch(parameters.selectValues(indexes)); } } --- 1112,1122 ---- public void addPolygon(final ParameterList parameters) { VaryingScalarTuple3f pParam = (VaryingScalarTuple3f) parameters.getParameter("P"); + int[] uniformIndex = new int[1]; + uniformIndex[0] = 0; int[] indexes = new int[] { 0, 0, 0, 0 }; for (int i = 1; i < pParam.getCount() - 1; i++) { indexes[1] = i; indexes[3] = i + 1; ! addBilinearPatch(parameters.selectValues(uniformIndex, indexes, indexes)); } } Index: Global.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Global.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Global.java 23 Mar 2004 06:29:11 -0000 1.10 --- Global.java 9 Apr 2004 22:33:22 -0000 1.11 *************** *** 70,74 **** declarations.put("Cs", new Declaration("Cs", "varying color")); declarations.put("Os", new Declaration("Os", "varying color")); - declarations.put("Pz", new Declaration("Pz", "varying color")); declarations.put("s", new Declaration("s", "varying float")); declarations.put("t", new Declaration("t", "varying float")); --- 70,73 ---- |
From: Gerardo H. <ma...@us...> - 2004-04-09 22:46:44
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parameters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1075/src/org/jrman/parameters Modified Files: ParameterList.java Log Message: Improved parameter selectValues(). Removed incorrect Pz declaration! Index: ParameterList.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parameters/ParameterList.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ParameterList.java 8 Apr 2004 21:03:32 -0000 1.6 --- ParameterList.java 9 Apr 2004 22:33:21 -0000 1.7 *************** *** 41,49 **** return pl; } ! ! public ParameterList selectValues(int[] indexes) { ParameterList pl = new ParameterList(); ! for (int i = 0; i < getParameterCount(); i++) ! pl.addParameter(getParameter(i).selectValues(indexes)); return pl; } --- 41,62 ---- return pl; } ! ! public ParameterList selectValues( ! int[] uniformIndexes, ! int[] varyingIndexes, ! int[] vertexIndexes) { ParameterList pl = new ParameterList(); ! for (int i = 0; i < getParameterCount(); i++) { ! Parameter p = getParameter(i); ! Declaration.StorageClass sclass = p.getDeclaration().getStorageClass(); ! if (sclass.equals(Declaration.StorageClass.CONSTANT)) ! pl.addParameter(p); ! else if (sclass.equals(Declaration.StorageClass.UNIFORM)) ! pl.addParameter(p.selectValues(uniformIndexes)); ! else if (sclass.equals(Declaration.StorageClass.VARYING)) ! pl.addParameter(p.selectValues(varyingIndexes)); ! else if (sclass.equals(Declaration.StorageClass.VERTEX)) ! pl.addParameter(p.selectValues(vertexIndexes)); ! } return pl; } |
From: Gerardo H. <ma...@us...> - 2004-04-08 21:42:39
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17122/src/org/jrman/parser Modified Files: Parser.java Log Message: Handling of TextureCoordinates. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Parser.java 8 Apr 2004 21:03:33 -0000 1.81 --- Parser.java 8 Apr 2004 21:29:26 -0000 1.82 *************** *** 45,48 **** --- 45,49 ---- import org.jrman.attributes.ShadingInterpolation; import org.jrman.attributes.Space; + import org.jrman.attributes.TextureCoordinates; import org.jrman.attributes.TrimCurveSense; import org.jrman.geom.AffineTransform; *************** *** 493,496 **** --- 494,501 ---- } + public void setTextureCoordinates(float s1, float t1, float s2, float t2, float s3, float t3, float s4, float t4) { + currentAttributes.setTextureCoordinates(new TextureCoordinates(s1, t1, s2, t2, s3, t3, s4, t4)); + } + public Declaration getDeclaration(String name) { return Global.getDeclaration(name); |
From: Gerardo H. <ma...@us...> - 2004-04-08 21:42:38
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17122/src/org/jrman/primitive Modified Files: Primitive.java Log Message: Handling of TextureCoordinates. Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Primitive.java 8 Apr 2004 21:03:32 -0000 1.30 --- Primitive.java 8 Apr 2004 21:29:25 -0000 1.31 *************** *** 23,26 **** --- 23,27 ---- import org.jrman.attributes.Attributes; + import org.jrman.attributes.TextureCoordinates; import org.jrman.geom.BoundingVolume; import org.jrman.geom.Bounds2f; *************** *** 66,70 **** this.attributes = attributes; if (parameters != null) ! setDefaultParameters(); } --- 67,71 ---- this.attributes = attributes; if (parameters != null) ! setDefaultParameters(parameters, attributes); } *************** *** 231,235 **** } ! protected void setDefaultParameters() { Parameter parameter = parameters.getParameter("u"); if (parameter == null) { --- 232,236 ---- } ! public static void setDefaultParameters(ParameterList parameters, Attributes attributes) { Parameter parameter = parameters.getParameter("u"); if (parameter == null) { *************** *** 262,270 **** } else { float[] s = new float[4]; ! VaryingScalarFloat uParam = (VaryingScalarFloat) parameters.getParameter("u"); ! s[0] = uParam.getValue(0); ! s[1] = uParam.getValue(1); ! s[2] = uParam.getValue(2); ! s[3] = uParam.getValue(3); parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("s"), s)); } --- 263,271 ---- } else { float[] s = new float[4]; ! TextureCoordinates tc = attributes.getTextureCoordinates(); ! s[0] = tc.getS1(); ! s[1] = tc.getS2(); ! s[2] = tc.getS3(); ! s[3] = tc.getS4(); parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("s"), s)); } *************** *** 282,290 **** } else { float[] t = new float[4]; ! VaryingScalarFloat vParam = (VaryingScalarFloat) parameters.getParameter("v"); ! t[0] = vParam.getValue(0); ! t[1] = vParam.getValue(1); ! t[2] = vParam.getValue(2); ! t[3] = vParam.getValue(3); parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("t"), t)); } --- 283,291 ---- } else { float[] t = new float[4]; ! TextureCoordinates tc = attributes.getTextureCoordinates(); ! t[0] = tc.getT1(); ! t[1] = tc.getT2(); ! t[2] = tc.getT3(); ! t[3] = tc.getT4(); parameters.addParameter(new VaryingScalarFloat(Global.getDeclaration("t"), t)); } |
From: Gerardo H. <ma...@us...> - 2004-04-08 21:42:38
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser/keywords In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17122/src/org/jrman/parser/keywords Modified Files: KeywordTextureCoordinates.java Log Message: Handling of TextureCoordinates. Index: KeywordTextureCoordinates.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/keywords/KeywordTextureCoordinates.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KeywordTextureCoordinates.java 7 Apr 2003 08:24:20 -0000 1.2 --- KeywordTextureCoordinates.java 8 Apr 2004 21:29:26 -0000 1.3 *************** *** 35,62 **** // Expect s1 match(st, TK_NUMBER); ! // Expect t1 match(st, TK_NUMBER); ! // Expect s2 match(st, TK_NUMBER); ! // Expect t2 match(st, TK_NUMBER); ! // Expect s3 match(st, TK_NUMBER); ! // Expect t3 match(st, TK_NUMBER); ! // Expect s4 match(st, TK_NUMBER); ! // Expect t4 match(st, TK_NUMBER); ! if (array) match(st, TK_RBRACE); } --- 35,63 ---- // Expect s1 match(st, TK_NUMBER); ! float s1 = (float) st.nval; // Expect t1 match(st, TK_NUMBER); ! float t1 = (float) st.nval; // Expect s2 match(st, TK_NUMBER); ! float s2 = (float) st.nval; // Expect t2 match(st, TK_NUMBER); ! float t2 = (float) st.nval; // Expect s3 match(st, TK_NUMBER); ! float s3 = (float) st.nval; // Expect t3 match(st, TK_NUMBER); ! float t3 = (float) st.nval; // Expect s4 match(st, TK_NUMBER); ! float s4 = (float) st.nval; // Expect t4 match(st, TK_NUMBER); ! float t4 = (float) st.nval; if (array) match(st, TK_RBRACE); + parser.setTextureCoordinates(s1, t1, s2, t2, s3, t3, s4, t4); } |