.. | .. |
---|
21 | 21 | |
---|
22 | 22 | ScriptNode scriptnode; |
---|
23 | 23 | |
---|
| 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 | + |
---|
24 | 37 | void MinMax(cVector minima, cVector maxima) |
---|
25 | 38 | { |
---|
26 | 39 | for (int xyz = 0; xyz < 3; xyz++) |
---|
.. | .. |
---|
285 | 298 | return parent.GetName() + "#"; |
---|
286 | 299 | } |
---|
287 | 300 | |
---|
288 | | - boolean timeline = false; |
---|
289 | 301 | boolean live = false; |
---|
290 | 302 | boolean hide = false; |
---|
291 | 303 | boolean link2master = false; // performs reset support/master at each frame |
---|
.. | .. |
---|
296 | 308 | boolean random = false; |
---|
297 | 309 | boolean speedup = false; |
---|
298 | 310 | boolean rewind = false; |
---|
| 311 | + |
---|
| 312 | + float NORMALPUSH = 0; |
---|
299 | 313 | |
---|
300 | 314 | Object3D support; |
---|
301 | 315 | |
---|
.. | .. |
---|
780 | 794 | // factor = CameraPane.STEP; |
---|
781 | 795 | // } |
---|
782 | 796 | |
---|
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) |
---|
784 | 801 | { |
---|
785 | 802 | currentframe = CameraPane.framecount; |
---|
786 | 803 | |
---|
.. | .. |
---|
2131 | 2148 | if (/*parent != null &&*/ material == null) |
---|
2132 | 2149 | { |
---|
2133 | 2150 | 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(); |
---|
2143 | 2153 | |
---|
2144 | 2154 | if (this instanceof Camera) |
---|
2145 | 2155 | { |
---|
.. | .. |
---|
4162 | 4172 | } |
---|
4163 | 4173 | } |
---|
4164 | 4174 | |
---|
| 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 | + |
---|
4165 | 4191 | void RepairTexture() |
---|
4166 | 4192 | { |
---|
4167 | 4193 | if (this instanceof FileObject || blockloop) |
---|
.. | .. |
---|
5959 | 5985 | |
---|
5960 | 5986 | javax.media.opengl.GL gl = display.GetGL(); |
---|
5961 | 5987 | |
---|
5962 | | - if (CameraPane.BOXMODE) // || CameraPane.movingcamera) |
---|
| 5988 | + if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera) |
---|
5963 | 5989 | { |
---|
5964 | 5990 | int fc = bRep.FaceCount(); |
---|
5965 | 5991 | int vc = bRep.VertexCount(); |
---|
.. | .. |
---|
6700 | 6726 | gl.glNormal3f((float) v2.x, (float) v2.y, (float) v2.z); |
---|
6701 | 6727 | } |
---|
6702 | 6728 | |
---|
| 6729 | + // P |
---|
| 6730 | + float x = (float)pv.x; |
---|
| 6731 | + float y = (float)pv.y; |
---|
| 6732 | + float z = (float)pv.z; |
---|
| 6733 | + |
---|
6703 | 6734 | if (hasnorm) |
---|
6704 | 6735 | { |
---|
6705 | 6736 | // if (!pv.norm.normalized()) |
---|
6706 | 6737 | // assert(pv.norm.normalized()); |
---|
6707 | 6738 | |
---|
6708 | 6739 | //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); |
---|
6710 | 6749 | } |
---|
6711 | 6750 | gl.glColor4f(pv.AO, pv.AO, pv.AO, 1); |
---|
6712 | 6751 | SetColor(display, pv); |
---|
.. | .. |
---|
6717 | 6756 | else |
---|
6718 | 6757 | gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6719 | 6758 | //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 | + |
---|
6721 | 6767 | // Print(pv); |
---|
6722 | 6768 | if (hasnorm) |
---|
6723 | 6769 | { |
---|
6724 | 6770 | // assert(qv.norm.normalized()); |
---|
6725 | 6771 | //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); |
---|
6727 | 6781 | } |
---|
6728 | 6782 | //System.out.println("vertexq = " + qv.s + ", " + qv.t); |
---|
6729 | 6783 | // boolean locked = false; |
---|
.. | .. |
---|
6747 | 6801 | // } |
---|
6748 | 6802 | gl.glColor4f(qv.AO, qv.AO, qv.AO, 1); |
---|
6749 | 6803 | SetColor(display, qv); |
---|
| 6804 | + |
---|
| 6805 | + gl.glVertex3f(x, y, z); |
---|
6750 | 6806 | //gl.glColor4f(r, g, b, 1); |
---|
6751 | 6807 | //gl.glColor4f(qv.boundary, qv.boundary, qv.boundary, 1); |
---|
6752 | 6808 | //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); |
---|
6754 | 6809 | // Print(qv); |
---|
| 6810 | + |
---|
| 6811 | + // R |
---|
| 6812 | + x = (float)rv.x; |
---|
| 6813 | + y = (float)rv.y; |
---|
| 6814 | + z = (float)rv.z; |
---|
| 6815 | + |
---|
6755 | 6816 | if (hasnorm) |
---|
6756 | 6817 | { |
---|
6757 | 6818 | // assert(rv.norm.normalized()); |
---|
6758 | 6819 | //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); |
---|
6760 | 6829 | } |
---|
6761 | 6830 | |
---|
6762 | 6831 | // if ((dot&4) == 0) |
---|
.. | .. |
---|
6777 | 6846 | //gl.glColor4f(r, g, b, 1); |
---|
6778 | 6847 | //gl.glColor4f(rv.boundary, rv.boundary, rv.boundary, 1); |
---|
6779 | 6848 | //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); |
---|
6781 | 6850 | // Print(rv); |
---|
6782 | 6851 | //gl.glEnd(); |
---|
6783 | 6852 | } |
---|
.. | .. |
---|
8164 | 8233 | { |
---|
8165 | 8234 | Object3D targ = this; |
---|
8166 | 8235 | |
---|
| 8236 | + targ.NORMALPUSH = obj.NORMALPUSH; |
---|
| 8237 | + |
---|
8167 | 8238 | if (obj.material != null) |
---|
8168 | 8239 | { |
---|
8169 | 8240 | if ((mask&MATERIAL)!=0) // ==(COLOR|MATERIAL)) |
---|