Normand Briere
2018-12-15 6ed65dcb597fb2153cef75bf1845978f1115658c
Object3D.java
....@@ -21,6 +21,19 @@
2121
2222 ScriptNode scriptnode;
2323
24
+ void InitOthers()
25
+ {
26
+ if (projectedVertices == null || projectedVertices.length <= 2)
27
+ {
28
+ projectedVertices = new Object3D.cVector2[3];
29
+ }
30
+ for (int i = 0; i < 3; i++)
31
+ {
32
+ projectedVertices[i] = new cVector2(); // Others
33
+ }
34
+ projectedVertices[0].x = 100; // bump
35
+ }
36
+
2437 void MinMax(cVector minima, cVector maxima)
2538 {
2639 for (int xyz = 0; xyz < 3; xyz++)
....@@ -295,6 +308,8 @@
295308 boolean random = false;
296309 boolean speedup = false;
297310 boolean rewind = false;
311
+
312
+ float NORMALPUSH = 0;
298313
299314 Object3D support;
300315
....@@ -779,7 +794,10 @@
779794 // factor = CameraPane.STEP;
780795 // }
781796
782
- if (marked && CameraPane.isLIVE() && live && CameraPane.drawMode == CameraPane.SHADOW && currentframe != CameraPane.framecount)
797
+ if (marked && CameraPane.isLIVE() && live &&
798
+ //TEMP21aug2018
799
+ CameraPane.drawMode == CameraPane.SHADOW &&
800
+ currentframe != CameraPane.framecount)
783801 {
784802 currentframe = CameraPane.framecount;
785803
....@@ -2130,15 +2148,8 @@
21302148 if (/*parent != null &&*/ material == null)
21312149 {
21322150 material = new cMaterial(GetMaterial());
2133
- if (projectedVertices == null || projectedVertices.length <= 2)
2134
- {
2135
- projectedVertices = new Object3D.cVector2[3];
2136
- }
2137
- for (int i = 0; i < 3; i++)
2138
- {
2139
- projectedVertices[i] = new cVector2(); // Others
2140
- }
2141
- projectedVertices[0].x = 100; // bump
2151
+
2152
+ InitOthers();
21422153
21432154 if (this instanceof Camera)
21442155 {
....@@ -4161,6 +4172,22 @@
41614172 }
41624173 }
41634174
4175
+ void RepairShadow()
4176
+ {
4177
+ if (blockloop)
4178
+ return;
4179
+
4180
+ if (this.material != null)
4181
+ this.InitOthers();
4182
+
4183
+ for (int i=0; i<Size(); i++)
4184
+ {
4185
+ blockloop = true;
4186
+ get(i).RepairShadow();
4187
+ blockloop = false;
4188
+ }
4189
+ }
4190
+
41644191 void RepairTexture()
41654192 {
41664193 if (this instanceof FileObject || blockloop)
....@@ -5958,7 +5985,7 @@
59585985
59595986 javax.media.opengl.GL gl = display.GetGL();
59605987
5961
- if (CameraPane.BOXMODE) // || CameraPane.movingcamera)
5988
+ if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59625989 {
59635990 int fc = bRep.FaceCount();
59645991 int vc = bRep.VertexCount();
....@@ -6699,13 +6726,26 @@
66996726 gl.glNormal3f((float) v2.x, (float) v2.y, (float) v2.z);
67006727 }
67016728
6729
+ // P
6730
+ float x = (float)pv.x;
6731
+ float y = (float)pv.y;
6732
+ float z = (float)pv.z;
6733
+
67026734 if (hasnorm)
67036735 {
67046736 // if (!pv.norm.normalized())
67056737 // assert(pv.norm.normalized());
67066738
67076739 //System.out.println("normalp = " + pv.norm.x + ", " + pv.norm.y + ", " + pv.norm.z);
6708
- gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
6740
+ float nx = (float)pv.norm.x;
6741
+ float ny = (float)pv.norm.y;
6742
+ float nz = (float)pv.norm.z;
6743
+
6744
+ x += nx * NORMALPUSH;
6745
+ y += ny * NORMALPUSH;
6746
+ z += nz * NORMALPUSH;
6747
+
6748
+ gl.glNormal3f(nx, ny, nz);
67096749 }
67106750 gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
67116751 SetColor(display, pv);
....@@ -6716,13 +6756,28 @@
67166756 else
67176757 gl.glTexCoord2f((float) pv.s, (float) pv.t);
67186758 //System.out.println("vertexp = " + pv.x + ", " + pv.y + ", " + pv.z);
6719
- gl.glVertex3f((float) pv./*pos.*/x, (float) pv./*pos.*/y, (float) pv./*pos.*/z);
6759
+
6760
+ gl.glVertex3f(x, y, z);
6761
+
6762
+ // Q
6763
+ x = (float)qv.x;
6764
+ y = (float)qv.y;
6765
+ z = (float)qv.z;
6766
+
67206767 // Print(pv);
67216768 if (hasnorm)
67226769 {
67236770 // assert(qv.norm.normalized());
67246771 //System.out.println("normalq = " + qv.norm.x + ", " + qv.norm.y + ", " + qv.norm.z);
6725
- gl.glNormal3f((float) qv.norm.x, (float) qv.norm.y, (float) qv.norm.z);
6772
+ float nx = (float)qv.norm.x;
6773
+ float ny = (float)qv.norm.y;
6774
+ float nz = (float)qv.norm.z;
6775
+
6776
+ x += nx * NORMALPUSH;
6777
+ y += ny * NORMALPUSH;
6778
+ z += nz * NORMALPUSH;
6779
+
6780
+ gl.glNormal3f(nx, ny, nz);
67266781 }
67276782 //System.out.println("vertexq = " + qv.s + ", " + qv.t);
67286783 // boolean locked = false;
....@@ -6746,16 +6801,31 @@
67466801 // }
67476802 gl.glColor4f(qv.AO, qv.AO, qv.AO, 1);
67486803 SetColor(display, qv);
6804
+
6805
+ gl.glVertex3f(x, y, z);
67496806 //gl.glColor4f(r, g, b, 1);
67506807 //gl.glColor4f(qv.boundary, qv.boundary, qv.boundary, 1);
67516808 //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
6752
- gl.glVertex3f((float) qv./*pos.*/x, (float) qv./*pos.*/y, (float) qv./*pos.*/z);
67536809 // Print(qv);
6810
+
6811
+ // R
6812
+ x = (float)rv.x;
6813
+ y = (float)rv.y;
6814
+ z = (float)rv.z;
6815
+
67546816 if (hasnorm)
67556817 {
67566818 // assert(rv.norm.normalized());
67576819 //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
6758
- gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
6820
+ float nx = (float)rv.norm.x;
6821
+ float ny = (float)rv.norm.y;
6822
+ float nz = (float)rv.norm.z;
6823
+
6824
+ x += nx * NORMALPUSH;
6825
+ y += ny * NORMALPUSH;
6826
+ z += nz * NORMALPUSH;
6827
+
6828
+ gl.glNormal3f(nx, ny, nz);
67596829 }
67606830
67616831 // if ((dot&4) == 0)
....@@ -6776,7 +6846,7 @@
67766846 //gl.glColor4f(r, g, b, 1);
67776847 //gl.glColor4f(rv.boundary, rv.boundary, rv.boundary, 1);
67786848 //System.out.println("vertexr = " + rv.x + ", " + rv.y + ", " + rv.z);
6779
- gl.glVertex3f((float) rv./*pos.*/x, (float) rv./*pos.*/y, (float) rv./*pos.*/z);
6849
+ gl.glVertex3f(x, y, z);
67806850 // Print(rv);
67816851 //gl.glEnd();
67826852 }
....@@ -8163,6 +8233,8 @@
81638233 {
81648234 Object3D targ = this;
81658235
8236
+ targ.NORMALPUSH = obj.NORMALPUSH;
8237
+
81668238 if (obj.material != null)
81678239 {
81688240 if ((mask&MATERIAL)!=0) // ==(COLOR|MATERIAL))