Normand Briere
2019-04-22 a9e12f6c508810604c8c91ee15451776b08ce1a1
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++)
....@@ -285,7 +298,6 @@
285298 return parent.GetName() + "#";
286299 }
287300
288
- boolean timeline = false;
289301 boolean live = false;
290302 boolean hide = false;
291303 boolean link2master = false; // performs reset support/master at each frame
....@@ -296,6 +308,8 @@
296308 boolean random = false;
297309 boolean speedup = false;
298310 boolean rewind = false;
311
+
312
+ float NORMALPUSH = 0;
299313
300314 Object3D support;
301315
....@@ -780,7 +794,10 @@
780794 // factor = CameraPane.STEP;
781795 // }
782796
783
- 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)
784801 {
785802 currentframe = CameraPane.framecount;
786803
....@@ -2131,15 +2148,8 @@
21312148 if (/*parent != null &&*/ material == null)
21322149 {
21332150 material = new cMaterial(GetMaterial());
2134
- if (projectedVertices == null || projectedVertices.length <= 2)
2135
- {
2136
- projectedVertices = new Object3D.cVector2[3];
2137
- }
2138
- for (int i = 0; i < 3; i++)
2139
- {
2140
- projectedVertices[i] = new cVector2(); // Others
2141
- }
2142
- projectedVertices[0].x = 100; // bump
2151
+
2152
+ InitOthers();
21432153
21442154 if (this instanceof Camera)
21452155 {
....@@ -4162,6 +4172,22 @@
41624172 }
41634173 }
41644174
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
+
41654191 void RepairTexture()
41664192 {
41674193 if (this instanceof FileObject || blockloop)
....@@ -5959,7 +5985,7 @@
59595985
59605986 javax.media.opengl.GL gl = display.GetGL();
59615987
5962
- if (CameraPane.BOXMODE) // || CameraPane.movingcamera)
5988
+ if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59635989 {
59645990 int fc = bRep.FaceCount();
59655991 int vc = bRep.VertexCount();
....@@ -6700,13 +6726,26 @@
67006726 gl.glNormal3f((float) v2.x, (float) v2.y, (float) v2.z);
67016727 }
67026728
6729
+ // P
6730
+ float x = (float)pv.x;
6731
+ float y = (float)pv.y;
6732
+ float z = (float)pv.z;
6733
+
67036734 if (hasnorm)
67046735 {
67056736 // if (!pv.norm.normalized())
67066737 // assert(pv.norm.normalized());
67076738
67086739 //System.out.println("normalp = " + pv.norm.x + ", " + pv.norm.y + ", " + pv.norm.z);
6709
- 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);
67106749 }
67116750 gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
67126751 SetColor(display, pv);
....@@ -6717,13 +6756,28 @@
67176756 else
67186757 gl.glTexCoord2f((float) pv.s, (float) pv.t);
67196758 //System.out.println("vertexp = " + pv.x + ", " + pv.y + ", " + pv.z);
6720
- 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
+
67216767 // Print(pv);
67226768 if (hasnorm)
67236769 {
67246770 // assert(qv.norm.normalized());
67256771 //System.out.println("normalq = " + qv.norm.x + ", " + qv.norm.y + ", " + qv.norm.z);
6726
- 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);
67276781 }
67286782 //System.out.println("vertexq = " + qv.s + ", " + qv.t);
67296783 // boolean locked = false;
....@@ -6747,16 +6801,31 @@
67476801 // }
67486802 gl.glColor4f(qv.AO, qv.AO, qv.AO, 1);
67496803 SetColor(display, qv);
6804
+
6805
+ gl.glVertex3f(x, y, z);
67506806 //gl.glColor4f(r, g, b, 1);
67516807 //gl.glColor4f(qv.boundary, qv.boundary, qv.boundary, 1);
67526808 //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
6753
- gl.glVertex3f((float) qv./*pos.*/x, (float) qv./*pos.*/y, (float) qv./*pos.*/z);
67546809 // Print(qv);
6810
+
6811
+ // R
6812
+ x = (float)rv.x;
6813
+ y = (float)rv.y;
6814
+ z = (float)rv.z;
6815
+
67556816 if (hasnorm)
67566817 {
67576818 // assert(rv.norm.normalized());
67586819 //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
6759
- 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);
67606829 }
67616830
67626831 // if ((dot&4) == 0)
....@@ -6777,7 +6846,7 @@
67776846 //gl.glColor4f(r, g, b, 1);
67786847 //gl.glColor4f(rv.boundary, rv.boundary, rv.boundary, 1);
67796848 //System.out.println("vertexr = " + rv.x + ", " + rv.y + ", " + rv.z);
6780
- gl.glVertex3f((float) rv./*pos.*/x, (float) rv./*pos.*/y, (float) rv./*pos.*/z);
6849
+ gl.glVertex3f(x, y, z);
67816850 // Print(rv);
67826851 //gl.glEnd();
67836852 }
....@@ -8164,6 +8233,8 @@
81648233 {
81658234 Object3D targ = this;
81668235
8236
+ targ.NORMALPUSH = obj.NORMALPUSH;
8237
+
81678238 if (obj.material != null)
81688239 {
81698240 if ((mask&MATERIAL)!=0) // ==(COLOR|MATERIAL))