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: Gerardo H. <ma...@us...> - 2007-01-30 05:09:36
|
Update of /cvsroot/jrman/drafts/nbproject In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20042/nbproject Added Files: project.xml Log Message: First test as a NetBeans project. --- NEW FILE: project.xml --- <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://www.netbeans.org/ns/project/1"> <type>org.netbeans.modules.ant.freeform</type> <configuration> <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> <!-- Do not use Project Properties customizer when editing this file manually. --> <name>jrMan</name> <properties/> <folders> <source-folder> <label>src</label> <type>java</type> <location>src</location> </source-folder> </folders> <ide-actions> <action name="build"> <target>compile</target> </action> <action name="clean"> <target>clean</target> </action> <action name="javadoc"> <target>javadoc</target> </action> <action name="rebuild"> <target>clean</target> <target>compile</target> </action> <action name="run"> <target>run</target> </action> </ide-actions> <view> <items> <source-folder style="packages"> <label>src</label> <location>src</location> </source-folder> <source-file> <location>build.xml</location> </source-file> </items> <context-menu> <ide-action name="build"/> <ide-action name="clean"/> <ide-action name="javadoc"/> <ide-action name="rebuild"/> <ide-action name="run"/> <action> <label>clean</label> <target>clean</target> </action> </context-menu> </view> <subprojects/> </general-data> <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"> <compilation-unit> <package-root>src</package-root> <classpath mode="compile">lib/commons-cli-1.0.jar:lib/forms-1.0.3.jar:lib/looks-1.2.0.jar:lib/vecmath.jar</classpath> <source-level>1.4</source-level> </compilation-unit> </java-data> </configuration> </project> |
From: Gerardo H. <ma...@us...> - 2007-01-30 05:09:36
|
Update of /cvsroot/jrman/drafts In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20042 Modified Files: build.xml Log Message: First test as a NetBeans project. Index: build.xml =================================================================== RCS file: /cvsroot/jrman/drafts/build.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** build.xml 6 Dec 2006 06:33:01 -0000 1.18 --- build.xml 30 Jan 2007 05:09:32 -0000 1.19 *************** *** 38,41 **** --- 38,56 ---- </target> + + <target name="run" depends="compile"> + <java dir="sampleData" classname="org.jrman.main.JrManGUI" fork="true"> + <classpath> + <path path="build"/> + <path path="src"/> + <fileset dir="lib"> + <include name="**/*.jar"/> + </fileset> + </classpath> + <jvmarg value="-server"/> + <jvmarg value="-Xms512m"/> + <jvmarg value="-Xmx512m"/> + </java> + </target> <target name="dist" depends="compile" |
From: Gerardo H. <ma...@us...> - 2007-01-30 05:09:31
|
Update of /cvsroot/jrman/drafts/nbproject In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20027/nbproject Log Message: Directory /cvsroot/jrman/drafts/nbproject added to the repository |
From: Gerardo H. <ma...@us...> - 2006-12-30 16:32:27
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23034/src/org/jrman/primitive Modified Files: CubicCurve.java LinearCurve.java Log Message: Fixed new 'v' bug in curves. Fixed subindex bug in cubic curves split. RVS: ---------------------------------------------------------------------- Index: CubicCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/CubicCurve.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CubicCurve.java 30 Dec 2006 14:59:49 -0000 1.5 --- CubicCurve.java 30 Dec 2006 16:32:23 -0000 1.6 *************** *** 73,80 **** Parameter param = parameters.getParameter("v"); if (param == null && !periodic) { ! float[] v = new float[2]; ! v[0] = 0f; ! v[1] = 1f; ! parameters.addParameter(new VaryingScalarFloat(V_DECL, v)); } MutableAttributes attr = new MutableAttributes(attributes); --- 73,87 ---- Parameter param = parameters.getParameter("v"); if (param == null && !periodic) { ! VaryingScalarTuple3f points = ! (VaryingScalarTuple3f) parameters.getParameter("P"); ! int n = (points.getCount() - 4) / attributes.getVStep() + 2; ! float[] values = new float[n]; ! float vInc = 1f / (1 - n); ! float v = 0f; ! for (int i = 0; i < n; i++) { ! values[i] = v; ! v += vInc; ! } ! parameters.addParameter(new VaryingScalarFloat(V_DECL, values)); } MutableAttributes attr = new MutableAttributes(attributes); *************** *** 117,125 **** varyingIndexes[0] = ii % lnv; varyingIndexes[1] = (ii + 1) % lnv; ! vertexIndexes[0] = i % nv; vertexIndexes[1] = (i + 1) % n; vertexIndexes[2] = (i + 2) % n; vertexIndexes[3] = (i + 3) % n; ! result[i] = new CubicSegment(parameters.selectValues(uniformIndex, varyingIndexes, --- 124,132 ---- varyingIndexes[0] = ii % lnv; varyingIndexes[1] = (ii + 1) % lnv; ! vertexIndexes[0] = i % n; vertexIndexes[1] = (i + 1) % n; vertexIndexes[2] = (i + 2) % n; vertexIndexes[3] = (i + 3) % n; ! result[ii] = new CubicSegment(parameters.selectValues(uniformIndex, varyingIndexes, Index: LinearCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/LinearCurve.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LinearCurve.java 30 Dec 2006 14:59:49 -0000 1.5 --- LinearCurve.java 30 Dec 2006 16:32:23 -0000 1.6 *************** *** 69,76 **** Parameter param = parameters.getParameter("v"); if (param == null && !periodic) { ! float[] v = new float[2]; ! v[0] = 0f; ! v[1] = 1f; ! parameters.addParameter(new VaryingScalarFloat(V_DECL, v)); } MutableAttributes attr = new MutableAttributes(attributes); --- 69,83 ---- Parameter param = parameters.getParameter("v"); if (param == null && !periodic) { ! VaryingScalarTuple3f points = ! (VaryingScalarTuple3f) parameters.getParameter("P"); ! int n = points.getCount(); ! float[] values = new float[n]; ! float vStep = 1f / (1 - n); ! float v = 0f; ! for (int i = 0; i < n; i++) { ! values[i] = v; ! v += vStep; ! } ! parameters.addParameter(new VaryingScalarFloat(V_DECL, values)); } MutableAttributes attr = new MutableAttributes(attributes); |
From: Gerardo H. <ma...@us...> - 2006-12-30 16:32:26
|
Update of /cvsroot/jrman/drafts/src/org/jrman/attributes In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23034/src/org/jrman/attributes Modified Files: MutableAttributes.java Log Message: Fixed new 'v' bug in curves. Fixed subindex bug in cubic curves split. RVS: ---------------------------------------------------------------------- Index: MutableAttributes.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/MutableAttributes.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MutableAttributes.java 24 Dec 2006 05:25:56 -0000 1.9 --- MutableAttributes.java 30 Dec 2006 16:32:23 -0000 1.10 *************** *** 63,67 **** uStep = 3; vBasis = Basis.BEZIER; ! vStep =3; space = Space.CAMERA; trueDisplacement = true; --- 63,67 ---- uStep = 3; vBasis = Basis.BEZIER; ! vStep = 3; space = Space.CAMERA; trueDisplacement = true; |
From: Gerardo H. <ma...@us...> - 2006-12-30 16:32:26
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23034/sampleData Modified Files: curves.rib Log Message: Fixed new 'v' bug in curves. Fixed subindex bug in cubic curves split. RVS: ---------------------------------------------------------------------- Index: curves.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/curves.rib,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** curves.rib 26 Dec 2006 17:26:18 -0000 1.5 --- curves.rib 30 Dec 2006 16:32:21 -0000 1.6 *************** *** 37,43 **** "N" [0 0 1 0 1 0 0 0 -1] "width" [.25 .5 .25] ! Curves "cubic" [4] "nonperiodic" ! "P" [-3 0 0 -3 2 0 -2 2 0 -2 3 0] "N" [0 0 -1 -1 0 0] ! "constantwidth" [.4] WorldEnd --- 37,44 ---- "N" [0 0 1 0 1 0 0 0 -1] "width" [.25 .5 .25] ! Curves "cubic" [6] "periodic" ! "P" [-3 0 0 -3 2 0 -2 2 0 -2 3 0 ! -2 3.5 0 -1 3.5 0] "N" [0 0 -1 -1 0 0] ! "width" [.4 .1] WorldEnd |
From: Gerardo H. <ma...@us...> - 2006-12-30 14:59:52
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19226/src/org/jrman/primitive Modified Files: CubicCurve.java LinearCurve.java Log Message: Fixed 'v' and periodic bug in curves. Index: CubicCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/CubicCurve.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CubicCurve.java 30 Dec 2006 13:49:21 -0000 1.4 --- CubicCurve.java 30 Dec 2006 14:59:49 -0000 1.5 *************** *** 72,76 **** w = 1f; Parameter param = parameters.getParameter("v"); ! if (param == null) { float[] v = new float[2]; v[0] = 0f; --- 72,76 ---- w = 1f; Parameter param = parameters.getParameter("v"); ! if (param == null && !periodic) { float[] v = new float[2]; v[0] = 0f; *************** *** 182,185 **** --- 182,192 ---- this.parameters = parameters; this.attributes = attributes; + Parameter param = parameters.getParameter("v"); + if (param == null) { + float[] v = new float[2]; + v[0] = 0f; + v[1] = 1f; + parameters.addParameter(new VaryingScalarFloat(V_DECL, v)); + } if (apply) applyBasis(); Index: LinearCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/LinearCurve.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LinearCurve.java 30 Dec 2006 13:49:22 -0000 1.4 --- LinearCurve.java 30 Dec 2006 14:59:49 -0000 1.5 *************** *** 68,72 **** w = 1f; Parameter param = parameters.getParameter("v"); ! if (param == null) { float[] v = new float[2]; v[0] = 0f; --- 68,72 ---- w = 1f; Parameter param = parameters.getParameter("v"); ! if (param == null && !periodic) { float[] v = new float[2]; v[0] = 0f; *************** *** 144,147 **** --- 144,154 ---- this.parameters = parameters; this.attributes = attributes; + Parameter param = parameters.getParameter("v"); + if (param == null) { + float[] v = new float[2]; + v[0] = 0f; + v[1] = 1f; + parameters.addParameter(new VaryingScalarFloat(V_DECL, v)); + } } |
From: Gerardo H. <ma...@us...> - 2006-12-30 13:49:25
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23605/src/org/jrman/primitive Modified Files: CubicCurve.java LinearCurve.java Primitive.java Log Message: Fixed "v" bug in curves (linear and cubic). Improved hair shader. Index: CubicCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/CubicCurve.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CubicCurve.java 29 Dec 2006 19:45:30 -0000 1.3 --- CubicCurve.java 30 Dec 2006 13:49:21 -0000 1.4 *************** *** 34,37 **** --- 34,38 ---- import org.jrman.grid.Vector3fGrid; import org.jrman.parameters.Declaration; + import org.jrman.parameters.Parameter; import org.jrman.parameters.ParameterList; import org.jrman.parameters.VaryingScalarFloat; *************** *** 70,73 **** --- 71,81 ---- else w = 1f; + Parameter param = parameters.getParameter("v"); + if (param == null) { + float[] v = new float[2]; + v[0] = 0f; + v[1] = 1f; + parameters.addParameter(new VaryingScalarFloat(V_DECL, v)); + } MutableAttributes attr = new MutableAttributes(attributes); attr.setDisplacementBound(attributes.getDisplacementBound() + w / 2f); *************** *** 441,445 **** } } ! protected void dice_v(ShaderVariables shaderVariables) { FloatGrid g = shaderVariables.v; --- 449,454 ---- } } ! ! /* protected void dice_v(ShaderVariables shaderVariables) { FloatGrid g = shaderVariables.v; *************** *** 453,456 **** --- 462,466 ---- } } + */ } Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Primitive.java 24 Dec 2006 05:25:57 -0000 1.39 --- Primitive.java 30 Dec 2006 13:49:22 -0000 1.40 *************** *** 210,214 **** VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("v"); ! param.bilinearDice(shaderVariables.v); } --- 210,217 ---- VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("v"); ! if (param.getCount() == 4) ! param.bilinearDice(shaderVariables.v); ! else ! param.linearDice(shaderVariables.v); } Index: LinearCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/LinearCurve.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LinearCurve.java 26 Dec 2006 17:26:19 -0000 1.3 --- LinearCurve.java 30 Dec 2006 13:49:22 -0000 1.4 *************** *** 31,34 **** --- 31,35 ---- import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; + import org.jrman.parameters.Parameter; import org.jrman.parameters.ParameterList; import org.jrman.parameters.VaryingScalarFloat; *************** *** 66,69 **** --- 67,77 ---- else w = 1f; + Parameter param = parameters.getParameter("v"); + if (param == null) { + float[] v = new float[2]; + v[0] = 0f; + v[1] = 1f; + parameters.addParameter(new VaryingScalarFloat(V_DECL, v)); + } MutableAttributes attr = new MutableAttributes(attributes); attr.setDisplacementBound(attributes.getDisplacementBound() + w / 2f); *************** *** 265,269 **** } } ! protected void dice_v(ShaderVariables shaderVariables) { FloatGrid g = shaderVariables.v; --- 273,278 ---- } } ! ! /* protected void dice_v(ShaderVariables shaderVariables) { FloatGrid g = shaderVariables.v; *************** *** 277,280 **** --- 286,290 ---- } } + */ } |
From: Gerardo H. <ma...@us...> - 2006-12-30 13:49:25
|
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23605/src Modified Files: SurfaceHair.java Log Message: Fixed "v" bug in curves (linear and cubic). Improved hair shader. Index: SurfaceHair.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceHair.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SurfaceHair.java 29 Dec 2006 20:28:32 -0000 1.2 --- SurfaceHair.java 30 Dec 2006 13:49:21 -0000 1.3 *************** *** 164,174 **** _fg1.max(_fg1, 0.001f); _fg1.simulPow(_fg1, 1f / roughness); ! //_fg1.mul(_fg1, sv.v); _cg1.set(_fg1); _cg1.mul(sv.Cl, _cg1); Cspec.add(Cspec, _cg1); ! //_cg1.set(sv.v); ! //_cg1.mul(sv.Cl, _cg1); ! // Cdiff.add(Cdiff, _cg1); } } --- 164,174 ---- _fg1.max(_fg1, 0.001f); _fg1.simulPow(_fg1, 1f / roughness); ! _fg1.mul(_fg1, sv.v); _cg1.set(_fg1); _cg1.mul(sv.Cl, _cg1); Cspec.add(Cspec, _cg1); ! _cg1.set(sv.v); ! _cg1.mul(sv.Cl, _cg1); ! Cdiff.add(Cdiff, _cg1); } } |
From: Gerardo H. <ma...@us...> - 2006-12-29 20:28:35
|
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8533/src Modified Files: SurfaceHair.java Log Message: Simple hair shader seems to work OK. Index: SurfaceHair.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceHair.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SurfaceHair.java 29 Dec 2006 19:45:30 -0000 1.1 --- SurfaceHair.java 29 Dec 2006 20:28:32 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- SurfaceHair.java Copyright (C) 2006 Gerardo Horvilleur Martinez + Based on hair shader from sig98.course11.pdf This program is free software; you can redistribute it and/or *************** *** 29,41 **** import org.jrman.parameters.UniformScalarTuple3f; import org.jrman.render.ShaderVariables; import org.jrman.shaders.SurfaceShader; public class SurfaceHair extends SurfaceShader { ! private static Vector3fGrid vg1 = new Vector3fGrid(); ! private static Vector3fGrid vg2 = new Vector3fGrid(); ! private static Vector3fGrid vg3 = new Vector3fGrid(); private static Color3fGrid cg1 = new Color3fGrid(); --- 30,43 ---- import org.jrman.parameters.UniformScalarTuple3f; import org.jrman.render.ShaderVariables; + import org.jrman.shaders.LightShader; import org.jrman.shaders.SurfaceShader; public class SurfaceHair extends SurfaceShader { ! private final static Color3f BLACK = new Color3f(); ! private static Vector3fGrid T = new Vector3fGrid(); ! private static Vector3fGrid V = new Vector3fGrid(); private static Color3fGrid cg1 = new Color3fGrid(); *************** *** 47,53 **** private static Color3fGrid cg4 = new Color3fGrid(); ! private static FloatGrid fg = new FloatGrid(); ! private static FloatGrid fg1 = new FloatGrid(); private static Color3f specularcolor = new Color3f(); --- 49,55 ---- private static Color3fGrid cg4 = new Color3fGrid(); ! private static Color3fGrid Cspec = new Color3fGrid(); ! private static Color3fGrid Cdiff = new Color3fGrid(); private static Color3f specularcolor = new Color3f(); *************** *** 57,61 **** private static Color3f tipcolor = new Color3f(); ! private static Vector3f surface_normal = new Vector3f(); protected void initDefaults() { --- 59,65 ---- private static Color3f tipcolor = new Color3f(); ! private static Statement lightStmt = new Lighting(); ! ! private static float roughness; protected void initDefaults() { *************** *** 64,80 **** defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Kd", "uniform float"), ! .3f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Ks", "uniform float"), ! .01f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("roughness", ! "uniform float"), 10f)); defaultParameters.addParameter( new UniformScalarTuple3f( new Declaration("specularcolor", "uniform color"), 1f, ! 1f, ! 1f)); defaultParameters.addParameter( new UniformScalarTuple3f( --- 68,84 ---- defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Kd", "uniform float"), ! .6f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Ks", "uniform float"), ! .35f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("roughness", ! "uniform float"), .15f)); defaultParameters.addParameter( new UniformScalarTuple3f( new Declaration("specularcolor", "uniform color"), 1f, ! .9f, ! .5f)); defaultParameters.addParameter( new UniformScalarTuple3f( *************** *** 89,98 **** .8f, 0f)); - defaultParameters.addParameter( - new UniformScalarTuple3f( - new Declaration("surface_normal", "uniform vector"), - 0f, - 0f, - 1f)); } --- 93,96 ---- *************** *** 110,114 **** UniformScalarFloat paramRoughness = (UniformScalarFloat) getParameter(sv, "roughness"); ! final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = (UniformScalarTuple3f) getParameter(sv, "specularcolor"); --- 108,112 ---- UniformScalarFloat paramRoughness = (UniformScalarFloat) getParameter(sv, "roughness"); ! roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = (UniformScalarTuple3f) getParameter(sv, "specularcolor"); *************** *** 120,152 **** (UniformScalarTuple3f) getParameter(sv, "tipcolor"); paramTipcolor.getValue(tipcolor); - UniformScalarTuple3f paramSurface_normal = - (UniformScalarTuple3f) getParameter(sv, "surface_normal"); - paramSurface_normal.getValue(surface_normal); ! surface_normal.normalize(); ! vg3.set(surface_normal); ! vg2.normalize(sv.dPdv); ! vg1.cross(vg3, vg2); ! vg1.cross(vg2, vg1); ! fg1.dot(vg3, vg1); ! fg1.abs(fg1); ! vg1.mix(vg1, vg3, fg1); ! vg1.faceforward(vg1, sv.I); ! vg1.normalize(vg1); ! vg2.normalize(sv.I); ! vg2.negate(vg2); sv.Oi.set(sv.Os); ambient(sv, cg1); cg3.set(Ka); cg1.mul(cg1, cg3); ! diffuse(sv, vg1, cg2); ! cg3.set(Kd); ! cg2.mul(cg2, cg3); cg1.add(cg1, cg2); cg4.mix(rootcolor, tipcolor, sv.v); cg1.mul(cg1, cg4); - specular(sv, vg1, vg2, roughness, cg2); cg3.set(Ks); ! cg2.mul(cg2, cg3); cg3.set(specularcolor); cg2.mul(cg2, cg3); --- 118,139 ---- (UniformScalarTuple3f) getParameter(sv, "tipcolor"); paramTipcolor.getValue(tipcolor); ! T.normalize(sv.dPdv); ! V.normalize(sv.I); ! V.negate(V); ! Cspec.set(BLACK); ! Cdiff.set(BLACK); ! illuminance(sv, null, sv.P, null, 0f, lightStmt); sv.Oi.set(sv.Os); ambient(sv, cg1); cg3.set(Ka); cg1.mul(cg1, cg3); ! cg2.set(Kd); ! cg2.mul(Cdiff, cg2); cg1.add(cg1, cg2); cg4.mix(rootcolor, tipcolor, sv.v); cg1.mul(cg1, cg4); cg3.set(Ks); ! cg2.mul(Cspec, cg3); cg3.set(specularcolor); cg2.mul(cg2, cg3); *************** *** 155,157 **** --- 142,176 ---- } + private static class Lighting extends Statement { + private static Vector3fGrid _vg1 = new Vector3fGrid(); + + private static FloatGrid _fg1 = new FloatGrid(); + + private static FloatGrid _fg2 = new FloatGrid(); + + private static Color3fGrid _cg1 = new Color3fGrid(); + + public void execute(ShaderVariables sv, LightShader ls) { + _vg1.normalize(sv.L); + _fg1.dot(T, _vg1); + _fg1.acos(_fg1); + _vg1.negate(T); + _fg2.dot(_vg1, V); + _fg2.acos(_fg2); + _fg1.sub(_fg1, _fg2); + _fg1.abs(_fg1); + //_fg1.clamp(_fg1, 0f, 3.14f / 4f); + _fg1.cos(_fg1); + _fg1.max(_fg1, 0.001f); + _fg1.simulPow(_fg1, 1f / roughness); + //_fg1.mul(_fg1, sv.v); + _cg1.set(_fg1); + _cg1.mul(sv.Cl, _cg1); + Cspec.add(Cspec, _cg1); + //_cg1.set(sv.v); + //_cg1.mul(sv.Cl, _cg1); + // Cdiff.add(Cdiff, _cg1); + } + } + } |
From: Gerardo H. <ma...@us...> - 2006-12-29 19:45:36
|
Update of /cvsroot/jrman/drafts/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25444/src Modified Files: SurfaceAlphaplastic.java Added Files: SurfaceHair.java Log Message: Hair shader tests. --- NEW FILE: SurfaceHair.java --- /* SurfaceHair.java Copyright (C) 2006 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ import javax.vecmath.Color3f; import javax.vecmath.Vector3f; import org.jrman.grid.Color3fGrid; import org.jrman.grid.FloatGrid; import org.jrman.grid.Vector3fGrid; import org.jrman.parameters.Declaration; import org.jrman.parameters.UniformScalarFloat; import org.jrman.parameters.UniformScalarString; import org.jrman.parameters.UniformScalarTuple3f; import org.jrman.render.ShaderVariables; import org.jrman.shaders.SurfaceShader; public class SurfaceHair extends SurfaceShader { private static Vector3fGrid vg1 = new Vector3fGrid(); private static Vector3fGrid vg2 = new Vector3fGrid(); private static Vector3fGrid vg3 = new Vector3fGrid(); private static Color3fGrid cg1 = new Color3fGrid(); private static Color3fGrid cg2 = new Color3fGrid(); private static Color3fGrid cg3 = new Color3fGrid(); private static Color3fGrid cg4 = new Color3fGrid(); private static FloatGrid fg = new FloatGrid(); private static FloatGrid fg1 = new FloatGrid(); private static Color3f specularcolor = new Color3f(); private static Color3f rootcolor = new Color3f(); private static Color3f tipcolor = new Color3f(); private static Vector3f surface_normal = new Vector3f(); protected void initDefaults() { defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Ka", "uniform float"), 1f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Kd", "uniform float"), .3f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("Ks", "uniform float"), .01f)); defaultParameters.addParameter( new UniformScalarFloat(new Declaration("roughness", "uniform float"), 10f)); defaultParameters.addParameter( new UniformScalarTuple3f( new Declaration("specularcolor", "uniform color"), 1f, 1f, 1f)); defaultParameters.addParameter( new UniformScalarTuple3f( new Declaration("rootcolor", "uniform color"), .5f, .4f, 0f)); defaultParameters.addParameter( new UniformScalarTuple3f( new Declaration("tipcolor", "uniform color"), 1f, .8f, 0f)); defaultParameters.addParameter( new UniformScalarTuple3f( new Declaration("surface_normal", "uniform vector"), 0f, 0f, 1f)); } public void shade(ShaderVariables sv) { super.shade(sv); UniformScalarFloat paramKa = (UniformScalarFloat) getParameter(sv, "Ka"); final float Ka = paramKa.getValue(); UniformScalarFloat paramKd = (UniformScalarFloat) getParameter(sv, "Kd"); final float Kd = paramKd.getValue(); UniformScalarFloat paramKs = (UniformScalarFloat) getParameter(sv, "Ks"); final float Ks = paramKs.getValue(); UniformScalarFloat paramRoughness = (UniformScalarFloat) getParameter(sv, "roughness"); final float roughness = paramRoughness.getValue(); UniformScalarTuple3f paramSpecularcolor = (UniformScalarTuple3f) getParameter(sv, "specularcolor"); paramSpecularcolor.getValue(specularcolor); UniformScalarTuple3f paramRootcolor = (UniformScalarTuple3f) getParameter(sv, "rootcolor"); paramRootcolor.getValue(rootcolor); UniformScalarTuple3f paramTipcolor = (UniformScalarTuple3f) getParameter(sv, "tipcolor"); paramTipcolor.getValue(tipcolor); UniformScalarTuple3f paramSurface_normal = (UniformScalarTuple3f) getParameter(sv, "surface_normal"); paramSurface_normal.getValue(surface_normal); surface_normal.normalize(); vg3.set(surface_normal); vg2.normalize(sv.dPdv); vg1.cross(vg3, vg2); vg1.cross(vg2, vg1); fg1.dot(vg3, vg1); fg1.abs(fg1); vg1.mix(vg1, vg3, fg1); vg1.faceforward(vg1, sv.I); vg1.normalize(vg1); vg2.normalize(sv.I); vg2.negate(vg2); sv.Oi.set(sv.Os); ambient(sv, cg1); cg3.set(Ka); cg1.mul(cg1, cg3); diffuse(sv, vg1, cg2); cg3.set(Kd); cg2.mul(cg2, cg3); cg1.add(cg1, cg2); cg4.mix(rootcolor, tipcolor, sv.v); cg1.mul(cg1, cg4); specular(sv, vg1, vg2, roughness, cg2); cg3.set(Ks); cg2.mul(cg2, cg3); cg3.set(specularcolor); cg2.mul(cg2, cg3); cg1.add(cg1, cg2); sv.Ci.mul(sv.Oi, cg1); } } Index: SurfaceAlphaplastic.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/SurfaceAlphaplastic.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SurfaceAlphaplastic.java 13 Apr 2004 20:37:03 -0000 1.3 --- SurfaceAlphaplastic.java 29 Dec 2006 19:45:30 -0000 1.4 *************** *** 1,19 **** /* ! SurfaceAlphaplastic.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! SurfaceAlphaplastic.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
From: Gerardo H. <ma...@us...> - 2006-12-29 19:45:36
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25444/src/org/jrman/primitive Modified Files: CubicCurve.java Log Message: Hair shader tests. Index: CubicCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/CubicCurve.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CubicCurve.java 26 Dec 2006 17:26:19 -0000 1.2 --- CubicCurve.java 29 Dec 2006 19:45:30 -0000 1.3 *************** *** 370,374 **** dice_dPdu(shaderVariables); dice_dPdv(shaderVariables); - dice_N(shaderVariables); dice_Cs(shaderVariables); dice_Os(shaderVariables); --- 370,373 ---- |
From: Gerardo H. <ma...@us...> - 2006-12-27 16:30:34
|
Update of /cvsroot/jrman/drafts/src/net/falappa/imageio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10785/src/net/falappa/imageio Modified Files: ImageViewerPanelLoadAction.java ImageViewerPanelSaveAction.java Log Message: Changed copyright unicode character to "(C)". Index: ImageViewerPanelSaveAction.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/imageio/ImageViewerPanelSaveAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ImageViewerPanelSaveAction.java 11 Dec 2003 15:08:06 -0000 1.4 --- ImageViewerPanelSaveAction.java 27 Dec 2006 16:30:18 -0000 1.5 *************** *** 1,4 **** //Chicchi ! //Copyright © 2003, Alessandro Falappa // //Contact: ale...@fa... --- 1,4 ---- //Chicchi ! //Copyright (C) 2003, Alessandro Falappa // //Contact: ale...@fa... Index: ImageViewerPanelLoadAction.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/imageio/ImageViewerPanelLoadAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImageViewerPanelLoadAction.java 25 Nov 2003 06:00:55 -0000 1.2 --- ImageViewerPanelLoadAction.java 27 Dec 2006 16:30:18 -0000 1.3 *************** *** 1,4 **** //Chicchi ! //Copyright © 2003, Alessandro Falappa // //Contact: ale...@fa... --- 1,4 ---- //Chicchi ! //Copyright (C) 2003, Alessandro Falappa // //Contact: ale...@fa... |
From: Gerardo H. <ma...@us...> - 2006-12-27 16:30:31
|
Update of /cvsroot/jrman/drafts/src/net/falappa/swing/widgets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10785/src/net/falappa/swing/widgets Modified Files: JImageViewerPanel.java Log Message: Changed copyright unicode character to "(C)". Index: JImageViewerPanel.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/net/falappa/swing/widgets/JImageViewerPanel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JImageViewerPanel.java 11 Feb 2004 16:08:06 -0000 1.5 --- JImageViewerPanel.java 27 Dec 2006 16:30:19 -0000 1.6 *************** *** 1,4 **** //Chicchi ! //Copyright © 2003, Alessandro Falappa // //Contact: ale...@fa... --- 1,4 ---- //Chicchi ! //Copyright (C) 2003, Alessandro Falappa // //Contact: ale...@fa... |
From: Gerardo H. <ma...@us...> - 2006-12-26 17:26:24
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28305/src/org/jrman/primitive Modified Files: CubicCurve.java LinearCurve.java Log Message: Implemented "N" twisting for cubic curves. Index: CubicCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/CubicCurve.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CubicCurve.java 25 Dec 2006 07:50:37 -0000 1.1 --- CubicCurve.java 26 Dec 2006 17:26:19 -0000 1.2 *************** *** 23,27 **** import javax.vecmath.Point3f; import javax.vecmath.Point4f; - import javax.vecmath.Vector2f; import javax.vecmath.Vector3f; --- 23,26 ---- *************** *** 153,157 **** static Vector3f v3 = new Vector3f(); ! static Vector2f v2 = new Vector2f(); static Point4f PV0 = new Point4f(); --- 152,156 ---- static Vector3f v3 = new Vector3f(); ! static Vector3f vTmp = new Vector3f(); static Point4f PV0 = new Point4f(); *************** *** 366,370 **** // dice_s(shaderVariables); // dice_t(shaderVariables); ! dice_PandNg(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); --- 365,369 ---- // dice_s(shaderVariables); // dice_t(shaderVariables); ! dice_Ng_N_P(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); *************** *** 377,383 **** } ! protected void dice_PandNg(ShaderVariables shaderVariables) { v3.set(0f, 0f, -1f); shaderVariables.Ng.set(v3); extractPoints(); objectToCamera.transformHPoint(pa, pa); --- 376,390 ---- } ! protected void dice_Ng_N_P(ShaderVariables shaderVariables) { ! boolean hasN = false; v3.set(0f, 0f, -1f); shaderVariables.Ng.set(v3); + VaryingScalarTuple3f param = + (VaryingScalarTuple3f) parameters.getParameter("N"); + if (param != null) { + param.linearDice(shaderVariables.N); + hasN = true; + } else + shaderVariables.N.set(shaderVariables.Ng); extractPoints(); objectToCamera.transformHPoint(pa, pa); *************** *** 402,405 **** --- 409,413 ---- objectToCamera.transformVector(v3, v3); wd = v3.length() /2; + Vector3fGrid N = shaderVariables.N; v = 0f; for (int i = 0; i < nv; i++) { *************** *** 408,421 **** if (i < nv - 1) { P.get(0, i + 1, p3fb); ! v2.set(p3fb.x - p3fa.x, p3fb.y - p3fa.y); ! Calc.perp(v2, v2); ! v2.normalize(); } ! p3fb.x = p3fa.x - v2.x * wv; ! p3fb.y = p3fa.y - v2.y * wv; ! p3fb.z = p3fa.z; P.set(0, i, p3fb); ! p3fb.x = p3fa.x + v2.x * wv; ! p3fb.y = p3fa.y + v2.y * wv; P.set(1, i, p3fb); v += vStep; --- 416,432 ---- if (i < nv - 1) { P.get(0, i + 1, p3fb); ! if (!hasN) { ! p3fa.z = 0f; ! p3fb.z = 0f; ! } ! v3.sub(p3fb, p3fa); } ! N.get(0, i, vTmp); ! vTmp.cross(v3, vTmp); ! vTmp.normalize(); ! P.get(0, i, p3fa); ! p3fb.scaleAdd(wv, vTmp, p3fa); P.set(0, i, p3fb); ! p3fb.scaleAdd(-wv, vTmp, p3fa); P.set(1, i, p3fb); v += vStep; Index: LinearCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/LinearCurve.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LinearCurve.java 26 Dec 2006 16:58:47 -0000 1.2 --- LinearCurve.java 26 Dec 2006 17:26:19 -0000 1.3 *************** *** 21,25 **** import javax.vecmath.Point3f; - import javax.vecmath.Vector2f; import javax.vecmath.Vector3f; --- 21,24 ---- *************** *** 201,205 **** // dice_s(shaderVariables); // dice_t(shaderVariables); ! dice_N_Ng_P(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); --- 200,204 ---- // dice_s(shaderVariables); // dice_t(shaderVariables); ! dice_Ng_N_P(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); *************** *** 211,215 **** } ! protected void dice_N_Ng_P(ShaderVariables shaderVariables) { boolean hasN = false; v3.set(0f, 0f, -1f); --- 210,214 ---- } ! protected void dice_Ng_N_P(ShaderVariables shaderVariables) { boolean hasN = false; v3.set(0f, 0f, -1f); *************** *** 235,240 **** pTmp2.set(pb); if (!hasN) { ! pTmp1.z = 0; ! pTmp2.z = 0; } v3.sub(pTmp2, pTmp1); --- 234,239 ---- pTmp2.set(pb); if (!hasN) { ! pTmp1.z = 0f; ! pTmp2.z = 0f; } v3.sub(pTmp2, pTmp1); |
From: Gerardo H. <ma...@us...> - 2006-12-26 17:26:24
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28305/sampleData Modified Files: curves.rib Log Message: Implemented "N" twisting for cubic curves. Index: curves.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/curves.rib,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** curves.rib 26 Dec 2006 16:58:47 -0000 1.4 --- curves.rib 26 Dec 2006 17:26:18 -0000 1.5 *************** *** 1,5 **** Display "curves.png" "framebuffer" "rgb" PixelFilter "gaussian" 2 2 ! Format 1000 750 1 PixelSamples 8 8 Exposure 1 1.8 --- 1,5 ---- Display "curves.png" "framebuffer" "rgb" PixelFilter "gaussian" 2 2 ! Format 800 600 1 PixelSamples 8 8 Exposure 1 1.8 *************** *** 37,39 **** --- 37,43 ---- "N" [0 0 1 0 1 0 0 0 -1] "width" [.25 .5 .25] + Curves "cubic" [4] "nonperiodic" + "P" [-3 0 0 -3 2 0 -2 2 0 -2 3 0] + "N" [0 0 -1 -1 0 0] + "constantwidth" [.4] WorldEnd |
From: Gerardo H. <ma...@us...> - 2006-12-26 16:58:56
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17387/src/org/jrman/primitive Modified Files: LinearCurve.java Log Message: Implemented "N" twisting for linear curves. Index: LinearCurve.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/LinearCurve.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LinearCurve.java 24 Dec 2006 05:25:57 -0000 1.1 --- LinearCurve.java 26 Dec 2006 16:58:47 -0000 1.2 *************** *** 122,128 **** static Point3f pb = new Point3f(); static Vector3f v3 = new Vector3f(); ! static Vector2f v2 = new Vector2f(); static float wa; --- 122,132 ---- static Point3f pb = new Point3f(); + static Point3f pTmp1 = new Point3f(); + + static Point3f pTmp2 = new Point3f(); + static Vector3f v3 = new Vector3f(); ! static Vector3f vTmp = new Vector3f(); static float wa; *************** *** 197,206 **** // dice_s(shaderVariables); // dice_t(shaderVariables); ! dice_PandNg(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); dice_dPdu(shaderVariables); dice_dPdv(shaderVariables); - dice_N(shaderVariables); dice_Cs(shaderVariables); dice_Os(shaderVariables); --- 201,209 ---- // dice_s(shaderVariables); // dice_t(shaderVariables); ! dice_N_Ng_P(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); dice_dPdu(shaderVariables); dice_dPdv(shaderVariables); dice_Cs(shaderVariables); dice_Os(shaderVariables); *************** *** 208,214 **** } ! protected void dice_PandNg(ShaderVariables shaderVariables) { v3.set(0f, 0f, -1f); shaderVariables.Ng.set(v3); extractPoints(); extractWidths(); --- 211,225 ---- } ! protected void dice_N_Ng_P(ShaderVariables shaderVariables) { ! boolean hasN = false; v3.set(0f, 0f, -1f); shaderVariables.Ng.set(v3); + VaryingScalarTuple3f param = + (VaryingScalarTuple3f) parameters.getParameter("N"); + if (param != null) { + param.linearDice(shaderVariables.N); + hasN = true; + } else + shaderVariables.N.set(shaderVariables.Ng); extractPoints(); extractWidths(); *************** *** 221,252 **** objectToCamera.transformVector(v3, v3); wb = v3.length() /2; ! v2.set(pb.x - pa.x, pb.y - pa.y); ! Calc.perp(v2, v2); ! v2.normalize(); ! float aax = pa.x - v2.x * wa; ! float aay = pa.y - v2.y * wa; ! float aaz = pa.z; ! float abx = pa.x + v2.x * wa; ! float aby = pa.y + v2.y * wa; ! float abz = pa.z; ! float bax = pb.x - v2.x * wb; ! float bay = pb.y - v2.y * wb; ! float baz = pb.z; ! float bbx = pb.x + v2.x * wb; ! float bby = pb.y + v2.y * wb; ! float bbz = pb.z; Point3fGrid P = shaderVariables.P; int vSize = Grid.getVSize(); float vStep = 1f / (vSize - 1); float v = 0; for (int i = 0; i < vSize; i++) { ! pa.x = Calc.interpolate(aax, bax, v); ! pa.y = Calc.interpolate(aay, bay, v); ! pa.z = Calc.interpolate(aaz, baz, v); ! pb.x = Calc.interpolate(abx, bbx, v); ! pb.y = Calc.interpolate(aby, bby, v); ! pb.z = Calc.interpolate(abz, bbz, v); ! P.set(0, i, pa); ! P.set(1, i, pb); v += vStep; } --- 232,257 ---- objectToCamera.transformVector(v3, v3); wb = v3.length() /2; ! pTmp1.set(pa); ! pTmp2.set(pb); ! if (!hasN) { ! pTmp1.z = 0; ! pTmp2.z = 0; ! } ! v3.sub(pTmp2, pTmp1); Point3fGrid P = shaderVariables.P; + Vector3fGrid N = shaderVariables.N; int vSize = Grid.getVSize(); float vStep = 1f / (vSize - 1); float v = 0; for (int i = 0; i < vSize; i++) { ! N.get(0, i, vTmp); ! vTmp.cross(v3, vTmp); ! vTmp.normalize(); ! Calc.interpolate(pa, pb, v, pTmp1); ! float w = Calc.interpolate(wa, wb, v); ! pTmp2.scaleAdd(w, vTmp, pTmp1); ! P.set(0, i, pTmp2); ! pTmp2.scaleAdd(-w, vTmp, pTmp1); ! P.set(1, i, pTmp2); v += vStep; } |
From: Gerardo H. <ma...@us...> - 2006-12-26 16:58:56
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17387/sampleData Modified Files: curves.rib Log Message: Implemented "N" twisting for linear curves. Index: curves.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/curves.rib,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** curves.rib 25 Dec 2006 19:17:58 -0000 1.3 --- curves.rib 26 Dec 2006 16:58:47 -0000 1.4 *************** *** 35,39 **** Curves "linear" [3] "nonperiodic" "P" [-3 -3 0 0 -3 0 3 -3 0] ! "N" [0 1 1 0 2 0 0 1 -1] ! "width" [.025 .05 .025] WorldEnd --- 35,39 ---- Curves "linear" [3] "nonperiodic" "P" [-3 -3 0 0 -3 0 3 -3 0] ! "N" [0 0 1 0 1 0 0 0 -1] ! "width" [.25 .5 .25] WorldEnd |
From: Gerardo H. <ma...@us...> - 2006-12-25 19:18:08
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32215/sampleData Modified Files: curves.rib Added Files: curves2.rib Log Message: Added curves test from http://www.dotcsw.com/poy2005.txt Index: curves.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/curves.rib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** curves.rib 25 Dec 2006 07:50:36 -0000 1.2 --- curves.rib 25 Dec 2006 19:17:58 -0000 1.3 *************** *** 1,8 **** Display "curves.png" "framebuffer" "rgb" PixelFilter "gaussian" 2 2 ! Format 800 600 1 PixelSamples 8 8 Exposure 1 1.8 ! Projection "perspective" "fov" [35] LightSource "distantlight" 1 "intensity" [0.8] "from" [1 1 -1] "to" [0 0 0] --- 1,8 ---- Display "curves.png" "framebuffer" "rgb" PixelFilter "gaussian" 2 2 ! Format 1000 750 1 PixelSamples 8 8 Exposure 1 1.8 ! Projection "perspective" "fov" [20] LightSource "distantlight" 1 "intensity" [0.8] "from" [1 1 -1] "to" [0 0 0] --- NEW FILE: curves2.rib --- PixelSamples 2 2 Format 320 240 1 Display "curves2.png" "framebuffer" "rgb" Projection "orthographic" Scale 1.5 1.5 1.5 Translate -0.5 -0.55 5 WorldBegin Surface "constant" Color 1 1 1 # White background Patch "bilinear" "P" [-2 2 1 2 2 1 -2 -2 1 2 -2 1] # Control polygon Color 0.8 0.8 0.5 Curves "linear" [4] "nonperiodic" "P" [0 0 0 0 1 0 1 1 0 1 0 0] "constantwidth" [0.01] # Power basis Color 0.9 0.3 0.3 Basis "bezier" 3 "power" 4 Curves "cubic" [4] "nonperiodic" "P" [-2 0 0 3 -3 0 0 3 0 0 0 0] "constantwidth" [0.02] # Bezier basis Translate 0 0 0.1 Color 0.8 0.8 0.8 Basis "bezier" 3 "bezier" 3 Curves "cubic" [4] "nonperiodic" "P" [0 0 0 0 1 0 1 1 0 1 0 0] "constantwidth" [0.01] WorldEnd |
From: Gerardo H. <ma...@us...> - 2006-12-25 07:51:10
|
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26654/src/org/jrman/primitive Modified Files: BicubicPatch.java Cone.java Cylinder.java Disk.java Hyperboloid.java NurbsRI.java Paraboloid.java Sphere.java Torus.java Added Files: CubicCurve.java Log Message: First implementation of cubic curves. Index: Torus.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Torus.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Torus.java 24 Dec 2006 05:25:57 -0000 1.9 --- Torus.java 25 Dec 2006 07:50:37 -0000 1.10 *************** *** 130,134 **** public Primitive[] split() { Primitive[] result = new Primitive[2]; ! if ((thetaMax - thetaMin) * majorRadius > (phiMax - phiMin) * minorRadius) { result[0] = new Torus( --- 130,135 ---- public Primitive[] split() { Primitive[] result = new Primitive[2]; ! if ((thetaMax - thetaMin) * majorRadius > ! (phiMax - phiMin) * minorRadius) { result[0] = new Torus( *************** *** 151,156 **** bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } else { result[0] = --- 152,155 ---- *************** *** 174,179 **** bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } return result; --- 173,176 ---- Index: Hyperboloid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Hyperboloid.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Hyperboloid.java 24 Dec 2006 05:25:57 -0000 1.9 --- Hyperboloid.java 25 Dec 2006 07:50:37 -0000 1.10 *************** *** 135,139 **** } ! private float[] analizeAngleCase(float r, float gammaMin, float gammaMax) { float[] values = new float[4]; --- 135,140 ---- } ! private float[] analizeAngleCase(float r, float gammaMin, ! float gammaMax) { float[] values = new float[4]; *************** *** 163,167 **** if (passAngle((float) Math.PI * 3f / 2f, gammaMin, gammaMax) || passAngle( ! (float) Math.PI * 3f / 2f + (float) Math.PI * 2f, gammaMin, gammaMax)) { --- 164,168 ---- if (passAngle((float) Math.PI * 3f / 2f, gammaMin, gammaMax) || passAngle( ! (float) Math.PI * 3f / 2f + (float) Math.PI * 2f, gammaMin, gammaMax)) { *************** *** 169,173 **** } if (passAngle(0f, gammaMin, gammaMax) ! || passAngle((float) Math.PI * 2f, gammaMin, gammaMax)) { xMax = r; } --- 170,175 ---- } if (passAngle(0f, gammaMin, gammaMax) ! || passAngle( ! (float) Math.PI * 2f, gammaMin, gammaMax)) { xMax = r; } *************** *** 184,195 **** float r2 = (float) Math.sqrt((x2 * x2) + (y2 * y2)); float r = ! (float) Math.sqrt( ! (x2 - x1) * (x2 - x1) ! + (y2 - y1) * (y2 - y1) ! + (z2 - z1) * (z2 - z1)); Primitive[] result = new Primitive[2]; if ((thetaMax - thetaMin) * (float) Math.max(r1, r2) > r) { ! result[0] = ! new Hyperboloid( x1, y1, --- 186,197 ---- float r2 = (float) Math.sqrt((x2 * x2) + (y2 * y2)); float r = ! (float) Math.sqrt( ! (x2 - x1) * (x2 - x1) ! + (y2 - y1) * (y2 - y1) ! + (z2 - z1) * (z2 - z1)); Primitive[] result = new Primitive[2]; if ((thetaMax - thetaMin) * (float) Math.max(r1, r2) > r) { ! result[0] = ! new Hyperboloid( x1, y1, *************** *** 200,207 **** thetaMin, (thetaMin + thetaMax) / 2f, ! bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); ! result[1] = ! new Hyperboloid( x1, y1, --- 202,210 ---- thetaMin, (thetaMin + thetaMax) / 2f, ! bilinearInterpolateParameters(0f, .5f, ! 0f, 1f), attributes); ! result[1] = ! new Hyperboloid( x1, y1, *************** *** 212,222 **** (thetaMin + thetaMax) / 2f, thetaMax, ! bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } else { ! result[0] = ! new Hyperboloid( x1, y1, --- 215,224 ---- (thetaMin + thetaMax) / 2f, thetaMax, ! bilinearInterpolateParameters(.5f, 1f, ! 0f, 1f), attributes); } else { ! result[0] = ! new Hyperboloid( x1, y1, *************** *** 227,234 **** thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); ! result[1] = ! new Hyperboloid( (x1 + x2) / 2f, (y1 + y2) / 2f, --- 229,237 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, ! 0f, .5f), attributes); ! result[1] = ! new Hyperboloid( (x1 + x2) / 2f, (y1 + y2) / 2f, *************** *** 239,246 **** thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } return result; --- 242,248 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, ! .5f, 1f), attributes); } return result; Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Sphere.java 24 Dec 2006 05:25:57 -0000 1.22 --- Sphere.java 25 Dec 2006 07:50:37 -0000 1.23 *************** *** 141,146 **** bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } else { result[0] = --- 141,144 ---- *************** *** 162,167 **** bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } return result; --- 160,163 ---- --- NEW FILE: CubicCurve.java --- /* CubicCurve.java Copyright (C) 2006 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.primitive; import javax.vecmath.Matrix4f; import javax.vecmath.Point3f; import javax.vecmath.Point4f; import javax.vecmath.Vector2f; import javax.vecmath.Vector3f; import org.jrman.attributes.Attributes; import org.jrman.attributes.MutableAttributes; import org.jrman.geom.BoundingVolume; import org.jrman.geom.ConvexHull3f; import org.jrman.grid.FloatGrid; import org.jrman.grid.Grid; import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; import org.jrman.parameters.Declaration; import org.jrman.parameters.ParameterList; import org.jrman.parameters.VaryingScalarFloat; import org.jrman.parameters.VaryingScalarHPoint; import org.jrman.parameters.VaryingScalarTuple3f; import org.jrman.parameters.UniformScalarFloat; import org.jrman.render.ShaderVariables; import org.jrman.util.Calc; public class CubicCurve extends Primitive { static Point3f tmpPoint = new Point3f(); boolean periodic; public CubicCurve(boolean periodic, ParameterList parameters, Attributes attributes) { this.periodic = periodic; this.parameters = parameters; VaryingScalarFloat widthParam = (VaryingScalarFloat) parameters.getParameter("width"); UniformScalarFloat constantWidthParam = (UniformScalarFloat) parameters.getParameter("constantwidth"); float w; if (widthParam != null) { w = 0f; int n = widthParam.getCount(); for (int i = 0; i < n; i++) { float wi = widthParam.getValue(i); if (wi > w) w = wi; } } else if (constantWidthParam != null) w = constantWidthParam.getValue(); else w = 1f; MutableAttributes attr = new MutableAttributes(attributes); attr.setDisplacementBound(attributes.getDisplacementBound() + w / 2f); this.attributes = attr; } public BoundingVolume getBoundingVolume() { VaryingScalarTuple3f points = (VaryingScalarTuple3f) parameters.getParameter("P"); ConvexHull3f ch = new ConvexHull3f(); for (int i = 0, n = points.getCount(); i < n; i++) { points.getValue(i, tmpPoint); ch.addPoint(tmpPoint); } return ch; } public Primitive[] split() { VaryingScalarTuple3f points = (VaryingScalarTuple3f) parameters.getParameter("P"); int n = points.getCount(); int vStep = attributes.getVStep(); int nv; int lnv; if (periodic) { nv = n / vStep; lnv = nv; } else { nv = (n - 4) / vStep + 1; lnv = nv + 1; } Primitive[] result = new Primitive[nv]; int[] uniformIndex = new int[1]; uniformIndex[0] = 0; int[] varyingIndexes = new int[2]; int[] vertexIndexes = new int[4]; int i = 0; for (int ii = 0; ii < nv; ii++) { varyingIndexes[0] = ii % lnv; varyingIndexes[1] = (ii + 1) % lnv; vertexIndexes[0] = i % nv; vertexIndexes[1] = (i + 1) % n; vertexIndexes[2] = (i + 2) % n; vertexIndexes[3] = (i + 3) % n; result[i] = new CubicSegment(parameters.selectValues(uniformIndex, varyingIndexes, vertexIndexes), attributes); i += vStep; } return result; } public boolean isReadyToBeDiced(int gridsize) { return false; } private static class CubicSegment extends Primitive { final static Declaration DECL_PW = new Declaration("Pw", Declaration.StorageClass.VERTEX, Declaration.Type.HPOINT, 1); static Point4f pa = new Point4f(); static Point4f pb = new Point4f(); static Point4f pc = new Point4f(); static Point4f pd = new Point4f(); static Point4f pta = new Point4f(); static Point4f ptb = new Point4f(); static Point4f ptc = new Point4f(); static Point4f ptd = new Point4f(); static Vector3f v3 = new Vector3f(); static Vector2f v2 = new Vector2f(); static Point4f PV0 = new Point4f(); static Point4f PV1 = new Point4f(); static Point3f p3fa = new Point3f(); static Point3f p3fb = new Point3f(); static float wa; static float wd; CubicSegment(ParameterList parameters, Attributes attributes) { this(parameters, attributes, true); } CubicSegment(ParameterList parameters, Attributes attributes, boolean apply) { this.parameters = parameters; this.attributes = attributes; if (apply) applyBasis(); } public BoundingVolume getBoundingVolume() { ConvexHull3f ch = new ConvexHull3f(); extractPoints(); ch.addHpoint(pa); ch.addHpoint(pb); ch.addHpoint(pc); ch.addHpoint(pd); return ch; } private void extractPoints() { VaryingScalarTuple3f param3f = (VaryingScalarTuple3f) parameters.getParameter("P"); if (param3f != null) { parameters.removeParameter("P"); parameters.addParameter( new VaryingScalarHPoint(DECL_PW, param3f)); } VaryingScalarHPoint paramHp = (VaryingScalarHPoint) parameters.getParameter("Pw"); paramHp.getValue(0, pa); paramHp.getValue(1, pb); paramHp.getValue(2, pc); paramHp.getValue(3, pd); } private void setPoints() { VaryingScalarHPoint paramHp = (VaryingScalarHPoint) parameters.getParameter("Pw"); paramHp.setValue(0, pa); paramHp.setValue(1, pb); paramHp.setValue(2, pc); paramHp.setValue(3, pd); } private void applyBasis() { extractPoints(); Matrix4f hv = attributes.getVBasis().getToBezier(); applyBasis(pa, pb, pc, pd, 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; p1.x = PV0.y; p2.x = PV0.z; p3.x = PV0.w; applyBasis(p0.y, p1.y, p2.y, p3.y, h, PV0); p0.y = PV0.x; p1.y = PV0.y; p2.y = PV0.z; p3.y = PV0.w; applyBasis(p0.z, p1.z, p2.z, p3.z, h, PV0); p0.z = PV0.x; p1.z = PV0.y; p2.z = PV0.z; p3.z = PV0.w; applyBasis(p0.w, p1.w, p2.w, p3.w, h, PV0); p0.w = PV0.x; p1.w = PV0.y; p2.w = PV0.z; p3.w = PV0.w; } 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); } private void extractWidths() { VaryingScalarFloat widthParam = (VaryingScalarFloat) parameters.getParameter("width"); if (widthParam != null) { wa = widthParam.getValue(0); wd = widthParam.getValue(1); } else { UniformScalarFloat constantWidthParam = (UniformScalarFloat) parameters.getParameter("constantwidth"); if (constantWidthParam != null) wa = wd = constantWidthParam.getValue(); else wa = wd = 1f; } } public Primitive[] split() { Primitive[] result = new Primitive[2]; result[0] = new CubicSegment(cubicInterpolateParameters(0f, .5f), attributes, false); result[1] = new CubicSegment(cubicInterpolateParameters(.5f, 1), attributes, false); return result; } private ParameterList cubicInterpolateParameters(float min, float max) { ParameterList result = linearInterpolateParameters(min, max); extractPoints(); VaryingScalarHPoint sparam = new VaryingScalarHPoint(DECL_PW, new float[4 * 4]); if (min == 0.5f) splitUpper(pa, pb, pc, pd, pta, ptb, ptc, ptd); else splitLower(pa, pb, pc, pd, pta, ptb, ptc, ptd); sparam.setValue(0, pta); sparam.setValue(1, ptb); sparam.setValue(2, ptc); sparam.setValue(3, ptd); result.addParameter(sparam); return result; } private 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); out1.scale(.5f); out2.set(in1); out2.scale(2f); out2.add(in0); out2.add(in2); out2.scale(.25f); out3.add(in1, in2); out3.scale(3f); out3.add(in0); out3.add(in3); out3.scale(.125f); } private 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); out2.scale(.5f); out1.set(in2); out1.scale(2f); out1.add(in3); out1.add(in1); out1.scale(.25f); out0.add(in2, in1); out0.scale(3f); out0.add(in3); out0.add(in0); out0.scale(.125f); } public boolean isReadyToBeDiced(int gridSize) { float sw = rasterBounds.getWidth(); float sh = rasterBounds.getHeight(); float length = (float) Math.sqrt(sw * sw + sh * sw); boolean ready = length <= (gridSize / 2) * attributes.getShadingRate(); if (!ready) return false; float idealSize = length / (2f * attributes.getShadingRate()); idealSize = Calc.clamp(idealSize, 40, gridSize / 2); int vSize = (int) Math.ceil(idealSize); Grid.setSize(2, vSize); return true; } public void dice(ShaderVariables shaderVariables) { shaderVariables.attributes = attributes; shaderVariables.parameters = parameters; dice_u(shaderVariables); dice_v(shaderVariables); // dice_s(shaderVariables); // dice_t(shaderVariables); dice_PandNg(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); dice_dPdu(shaderVariables); dice_dPdv(shaderVariables); dice_N(shaderVariables); dice_Cs(shaderVariables); dice_Os(shaderVariables); dice_others(shaderVariables); } protected void dice_PandNg(ShaderVariables shaderVariables) { v3.set(0f, 0f, -1f); shaderVariables.Ng.set(v3); extractPoints(); objectToCamera.transformHPoint(pa, pa); objectToCamera.transformHPoint(pb, pb); objectToCamera.transformHPoint(pc, pc); objectToCamera.transformHPoint(pd, pd); Point3fGrid P = shaderVariables.P; int nv = Grid.getVSize(); float vStep = 1f / (nv - 1); float v = 0f; for (int i = 0; i < nv; i++) { Calc.bezierInterpolate(pa, pb, pc, pd, v, PV0); p3fa.project(PV0); P.set(0, i, p3fa); v += vStep; } extractWidths(); v3.set(wa, 0f, 0f); objectToCamera.transformVector(v3, v3); wa = v3.length() / 2; v3.set(wd, 0f, 0f); objectToCamera.transformVector(v3, v3); wd = v3.length() /2; v = 0f; for (int i = 0; i < nv; i++) { float wv = Calc.interpolate(wa, wd, v); P.get(0, i, p3fa); if (i < nv - 1) { P.get(0, i + 1, p3fb); v2.set(p3fb.x - p3fa.x, p3fb.y - p3fa.y); Calc.perp(v2, v2); v2.normalize(); } p3fb.x = p3fa.x - v2.x * wv; p3fb.y = p3fa.y - v2.y * wv; p3fb.z = p3fa.z; P.set(0, i, p3fb); p3fb.x = p3fa.x + v2.x * wv; p3fb.y = p3fa.y + v2.y * wv; P.set(1, i, p3fb); v += vStep; } } protected void dice_u(ShaderVariables shaderVariables) { FloatGrid g = shaderVariables.u; int vSize = Grid.getVSize(); for (int i = 0; i < vSize; i++) { g.set(0, i, 0f); g.set(1, i, 1f); } } protected void dice_v(ShaderVariables shaderVariables) { FloatGrid g = shaderVariables.v; int vSize = Grid.getVSize(); float vStep = 1f / (vSize - 1); float v = 0; for (int i = 0; i < vSize; i++) { g.set(0, i, v); g.set(1, i, v); v += vStep; } } } } Index: NurbsRI.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/NurbsRI.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NurbsRI.java 24 Dec 2006 05:25:57 -0000 1.11 --- NurbsRI.java 25 Dec 2006 07:50:37 -0000 1.12 *************** *** 278,283 **** } - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); return result; } --- 278,281 ---- Index: Disk.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Disk.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Disk.java 24 Dec 2006 05:25:57 -0000 1.10 --- Disk.java 25 Dec 2006 07:50:37 -0000 1.11 *************** *** 126,131 **** bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } else{ --- 126,129 ---- *************** *** 148,153 **** bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } return result; --- 146,149 ---- Index: Paraboloid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Paraboloid.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Paraboloid.java 24 Dec 2006 05:25:57 -0000 1.9 --- Paraboloid.java 25 Dec 2006 07:50:37 -0000 1.10 *************** *** 149,154 **** bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } else { result[0] = --- 149,152 ---- *************** *** 176,181 **** bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } return result; --- 174,177 ---- Index: Cone.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Cone.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Cone.java 24 Dec 2006 05:25:57 -0000 1.8 --- Cone.java 25 Dec 2006 07:50:37 -0000 1.9 *************** *** 1,5 **** /* Cone.java ! Copyright (C) 2003, 2004 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or --- 1,5 ---- /* Cone.java ! Copyright (C) 2003, 2004, 2006 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or *************** *** 112,116 **** public Primitive[] split() { Primitive[] result = new Primitive[2]; ! float r = Math.max(radius * (1 - zmax / height), radius * (1 - zmin / height)); if ((thetaMax - thetaMin) * r > zmax - zmin) { result[0] = --- 112,117 ---- public Primitive[] split() { Primitive[] result = new Primitive[2]; ! float r = Math.max(radius * (1 - zmax / height), ! radius * (1 - zmin / height)); if ((thetaMax - thetaMin) * r > zmax - zmin) { result[0] = *************** *** 134,139 **** bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } else { result[0] = --- 135,138 ---- *************** *** 157,162 **** bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } return result; --- 156,159 ---- Index: Cylinder.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Cylinder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Cylinder.java 24 Dec 2006 05:25:57 -0000 1.8 --- Cylinder.java 25 Dec 2006 07:50:37 -0000 1.9 *************** *** 117,122 **** bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } else { result[0] = --- 117,120 ---- *************** *** 138,143 **** bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); - result[0].setObjectToCamera(objectToCamera); - result[1].setObjectToCamera(objectToCamera); } return result; --- 136,139 ---- Index: BicubicPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/BicubicPatch.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** BicubicPatch.java 24 Dec 2006 05:25:57 -0000 1.20 --- BicubicPatch.java 25 Dec 2006 07:50:37 -0000 1.21 *************** *** 119,123 **** } ! private BicubicPatch(ParameterList parameters, Attributes attributes, boolean apply) { super(parameters, attributes); if (apply) --- 119,124 ---- } ! private BicubicPatch(ParameterList parameters, Attributes attributes, ! boolean apply) { super(parameters, attributes); if (apply) *************** *** 194,198 **** } ! 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; --- 195,200 ---- } ! 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; *************** *** 265,280 **** if (ul > vl) { result[0] = ! new BicubicPatch(bezierInterpolateParameters(0f, .5f, 0f, 1f), attributes, false); result[1] = ! new BicubicPatch(bezierInterpolateParameters(.5f, 1f, 0f, 1f), attributes, false); ! result[0].setObjectToCamera(objectToCamera); ! result[1].setObjectToCamera(objectToCamera); } else { result[0] = ! new BicubicPatch(bezierInterpolateParameters(0f, 1f, 0f, .5f), attributes, false); result[1] = ! new BicubicPatch(bezierInterpolateParameters(0f, 1f, .5f, 1f), attributes, false); ! result[0].setObjectToCamera(objectToCamera); ! result[1].setObjectToCamera(objectToCamera); } return result; --- 267,282 ---- if (ul > vl) { result[0] = ! new BicubicPatch(bezierInterpolateParameters(0f, .5f, 0f, 1f), ! attributes, false); result[1] = ! new BicubicPatch(bezierInterpolateParameters(.5f, 1f, 0f, 1f), ! attributes, false); } else { result[0] = ! new BicubicPatch(bezierInterpolateParameters(0f, 1f, 0f, .5f), ! attributes, false); result[1] = ! new BicubicPatch(bezierInterpolateParameters(0f, 1f, .5f, 1f), ! attributes, false); } return result; |
From: Gerardo H. <ma...@us...> - 2006-12-25 07:51:10
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26654/src/org/jrman/parser Modified Files: Global.java Parser.java Log Message: First implementation of cubic curves. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** Parser.java 24 Dec 2006 05:25:57 -0000 1.108 --- Parser.java 25 Dec 2006 07:50:37 -0000 1.109 *************** *** 76,79 **** --- 76,80 ---- import org.jrman.primitive.BilinearPatch; import org.jrman.primitive.Cone; + import org.jrman.primitive.CubicCurve; import org.jrman.primitive.Cylinder; import org.jrman.primitive.DelayedReadArchive; *************** *** 1291,1296 **** for (int j = 0; j < indexes.length; j++) indexes[j] = ptr++; ! addLinearCurve(periodic, parameters.selectValues(uniformIndex, ! indexes, indexes)); } } --- 1292,1321 ---- for (int j = 0; j < indexes.length; j++) indexes[j] = ptr++; ! addLinearCurve(periodic, ! parameters.selectValues(uniformIndex, ! indexes, indexes)); ! } ! } ! ! private void addCubicCurve(final boolean periodic, ! final ParameterList parameters) { ! if (inAreaLightSource) ! return; ! if (!inObject) { ! CubicCurve curve = new CubicCurve(periodic, parameters, ! getAttributes()); ! renderer.addPrimitive(curve); ! curveCount++; ! } else { ! final Transform transform = currentAttributes.getTransform(); ! currentObjectInstanceList ! .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { ! public Primitive create(Attributes attributes) { ! curveCount++; ! return new CubicCurve(periodic, parameters, ! createAttributes(transform, ! attributes)); ! } ! }); } } *************** *** 1298,1302 **** public void addCubicCurves(int[] nVertices, String wrap, ParameterList parameters) { ! } --- 1323,1349 ---- public void addCubicCurves(int[] nVertices, String wrap, ParameterList parameters) { ! boolean periodic = wrap.equals("periodic"); ! int vStep = currentAttributes.getVStep(); ! int[] uniformIndex = new int[1]; ! int varyingPtr = 0; ! int vertexPtr = 0; ! for (int i = 0; i < nVertices.length; i++) { ! uniformIndex[0] = i; ! int nv; ! if (periodic) ! nv = nVertices[i] / vStep; ! else ! nv = (nVertices[i] - 4) / vStep + 2; ! int[] varyingIndexes = new int[nv]; ! for (int j = 0; j < nv; j++) ! varyingIndexes[j] = varyingPtr++; ! int[] vertexIndexes = new int[nVertices[i]]; ! for (int j = 0; j < vertexIndexes.length; j++) ! vertexIndexes[j] = vertexPtr++; ! addCubicCurve(periodic, ! parameters.selectValues(uniformIndex, ! varyingIndexes, ! vertexIndexes)); ! } } Index: Global.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Global.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Global.java 6 Dec 2006 17:17:10 -0000 1.12 --- Global.java 25 Dec 2006 07:50:37 -0000 1.13 *************** *** 1,5 **** /* Global.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or --- 1,5 ---- /* Global.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or *************** *** 36,43 **** declarations.put("origin", new Declaration("origin", "integer[2]")); declarations.put("gridsize", new Declaration("gridsize", "integer")); ! declarations.put("bucketsize", new Declaration("bucketsize", "integer[2]")); ! declarations.put("endofframe", new Declaration("endofframe", "integer")); declarations.put("file", new Declaration("file", "integer")); ! declarations.put("highlights", new Declaration("highlights", "integer")); declarations.put("intensity", new Declaration("intensity", "float")); declarations.put("lightcolor", new Declaration("lightcolor", "color")); --- 36,46 ---- declarations.put("origin", new Declaration("origin", "integer[2]")); declarations.put("gridsize", new Declaration("gridsize", "integer")); ! declarations.put("bucketsize", ! new Declaration("bucketsize", "integer[2]")); ! declarations.put("endofframe", ! new Declaration("endofframe", "integer")); declarations.put("file", new Declaration("file", "integer")); ! declarations.put("highlights", ! new Declaration("highlights", "integer")); declarations.put("intensity", new Declaration("intensity", "float")); declarations.put("lightcolor", new Declaration("lightcolor", "color")); *************** *** 45,50 **** declarations.put("to", new Declaration("to", "point")); declarations.put("coneangle", new Declaration("coneangle", "float")); ! declarations.put("conedeltaangle", new Declaration("conedeltaangle", "float")); ! declarations.put("beamdistribution", new Declaration("beamdistribution", "float")); declarations.put("Ka", new Declaration("Ka", "float")); declarations.put("Kd", new Declaration("Kd", "float")); --- 48,55 ---- declarations.put("to", new Declaration("to", "point")); declarations.put("coneangle", new Declaration("coneangle", "float")); ! declarations.put("conedeltaangle", ! new Declaration("conedeltaangle", "float")); ! declarations.put("beamdistribution", ! new Declaration("beamdistribution", "float")); declarations.put("Ka", new Declaration("Ka", "float")); declarations.put("Kd", new Declaration("Kd", "float")); *************** *** 53,65 **** declarations.put("Km", new Declaration("Km", "float")); declarations.put("roughness", new Declaration("roughness", "float")); ! declarations.put("specularcolor", new Declaration("specularcolor", "color")); ! declarations.put("texturename", new Declaration("texturename", "string")); declarations.put("amplitude", new Declaration("float", "float")); declarations.put("distance", new Declaration("distance", "float")); ! declarations.put("mindistance", new Declaration("mindistance", "float")); ! declarations.put("maxdistance", new Declaration("maxdistance", "float")); ! declarations.put("background", new Declaration("background", "color")); ! declarations.put("sphere", new Declaration("sphere", "float")); ! declarations.put("coordinatesystem", new Declaration("coordinatesystem", "string")); declarations.put("name", new Declaration("name", "string")); declarations.put("sense", new Declaration("name", "string")); --- 58,77 ---- declarations.put("Km", new Declaration("Km", "float")); declarations.put("roughness", new Declaration("roughness", "float")); ! declarations.put("specularcolor", ! new Declaration("specularcolor", "color")); ! declarations.put("texturename", ! new Declaration("texturename", "string")); declarations.put("amplitude", new Declaration("float", "float")); declarations.put("distance", new Declaration("distance", "float")); ! declarations.put("mindistance", ! new Declaration("mindistance", "float")); ! declarations.put("maxdistance", ! new Declaration("maxdistance", "float")); ! declarations.put("background", ! new Declaration("background", "color")); ! declarations.put("sphere", ! new Declaration("sphere", "float")); ! declarations.put("coordinatesystem", ! new Declaration("coordinatesystem", "string")); declarations.put("name", new Declaration("name", "string")); declarations.put("sense", new Declaration("name", "string")); *************** *** 73,82 **** declarations.put("t", new Declaration("t", "varying float")); declarations.put("st", new Declaration("st", "varying float[2]")); ! declarations.put("width", new Declaration("width", "vertex float")); ! declarations.put("constantwidth", new Declaration("constantwidth", "uniform float")); ! declarations.put("__category", new Declaration("__category", "uniform string")); ! declarations.put("__nondiffuse", new Declaration("__nondiffuse", "uniform float")); ! declarations.put("__nonspecular", new Declaration("__nonspecular", "uniform float")); ! declarations.put("truedisplacement", new Declaration("truedisplacement", "integer")); } --- 85,99 ---- declarations.put("t", new Declaration("t", "varying float")); declarations.put("st", new Declaration("st", "varying float[2]")); ! declarations.put("width", new Declaration("width", "varying float")); ! declarations.put("constantwidth", ! new Declaration("constantwidth", "uniform float")); ! declarations.put("__category", ! new Declaration("__category", "uniform string")); ! declarations.put("__nondiffuse", ! new Declaration("__nondiffuse", "uniform float")); ! declarations.put("__nonspecular", ! new Declaration("__nonspecular", "uniform float")); ! declarations.put("truedisplacement", ! new Declaration("truedisplacement", "integer")); } |
From: Gerardo H. <ma...@us...> - 2006-12-25 07:51:10
|
Update of /cvsroot/jrman/drafts/sampleData In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26654/sampleData Modified Files: curves.rib Log Message: First implementation of cubic curves. Index: curves.rib =================================================================== RCS file: /cvsroot/jrman/drafts/sampleData/curves.rib,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** curves.rib 24 Dec 2006 05:25:55 -0000 1.1 --- curves.rib 25 Dec 2006 07:50:36 -0000 1.2 *************** *** 1,5 **** Display "curves.png" "framebuffer" "rgb" PixelFilter "gaussian" 2 2 ! Format 512 384 1 PixelSamples 8 8 Exposure 1 1.8 --- 1,5 ---- Display "curves.png" "framebuffer" "rgb" PixelFilter "gaussian" 2 2 ! Format 800 600 1 PixelSamples 8 8 Exposure 1 1.8 *************** *** 15,18 **** --- 15,26 ---- Color 0 0 1 Sphere 1 -1 1 360 + TransformBegin + Translate 3 0 0 + Color 1 0 0 + Curves "cubic" [4] "nonperiodic" + "P" [0 0 0 -1 -.5 1 2 .5 1 1 0 -1] + "width" [.1 .04] + + TransformEnd Color 1 1 0 Curves "linear" [4 4] "periodic" |
From: Gerardo H. <ma...@us...> - 2006-12-24 05:26:16
|
Update of /cvsroot/jrman/drafts/src/org/jrman/attributes In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30032/src/org/jrman/attributes Modified Files: Attributes.java MutableAttributes.java Log Message: Started working on curves. Index: Attributes.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/Attributes.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Attributes.java 6 Dec 2006 17:17:10 -0000 1.7 --- Attributes.java 24 Dec 2006 05:25:56 -0000 1.8 *************** *** 1,5 **** /* Attributes.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or --- 1,5 ---- /* Attributes.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or Index: MutableAttributes.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/attributes/MutableAttributes.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MutableAttributes.java 6 Dec 2006 17:17:10 -0000 1.8 --- MutableAttributes.java 24 Dec 2006 05:25:56 -0000 1.9 *************** *** 1,5 **** /* MutableAttributes.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or --- 1,5 ---- /* MutableAttributes.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or |
Update of /cvsroot/jrman/drafts/src/org/jrman/primitive In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30032/src/org/jrman/primitive Modified Files: BicubicPatch.java BilinearPatch.java Cone.java Cylinder.java DelayedReadArchive.java Disk.java Hyperboloid.java NurbsRI.java ObjectInstance.java Paraboloid.java Point.java PointsPolygons.java Primitive.java Quadric.java Sphere.java Torus.java Added Files: LinearCurve.java Log Message: Started working on curves. Index: Torus.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Torus.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Torus.java 30 Nov 2003 03:23:16 -0000 1.8 --- Torus.java 24 Dec 2006 05:25:57 -0000 1.9 *************** *** 1,19 **** /* ! Torus.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Torus.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 139,143 **** thetaMin, (thetaMin + thetaMax) / 2f, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 139,143 ---- thetaMin, (thetaMin + thetaMax) / 2f, ! bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 149,153 **** (thetaMin + thetaMax) / 2f, thetaMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 149,153 ---- (thetaMin + thetaMax) / 2f, thetaMax, ! bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); *************** *** 162,166 **** thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 162,166 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 172,176 **** thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 172,176 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); Index: DelayedReadArchive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/DelayedReadArchive.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DelayedReadArchive.java 12 Sep 2004 00:10:49 -0000 1.1 --- DelayedReadArchive.java 24 Dec 2006 05:25:57 -0000 1.2 *************** *** 1,19 **** /* ! DelayedReadArchive.java ! Copyright (C) 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! DelayedReadArchive.java ! Copyright (C) 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- NEW FILE: LinearCurve.java --- /* LinearCurve.java Copyright (C) 2006 Gerardo Horvilleur Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.primitive; import javax.vecmath.Point3f; import javax.vecmath.Vector2f; import javax.vecmath.Vector3f; import org.jrman.attributes.Attributes; import org.jrman.attributes.MutableAttributes; import org.jrman.geom.BoundingVolume; import org.jrman.geom.ConvexHull3f; import org.jrman.grid.FloatGrid; import org.jrman.grid.Grid; import org.jrman.grid.Point3fGrid; import org.jrman.grid.Vector3fGrid; import org.jrman.parameters.ParameterList; import org.jrman.parameters.VaryingScalarFloat; import org.jrman.parameters.VaryingScalarTuple3f; import org.jrman.parameters.UniformScalarFloat; import org.jrman.render.ShaderVariables; import org.jrman.util.Calc; public class LinearCurve extends Primitive { static Point3f tmpPoint = new Point3f(); boolean periodic; public LinearCurve(boolean periodic, ParameterList parameters, Attributes attributes) { this.periodic = periodic; this.parameters = parameters; VaryingScalarFloat widthParam = (VaryingScalarFloat) parameters.getParameter("width"); UniformScalarFloat constantWidthParam = (UniformScalarFloat) parameters.getParameter("constantwidth"); float w; if (widthParam != null) { w = 0f; int n = widthParam.getCount(); for (int i = 0; i < n; i++) { float wi = widthParam.getValue(i); if (wi > w) w = wi; } } else if (constantWidthParam != null) w = constantWidthParam.getValue(); else w = 1f; MutableAttributes attr = new MutableAttributes(attributes); attr.setDisplacementBound(attributes.getDisplacementBound() + w / 2f); this.attributes = attr; } public BoundingVolume getBoundingVolume() { VaryingScalarTuple3f points = (VaryingScalarTuple3f) parameters.getParameter("P"); ConvexHull3f ch = new ConvexHull3f(); for (int i = 0, n = points.getCount(); i < n; i++) { points.getValue(i, tmpPoint); ch.addPoint(tmpPoint); } return ch; } public Primitive[] split() { VaryingScalarTuple3f points = (VaryingScalarTuple3f) parameters.getParameter("P"); int n = points.getCount(); Primitive[] result = new Primitive[n - (periodic ? 0 : 1)]; int[] uniformIndex = new int[1]; uniformIndex[0] = 0; int[] indexes = new int[2]; for (int i = 0; i < n - 1; i++) { indexes[0] = i; indexes[1] = i + 1; result[i] = new LinearSegment(parameters.selectValues(uniformIndex, indexes, indexes), attributes); } if (periodic) { indexes[0] = n - 1; indexes[1] = 0; result[n - 1] = new LinearSegment(parameters.selectValues(uniformIndex, indexes, indexes), attributes); } return result; } public boolean isReadyToBeDiced(int gridsize) { return false; } private static class LinearSegment extends Primitive { static Point3f pa = new Point3f(); static Point3f pb = new Point3f(); static Vector3f v3 = new Vector3f(); static Vector2f v2 = new Vector2f(); static float wa; static float wb; LinearSegment(ParameterList parameters, Attributes attributes) { this.parameters = parameters; this.attributes = attributes; } public BoundingVolume getBoundingVolume() { ConvexHull3f ch = new ConvexHull3f(); extractPoints(); ch.addPoint(pa); ch.addPoint(pb); return ch; } public Primitive[] split() { Primitive[] result = new Primitive[2]; result[0] = new LinearSegment(linearInterpolateParameters(0f, .5f), attributes); result[1] = new LinearSegment(linearInterpolateParameters(.5f, 1), attributes); return result; } private void extractPoints() { VaryingScalarTuple3f param = (VaryingScalarTuple3f) parameters.getParameter("P"); param.getValue(0, pa); param.getValue(1, pb); } private void extractWidths() { VaryingScalarFloat widthParam = (VaryingScalarFloat) parameters.getParameter("width"); if (widthParam != null) { wa = widthParam.getValue(0); wb = widthParam.getValue(1); } else { UniformScalarFloat constantWidthParam = (UniformScalarFloat) parameters.getParameter("constantwidth"); if (constantWidthParam != null) wa = wb = constantWidthParam.getValue(); else wa = wb = 1f; } } public boolean isReadyToBeDiced(int gridSize) { float sw = rasterBounds.getWidth(); float sh = rasterBounds.getHeight(); float length = (float) Math.sqrt(sw * sw + sh * sw); boolean ready = length <= (gridSize / 2) * attributes.getShadingRate(); if (!ready) return false; float idealSize = length / (2f * attributes.getShadingRate()); idealSize = Calc.clamp(idealSize, 40, gridSize / 2); int vSize = (int) Math.ceil(idealSize); Grid.setSize(2, vSize); return true; } public void dice(ShaderVariables shaderVariables) { shaderVariables.attributes = attributes; shaderVariables.parameters = parameters; dice_u(shaderVariables); dice_v(shaderVariables); // dice_s(shaderVariables); // dice_t(shaderVariables); dice_PandNg(shaderVariables); dice_du(shaderVariables); dice_dv(shaderVariables); dice_dPdu(shaderVariables); dice_dPdv(shaderVariables); dice_N(shaderVariables); dice_Cs(shaderVariables); dice_Os(shaderVariables); dice_others(shaderVariables); } protected void dice_PandNg(ShaderVariables shaderVariables) { v3.set(0f, 0f, -1f); shaderVariables.Ng.set(v3); extractPoints(); extractWidths(); objectToCamera.transformPoint(pa, pa); objectToCamera.transformPoint(pb, pb); v3.set(wa, 0f, 0f); objectToCamera.transformVector(v3, v3); wa = v3.length() / 2; v3.set(wb, 0f, 0f); objectToCamera.transformVector(v3, v3); wb = v3.length() /2; v2.set(pb.x - pa.x, pb.y - pa.y); Calc.perp(v2, v2); v2.normalize(); float aax = pa.x - v2.x * wa; float aay = pa.y - v2.y * wa; float aaz = pa.z; float abx = pa.x + v2.x * wa; float aby = pa.y + v2.y * wa; float abz = pa.z; float bax = pb.x - v2.x * wb; float bay = pb.y - v2.y * wb; float baz = pb.z; float bbx = pb.x + v2.x * wb; float bby = pb.y + v2.y * wb; float bbz = pb.z; Point3fGrid P = shaderVariables.P; int vSize = Grid.getVSize(); float vStep = 1f / (vSize - 1); float v = 0; for (int i = 0; i < vSize; i++) { pa.x = Calc.interpolate(aax, bax, v); pa.y = Calc.interpolate(aay, bay, v); pa.z = Calc.interpolate(aaz, baz, v); pb.x = Calc.interpolate(abx, bbx, v); pb.y = Calc.interpolate(aby, bby, v); pb.z = Calc.interpolate(abz, bbz, v); P.set(0, i, pa); P.set(1, i, pb); v += vStep; } } protected void dice_u(ShaderVariables shaderVariables) { FloatGrid g = shaderVariables.u; int vSize = Grid.getVSize(); for (int i = 0; i < vSize; i++) { g.set(0, i, 0f); g.set(1, i, 1f); } } protected void dice_v(ShaderVariables shaderVariables) { FloatGrid g = shaderVariables.v; int vSize = Grid.getVSize(); float vStep = 1f / (vSize - 1); float v = 0; for (int i = 0; i < vSize; i++) { g.set(0, i, v); g.set(1, i, v); v += vStep; } } } } Index: PointsPolygons.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/PointsPolygons.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PointsPolygons.java 3 Jul 2005 04:37:36 -0000 1.5 --- PointsPolygons.java 24 Dec 2006 05:25:57 -0000 1.6 *************** *** 1,19 **** /* ! PointsPolygon.java ! Copyright (C) 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! PointsPolygon.java ! Copyright (C) 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: Sphere.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Sphere.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Sphere.java 30 Nov 2003 03:23:16 -0000 1.21 --- Sphere.java 24 Dec 2006 05:25:57 -0000 1.22 *************** *** 1,19 **** /* ! Sphere.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Sphere.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 130,134 **** thetaMin, (thetaMin + thetaMax) / 2f, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 130,134 ---- thetaMin, (thetaMin + thetaMax) / 2f, ! bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 139,143 **** (thetaMin + thetaMax) / 2f, thetaMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 139,143 ---- (thetaMin + thetaMax) / 2f, thetaMax, ! bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); *************** *** 151,155 **** thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 151,155 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 160,164 **** thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 160,164 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); Index: Hyperboloid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Hyperboloid.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Hyperboloid.java 30 Nov 2003 03:23:16 -0000 1.8 --- Hyperboloid.java 24 Dec 2006 05:25:57 -0000 1.9 *************** *** 1,19 **** /* ! Hyperboloid.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Hyperboloid.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 200,204 **** thetaMin, (thetaMin + thetaMax) / 2f, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 200,204 ---- thetaMin, (thetaMin + thetaMax) / 2f, ! bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 212,216 **** (thetaMin + thetaMax) / 2f, thetaMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 212,216 ---- (thetaMin + thetaMax) / 2f, thetaMax, ! bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); *************** *** 227,231 **** thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 227,231 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 239,243 **** thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 239,243 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); Index: Disk.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Disk.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Disk.java 23 Mar 2004 06:29:12 -0000 1.9 --- Disk.java 24 Dec 2006 05:25:57 -0000 1.10 *************** *** 1,19 **** /* ! Disk.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Disk.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 115,119 **** rMin, rMax, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 115,119 ---- rMin, rMax, ! bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 124,128 **** rMin, rMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 124,128 ---- rMin, rMax, ! bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); *************** *** 137,141 **** rMin, (rMax + rMin)/2f, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[1] = --- 137,141 ---- rMin, (rMax + rMin)/2f, ! bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[1] = *************** *** 146,150 **** (rMax + rMin)/2f, rMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[0].setObjectToCamera(objectToCamera); --- 146,150 ---- (rMax + rMin)/2f, rMax, ! bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[0].setObjectToCamera(objectToCamera); Index: Primitive.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Primitive.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Primitive.java 19 Nov 2005 23:27:54 -0000 1.38 --- Primitive.java 24 Dec 2006 05:25:57 -0000 1.39 *************** *** 1,19 **** /* ! Primitive.java ! Copyright (C) 2003, 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Primitive.java ! Copyright (C) 2003, 2004, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 160,166 **** VaryingScalarTuple3f param = (VaryingScalarTuple3f) parameters.getParameter("N"); ! if (param != null) ! param.linearDice(shaderVariables.N); ! else shaderVariables.N.set(shaderVariables.Ng); } --- 160,169 ---- VaryingScalarTuple3f param = (VaryingScalarTuple3f) parameters.getParameter("N"); ! if (param != null) { ! if (param.getCount() == 4) ! param.bilinearDice(shaderVariables.N); ! else ! param.linearDice(shaderVariables.N); ! } else shaderVariables.N.set(shaderVariables.Ng); } *************** *** 171,174 **** --- 174,179 ---- if (param != null) { if (param.getCount() == 4) + param.bilinearDice(shaderVariables.Cs); + else if (param.getCount() == 2) param.linearDice(shaderVariables.Cs); else { *************** *** 185,188 **** --- 190,195 ---- if (param != null) { if (param.getCount() == 4) + param.bilinearDice(shaderVariables.Os); + else if (param.getCount() == 2) param.linearDice(shaderVariables.Os); else { *************** *** 197,201 **** VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("u"); ! param.linearDice(shaderVariables.u); } --- 204,208 ---- VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("u"); ! param.bilinearDice(shaderVariables.u); } *************** *** 203,207 **** VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("v"); ! param.linearDice(shaderVariables.v); } --- 210,214 ---- VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("v"); ! param.bilinearDice(shaderVariables.v); } *************** *** 209,213 **** VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("s"); ! param.linearDice(shaderVariables.s); } --- 216,220 ---- VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("s"); ! param.bilinearDice(shaderVariables.s); } *************** *** 215,219 **** VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("t"); ! param.linearDice(shaderVariables.t); } --- 222,229 ---- VaryingScalarFloat param = (VaryingScalarFloat) parameters.getParameter("t"); ! if (param.getCount() == 4) ! param.bilinearDice(shaderVariables.t); ! else ! param.linearDice(shaderVariables.t); } *************** *** 307,316 **** } ! protected ParameterList linearInterpolateParameters( float uMin, float uMax, float vMin, float vMax) { ! return parameters.linearInterpolate(uMin, uMax, vMin, vMax); } --- 317,330 ---- } ! protected ParameterList linearInterpolateParameters(float min, float max) { ! return parameters.linearInterpolate(min, max); ! } ! ! protected ParameterList bilinearInterpolateParameters( float uMin, float uMax, float vMin, float vMax) { ! return parameters.bilinearInterpolate(uMin, uMax, vMin, vMax); } Index: Point.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Point.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Point.java 3 Jul 2005 04:37:36 -0000 1.8 --- Point.java 24 Dec 2006 05:25:57 -0000 1.9 *************** *** 1,19 **** /* ! Points.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Points.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: Paraboloid.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Paraboloid.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Paraboloid.java 30 Nov 2003 03:23:16 -0000 1.8 --- Paraboloid.java 24 Dec 2006 05:25:57 -0000 1.9 *************** *** 1,19 **** /* ! Paraboloid.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Paraboloid.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 135,139 **** maxZ, maxTheta, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 135,139 ---- maxZ, maxTheta, ! bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 147,151 **** maxZ, maxTheta, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 147,151 ---- maxZ, maxTheta, ! bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); *************** *** 162,166 **** maxZ, maxTheta, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 162,166 ---- maxZ, maxTheta, ! bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 174,178 **** maxZ, maxTheta, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 174,178 ---- maxZ, maxTheta, ! bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); Index: Cone.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Cone.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Cone.java 30 Nov 2003 03:23:16 -0000 1.7 --- Cone.java 24 Dec 2006 05:25:57 -0000 1.8 *************** *** 1,19 **** /* ! Cone.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Cone.java ! Copyright (C) 2003, 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 122,126 **** (thetaMin + thetaMax) / 2f, height, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 122,126 ---- (thetaMin + thetaMax) / 2f, height, ! bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 132,136 **** thetaMax, height, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 132,136 ---- thetaMax, height, ! bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); *************** *** 145,149 **** thetaMax, height, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 145,149 ---- thetaMax, height, ! bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 155,159 **** thetaMax, height, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 155,159 ---- thetaMax, height, ! bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); Index: BilinearPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/BilinearPatch.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** BilinearPatch.java 3 Jul 2005 04:37:36 -0000 1.9 --- BilinearPatch.java 24 Dec 2006 05:25:57 -0000 1.10 *************** *** 1,19 **** /* ! BilinearPatch.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! BilinearPatch.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 80,91 **** if (ul > vl) { result[0] = ! new BilinearPatch(linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = ! new BilinearPatch(linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { result[0] = ! new BilinearPatch(linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = ! new BilinearPatch(linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); } return result; --- 80,91 ---- if (ul > vl) { result[0] = ! new BilinearPatch(bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = ! new BilinearPatch(bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); } else { result[0] = ! new BilinearPatch(bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = ! new BilinearPatch(bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); } return result; *************** *** 95,99 **** VaryingScalarTuple3f param = (VaryingScalarTuple3f) parameters.getParameter("P"); ! param.linearDice(sv.P); } --- 95,99 ---- VaryingScalarTuple3f param = (VaryingScalarTuple3f) parameters.getParameter("P"); ! param.bilinearDice(sv.P); } Index: ObjectInstance.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/ObjectInstance.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectInstance.java 17 May 2003 21:47:57 -0000 1.2 --- ObjectInstance.java 24 Dec 2006 05:25:57 -0000 1.3 *************** *** 1,19 **** /* ! ObjectInstance.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! ObjectInstance.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Index: NurbsRI.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/NurbsRI.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NurbsRI.java 30 Nov 2005 03:08:26 -0000 1.10 --- NurbsRI.java 24 Dec 2006 05:25:57 -0000 1.11 *************** *** 1,19 **** /* ! Nurbs.java ! Copyright (C) 2004-2005 Gerardo Horvilleur Martinez, Elmer Garduno Hernandez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.primitive; --- 1,19 ---- /* ! Nurbs.java ! Copyright (C) 2004-2006 Gerardo Horvilleur Martinez, Elmer Garduno Hernandez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jrman.primitive; *************** *** 290,294 **** Point4f[][] points) { ParameterList result = ! linearInterpolateParameters(umin, umax, vmin, vmax); int vpc = points.length; int upc = points[0].length; --- 290,294 ---- Point4f[][] points) { ParameterList result = ! bilinearInterpolateParameters(umin, umax, vmin, vmax); int vpc = points.length; int upc = points[0].length; Index: Cylinder.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Cylinder.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Cylinder.java 30 Nov 2003 03:23:16 -0000 1.7 --- Cylinder.java 24 Dec 2006 05:25:57 -0000 1.8 *************** *** 1,19 **** /* ! Cylinder.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! Cylinder.java ! Copyright (C) 2003, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 106,110 **** thetaMin, (thetaMin + thetaMax) / 2f, ! linearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = --- 106,110 ---- thetaMin, (thetaMin + thetaMax) / 2f, ! bilinearInterpolateParameters(0f, .5f, 0f, 1f), attributes); result[1] = *************** *** 115,119 **** (thetaMin + thetaMax) / 2f, thetaMax, ! linearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 115,119 ---- (thetaMin + thetaMax) / 2f, thetaMax, ! bilinearInterpolateParameters(.5f, 1f, 0f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); *************** *** 127,131 **** thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = --- 127,131 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, 0f, .5f), attributes); result[1] = *************** *** 136,140 **** thetaMin, thetaMax, ! linearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); --- 136,140 ---- thetaMin, thetaMax, ! bilinearInterpolateParameters(0f, 1f, .5f, 1f), attributes); result[0].setObjectToCamera(objectToCamera); Index: BicubicPatch.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/BicubicPatch.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** BicubicPatch.java 11 Jan 2006 06:23:23 -0000 1.19 --- BicubicPatch.java 24 Dec 2006 05:25:57 -0000 1.20 *************** *** 1,19 **** /* ! BicubicPatch.java ! Copyright (C) 2004 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,19 ---- /* ! BicubicPatch.java ! Copyright (C) 2004, 2006 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ *************** *** 286,290 **** float uv01, float uv11) { ! ParameterList result = linearInterpolateParameters(uv00, uv10, uv01, uv11); extractPoints(); VaryingScalarHPoint sparam = --- 286,291 ---- float uv01, float uv11) { ! ParameterList result = ! bilinearInterpolateParameters(uv00, uv10, uv01, uv11); extractPoints(); VaryingScalarHPoint sparam = Index: Quadric.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/primitive/Quadric.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Quadric.java 25 Nov 2003 16:34:08 -0000 1.14 --- Quadric.java 24 Dec 2006 05:25:57 -0000 1.15 *************** *** 1,19 **** /* ! Quadric.java ! Copyright (C) 2003 Gerardo Horvilleur Martinez ! ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ --- 1,1... [truncated message content] |
From: Gerardo H. <ma...@us...> - 2006-12-24 05:26:16
|
Update of /cvsroot/jrman/drafts/src/org/jrman/parser In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30032/src/org/jrman/parser Modified Files: Parser.java Log Message: Started working on curves. Index: Parser.java =================================================================== RCS file: /cvsroot/jrman/drafts/src/org/jrman/parser/Parser.java,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** Parser.java 6 Dec 2006 17:17:10 -0000 1.107 --- Parser.java 24 Dec 2006 05:25:57 -0000 1.108 *************** *** 1,4 **** /* ! * Parser.java Copyright (C) 2003, 2004 Gerardo Horvilleur Martinez * * This program is free software; you can redistribute it and/or modify it --- 1,5 ---- /* ! * Parser.java ! * Copyright (C) 2003, 2004, 2006 Gerardo Horvilleur Martinez * * This program is free software; you can redistribute it and/or modify it *************** *** 79,82 **** --- 80,84 ---- import org.jrman.primitive.Disk; import org.jrman.primitive.Hyperboloid; + import org.jrman.primitive.LinearCurve; import org.jrman.primitive.NurbsRI; import org.jrman.primitive.ObjectInstance; *************** *** 1255,1264 **** } } ! public void addLinearCurves(int[] nVertices, String wrap, ParameterList parameters) { ! } ! public void addCubicCurves(int[] nVertices, String wrap, ParameterList parameters) { } --- 1257,1301 ---- } } + + private void addLinearCurve(final boolean periodic, + final ParameterList parameters) { + if (inAreaLightSource) + return; + if (!inObject) { + LinearCurve curve = new LinearCurve(periodic, parameters, + getAttributes()); + renderer.addPrimitive(curve); + curveCount++; + } else { + final Transform transform = currentAttributes.getTransform(); + currentObjectInstanceList + .addPrimitiveCreator(new ObjectInstanceList.PrimitiveCreator() { + public Primitive create(Attributes attributes) { + curveCount++; + return new LinearCurve(periodic, parameters, + createAttributes(transform, + attributes)); + } + }); + } + } ! public void addLinearCurves(int[] nVertices, String wrap, ! ParameterList parameters) { ! boolean periodic = wrap.equals("periodic"); ! int[] uniformIndex = new int[1]; ! int ptr = 0; ! for (int i = 0; i < nVertices.length; i++) { ! uniformIndex[0] = i; ! int[] indexes = new int[nVertices[i]]; ! for (int j = 0; j < indexes.length; j++) ! indexes[j] = ptr++; ! addLinearCurve(periodic, parameters.selectValues(uniformIndex, ! indexes, indexes)); ! } } ! public void addCubicCurves(int[] nVertices, String wrap, ! ParameterList parameters) { } |