@@ -3198,13 +3198,40 @@ protected void textCharScreenImpl(PImage glyph,
31983198 }
31993199 }
32003200
3201+
3202+
3203+ //////////////////////////////////////////////////////////////
3204+
3205+ // MATRIX STACK
3206+
3207+
3208+ /**
3209+ * Push a copy of the current transformation matrix onto the stack.
3210+ */
3211+ public void pushMatrix () {
3212+ }
3213+
3214+
3215+ /**
3216+ * Replace the current transformation matrix with the top of the stack.
3217+ */
3218+ public void popMatrix () {
3219+ }
3220+
32013221
32023222
32033223 //////////////////////////////////////////////////////////////
32043224
32053225 // MATRIX TRANSFORMATIONS
32063226
32073227
3228+ /**
3229+ * Set the current transformation matrix to identity.
3230+ */
3231+ public void resetMatrix () {
3232+ }
3233+
3234+
32083235 /**
32093236 * Translate in X and Y.
32103237 */
@@ -3289,59 +3316,6 @@ public void scale(float x, float y, float z) {
32893316 }
32903317
32913318
3292-
3293- //////////////////////////////////////////////////////////////
3294-
3295- // TRANSFORMATION MATRIX
3296-
3297-
3298- /**
3299- * Push a copy of the current transformation matrix onto the stack.
3300- */
3301- public void pushMatrix () {
3302- }
3303-
3304-
3305- /**
3306- * Replace the current transformation matrix with the top of the stack.
3307- */
3308- public void popMatrix () {
3309- }
3310-
3311-
3312- /**
3313- * Set the current transformation matrix to identity.
3314- */
3315- public void resetMatrix () {
3316- }
3317-
3318-
3319- // public PMatrix getMatrix() {
3320- // return null;
3321- // }
3322-
3323-
3324- // public PMatrix2D getMatrix2D() {
3325- // return null;
3326- // }
3327-
3328-
3329- public void getMatrix (PMatrix2D target ) {
3330- }
3331-
3332-
3333- public void getMatrix (PMatrix3D target ) {
3334- }
3335-
3336-
3337- public void setMatrix (PMatrix2D source ) {
3338- }
3339-
3340-
3341- public void setMatrix (PMatrix3D source ) {
3342- }
3343-
3344-
33453319 public void applyMatrix (PMatrix2D source ) {
33463320 applyMatrix (source .m00 , source .m01 , source .m02 ,
33473321 source .m10 , source .m11 , source .m12 );
@@ -3373,26 +3347,49 @@ public void applyMatrix(float n00, float n01, float n02, float n03,
33733347 float n30 , float n31 , float n32 , float n33 ) {
33743348 }
33753349
3350+
3351+
3352+ //////////////////////////////////////////////////////////////
33763353
3377- /**
3378- * Loads the current matrix into the local 'matrix' object so that the values
3379- * can be used for other purposes.
3380- * <P/>
3381- * Note that there is no "updateMatrix" because that gets too
3382- * complicated (unnecessary) when considering the 3D matrices.
3383- */
3384- // public void loadMatrix() {
3385- // }
3386-
3354+ // MATRIX GET/SET/PRINT
33873355
3356+
33883357 /**
33893358 * Print the current model (or "transformation") matrix.
33903359 */
33913360 public void printMatrix () {
33923361 }
33933362
3363+
3364+ /**
3365+ * Copy the current transformation matrix into the specified target.
3366+ */
3367+ public void getMatrix (PMatrix2D target ) {
3368+ }
3369+
3370+
3371+ /**
3372+ * Copy the current transformation matrix into the specified target.
3373+ */
3374+ public void getMatrix (PMatrix3D target ) {
3375+ }
3376+
3377+
3378+ /**
3379+ * Set the current transformation to the contents of the specified source.
3380+ */
3381+ public void setMatrix (PMatrix2D source ) {
3382+ }
3383+
3384+
3385+ /**
3386+ * Set the current transformation to the contents of the specified source.
3387+ */
3388+ public void setMatrix (PMatrix3D source ) {
3389+ }
33943390
33953391
3392+
33963393 //////////////////////////////////////////////////////////////
33973394
33983395 // CAMERA (none are supported in 2D)
@@ -4150,10 +4147,124 @@ protected void fillFromCalc() {
41504147 fillAlpha = calcAlpha ;
41514148 }
41524149
4150+
41534151
41544152 //////////////////////////////////////////////////////////////
41554153
4154+ // MATERIAL PROPERTIES
41564155
4156+
4157+ public void ambient (int rgb ) {
4158+ if (((rgb & 0xff000000 ) == 0 ) && (rgb <= colorModeX )) { // see above
4159+ ambient ((float ) rgb );
4160+
4161+ } else {
4162+ colorCalcARGB (rgb , colorModeA );
4163+ ambientFromCalc ();
4164+ }
4165+ }
4166+
4167+
4168+ public void ambient (float gray ) {
4169+ colorCalc (gray );
4170+ ambientFromCalc ();
4171+ }
4172+
4173+
4174+ public void ambient (float x , float y , float z ) {
4175+ colorCalc (x , y , z );
4176+ ambientFromCalc ();
4177+ }
4178+
4179+
4180+ protected void ambientFromCalc () {
4181+ ambientR = calcR ;
4182+ ambientG = calcG ;
4183+ ambientB = calcB ;
4184+ // material.ambient(calcR, calcG, calcB);
4185+ }
4186+
4187+
4188+ //////////////////////////////////////////////////////////////
4189+
4190+
4191+ public void specular (int rgb ) {
4192+ if (((rgb & 0xff000000 ) == 0 ) && (rgb <= colorModeX )) { // see above
4193+ specular ((float ) rgb );
4194+
4195+ } else {
4196+ colorCalcARGB (rgb , colorModeA );
4197+ specularFromCalc ();
4198+ }
4199+ }
4200+
4201+
4202+ public void specular (float gray ) {
4203+ colorCalc (gray );
4204+ specularFromCalc ();
4205+ }
4206+
4207+
4208+ public void specular (float x , float y , float z ) {
4209+ colorCalc (x , y , z );
4210+ specularFromCalc ();
4211+ }
4212+
4213+
4214+ protected void specularFromCalc () {
4215+ specularR = calcR ;
4216+ specularG = calcG ;
4217+ specularB = calcB ;
4218+ //specularA = calcA;
4219+ //specularRi = calcRi;
4220+ //specularGi = calcGi;
4221+ //specularBi = calcBi;
4222+ //specularAi = calcAi;
4223+ }
4224+
4225+
4226+ public void shininess (float shine ) {
4227+ shininess = shine ;
4228+ }
4229+
4230+
4231+ //////////////////////////////////////////////////////////////
4232+
4233+
4234+ public void emissive (int rgb ) {
4235+ if (((rgb & 0xff000000 ) == 0 ) && (rgb <= colorModeX )) { // see above
4236+ emissive ((float ) rgb );
4237+
4238+ } else {
4239+ colorCalcARGB (rgb , colorModeA );
4240+ emissiveFromCalc ();
4241+ }
4242+ }
4243+
4244+
4245+ public void emissive (float gray ) {
4246+ colorCalc (gray );
4247+ emissiveFromCalc ();
4248+ }
4249+
4250+
4251+ public void emissive (float x , float y , float z ) {
4252+ colorCalc (x , y , z );
4253+ emissiveFromCalc ();
4254+ }
4255+
4256+
4257+ protected void emissiveFromCalc () {
4258+ emissiveR = calcR ;
4259+ emissiveG = calcG ;
4260+ emissiveB = calcB ;
4261+ //emissiveRi = calcRi;
4262+ //emissiveGi = calcGi;
4263+ //emissiveBi = calcBi;
4264+ }
4265+
4266+
4267+ /*
41574268 public void ambient(int rgb) {
41584269 showDepthError("ambient");
41594270 }
@@ -4199,8 +4310,10 @@ public void emissive(float gray) {
41994310 public void emissive(float x, float y, float z ) {
42004311 showDepthError("emissive");
42014312 }
4313+ */
42024314
42034315
4316+
42044317 //////////////////////////////////////////////////////////////
42054318
42064319 // LIGHTS
@@ -4468,7 +4581,6 @@ static protected void throwTextFontError(String method) {
44684581
44694582
44704583
4471-
44724584 //////////////////////////////////////////////////////////////
44734585
44744586 // COLOR MANIPULATION
@@ -4704,17 +4816,6 @@ static public int lerpColor(int c1, int c2, float amt, int mode) {
47044816 }
47054817
47064818
4707- //////////////////////////////////////////////////////////////
4708-
4709- // MATH
4710-
4711-
4712- static final float sqrt (float a ) {
4713- return (float )Math .sqrt (a );
4714- }
4715-
4716-
4717-
47184819 //////////////////////////////////////////////////////////////
47194820
47204821
0 commit comments