Normand Briere
2019-09-13 ab9e1281ca1ccb3e5d01eb24934f81c1072114f2
Four new presets + sort option.
5 files modified
4 files added
175 ■■■■ changed files
BoundaryRep.java 3 ●●●● patch | view | raw | blame | history
CameraPane.java 18 ●●●●● patch | view | raw | blame | history
ObjEditor.java 118 ●●●●● patch | view | raw | blame | history
Object3D.java 34 ●●●●● patch | view | raw | blame | history
cMaterial.java 2 ●●● patch | view | raw | blame | history
fullscenes/alsace.png patch | view | raw | blame | history
fullscenes/skullcove.png patch | view | raw | blame | history
fullscenes/viking.png patch | view | raw | blame | history
fullscenes/yvoire.png patch | view | raw | blame | history
BoundaryRep.java
....@@ -7,7 +7,8 @@
77
88 class BoundaryRep implements java.io.Serializable
99 {
10
- static final long serialVersionUID = -4852664309425035321L;
10
+ static final long serialVersionUID = // VERY old 2008 -5762968998168738314L;
11
+ -4852664309425035321L;
1112
1213 transient int displaylist = 0;
1314
CameraPane.java
....@@ -3601,6 +3601,8 @@
36013601 };
36023602 /**/
36033603
3604
+ static Object3D lastObject;
3605
+
36043606 //com.sun.opengl.util.texture.Texture
36053607 TextureData
36063608 GetFileTexture(String name, boolean bump, int resolution)
....@@ -3637,6 +3639,8 @@
36373639 // return null;
36383640 //if (i == 2)
36393641 // return null;
3642
+ // TIFF issue sept 2019
3643
+ System.err.println("lastObject = " + lastObject);
36403644 e.printStackTrace();
36413645 name = name.split("\\.tif")[0] + ".jpg";
36423646 }
....@@ -15753,6 +15757,16 @@
1575315757 break;
1575415758 case 'l':
1575515759 lightMode ^= true;
15760
+ if (lightMode)
15761
+ {
15762
+ keepshadow = Globals.RENDERSHADOW;
15763
+ Globals.RENDERSHADOW = false;
15764
+ }
15765
+ else
15766
+ {
15767
+ Globals.RENDERSHADOW = keepshadow;
15768
+ }
15769
+
1575615770 Globals.lighttouched = true;
1575715771 manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
1575815772 targetLookAt.set(manipCamera.lookAt);
....@@ -17410,7 +17424,7 @@
1741017424
1741117425 float depth = depths[y * TEX_SIZE + x];
1741217426
17413
- if (pointselection && mouseMode == SELECT && depth != 0 && depth != 1)
17427
+ if (pointselection && (mouseMode & SELECT) == SELECT && depth != 0 && depth != 1)
1741417428 {
1741517429 pointselection = false;
1741617430
....@@ -18075,6 +18089,8 @@
1807518089 boolean OCCLUSION_CULLING = false; //true;
1807618090 public boolean lightMode = false;
1807718091
18092
+ private boolean keepshadow;
18093
+
1807818094 public boolean capsLocked = false; // VR
1807918095
1808018096 static public int indexcount = 0;
ObjEditor.java
....@@ -799,6 +799,8 @@
799799 // SendInfo(" delay: " + sel.delay + newline, "regular");
800800 // live, hide, ...
801801 //?? SendInfo(" Orig: " + maxima + newline, "regular");
802
+ if (sel.GetTextures().pigmentdata != null)
803
+ si.SendInfo(" EMBEDDED ", "regular");
802804 si.SendInfo((debug ? " Texture: " : " ") + sel.GetTextures(), "bold");
803805 // SendInfo((debug ? " Material: " : " ") + sel.material + newline, "regular");
804806 if (sel instanceof cMesh)
....@@ -1169,6 +1171,7 @@
11691171 JCheckBox selectableCB;
11701172 JCheckBox hideCB;
11711173 JCheckBox link2masterCB;
1174
+ JCheckBox sortCB;
11721175 JCheckBox markCB;
11731176 JCheckBox randomCB;
11741177 JCheckBox speedupCB;
....@@ -1412,11 +1415,14 @@
14121415 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
14131416 rewindCB.setToolTipText("Rewind animation");
14141417
1418
+ sortCB = AddCheckBox(setupPanel2, "Sort", copy.sort);
1419
+ sortCB.setToolTipText("Display from back to front");
1420
+
14151421 randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
14161422 randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
14171423
14181424 link2masterCB = AddCheckBox(setupPanel2, GetSupportText(), copy.link2master);
1419
- link2masterCB.setToolTipText("Attach to support");
1425
+ link2masterCB.setToolTipText("Link to support");
14201426
14211427 if (Globals.ADVANCED)
14221428 {
....@@ -1847,6 +1853,28 @@
18471853
18481854 cButton fullsceneButton;
18491855
1856
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/alsace.png", !Globals.NIMBUSLAF));
1857
+ fullsceneButton.setToolTipText("Alsace!");
1858
+ fullsceneButton.addActionListener(new ActionListener()
1859
+ {
1860
+ @Override
1861
+ public void actionPerformed(ActionEvent e)
1862
+ {
1863
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/Alsace.gfd", new iCallBack()
1864
+ {
1865
+
1866
+ public void Callback(Object obj)
1867
+ {
1868
+ LoadIt(obj);
1869
+ }
1870
+
1871
+ public void DragGesture()
1872
+ {
1873
+ }
1874
+ });
1875
+ }
1876
+ });
1877
+
18501878 fullscenePanel.add(fullsceneButton = GetButton("fullscenes/london.png", !Globals.NIMBUSLAF));
18511879 fullsceneButton.setToolTipText("Old London!");
18521880 fullsceneButton.addActionListener(new ActionListener()
....@@ -1854,7 +1882,7 @@
18541882 @Override
18551883 public void actionPerformed(ActionEvent e)
18561884 {
1857
- /*Object3D readobj =*/ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/oldlondon.gfd", new iCallBack()
1885
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/oldlondon.gfd", new iCallBack()
18581886 {
18591887
18601888 public void Callback(Object obj)
....@@ -1869,6 +1897,8 @@
18691897 }
18701898 });
18711899
1900
+ fullscenePanel.Return();
1901
+
18721902 fullscenePanel.add(fullsceneButton = GetButton("fullscenes/venice.png", !Globals.NIMBUSLAF));
18731903 fullsceneButton.setToolTipText("Venice!");
18741904 fullsceneButton.addActionListener(new ActionListener()
....@@ -1876,7 +1906,29 @@
18761906 @Override
18771907 public void actionPerformed(ActionEvent e)
18781908 {
1879
- /*Object3D readobj =*/ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/Venice.gfd", new iCallBack()
1909
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/Venice.gfd", new iCallBack()
1910
+ {
1911
+
1912
+ public void Callback(Object obj)
1913
+ {
1914
+ LoadIt(obj);
1915
+ }
1916
+
1917
+ public void DragGesture()
1918
+ {
1919
+ }
1920
+ });
1921
+ }
1922
+ });
1923
+
1924
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/viking.png", !Globals.NIMBUSLAF));
1925
+ fullsceneButton.setToolTipText("Viking Village!");
1926
+ fullsceneButton.addActionListener(new ActionListener()
1927
+ {
1928
+ @Override
1929
+ public void actionPerformed(ActionEvent e)
1930
+ {
1931
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/VikingVillage.gfd", new iCallBack()
18801932 {
18811933
18821934 public void Callback(Object obj)
....@@ -1892,12 +1944,53 @@
18921944 });
18931945
18941946 fullscenePanel.Return();
1895
- fullscenePanel.add(new cGridBag());
1896
- fullscenePanel.add(new cGridBag());
1947
+
1948
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/yvoire.png", !Globals.NIMBUSLAF));
1949
+ fullsceneButton.setToolTipText("Yvoire!");
1950
+ fullsceneButton.addActionListener(new ActionListener()
1951
+ {
1952
+ @Override
1953
+ public void actionPerformed(ActionEvent e)
1954
+ {
1955
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/Yvoire.gfd", new iCallBack()
1956
+ {
1957
+
1958
+ public void Callback(Object obj)
1959
+ {
1960
+ LoadIt(obj);
1961
+ }
1962
+
1963
+ public void DragGesture()
1964
+ {
1965
+ }
1966
+ });
1967
+ }
1968
+ });
1969
+
1970
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/skullcove.png", !Globals.NIMBUSLAF));
1971
+ fullsceneButton.setToolTipText("Skull Cove Island!");
1972
+ fullsceneButton.addActionListener(new ActionListener()
1973
+ {
1974
+ @Override
1975
+ public void actionPerformed(ActionEvent e)
1976
+ {
1977
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/SkullCoveIsland.gfd", new iCallBack()
1978
+ {
1979
+
1980
+ public void Callback(Object obj)
1981
+ {
1982
+ LoadIt(obj);
1983
+ }
1984
+
1985
+ public void DragGesture()
1986
+ {
1987
+ }
1988
+ });
1989
+ }
1990
+ });
1991
+
18971992 fullscenePanel.Return();
1898
- fullscenePanel.add(new cGridBag());
1899
- fullscenePanel.add(new cGridBag());
1900
- fullscenePanel.Return();
1993
+
19011994 fullscenePanel.add(new cGridBag());
19021995 fullscenePanel.add(new cGridBag());
19031996 fullscenePanel.Return();
....@@ -4196,6 +4289,11 @@
41964289 copy.Touch(); // display list issue
41974290 objEditor.refreshContents(true); // To show item colors
41984291 return;
4292
+ } else if (event.getSource() == sortCB)
4293
+ {
4294
+ copy.sort ^= true;
4295
+ objEditor.refreshContents();
4296
+ return;
41994297 } else if (event.getSource() == link2masterCB)
42004298 {
42014299 copy.link2master ^= true;
....@@ -4959,7 +5057,7 @@
49595057 void ImportGFD()
49605058 {
49615059 FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4962
- browser.show();
5060
+ browser.setVisible(true);
49635061 String filename = browser.getFile();
49645062 if (filename != null && filename.length() > 0)
49655063 {
....@@ -5934,7 +6032,7 @@
59346032 {
59356033 try
59366034 {
5937
- url = new java.net.URL("file://" + fullname);
6035
+ url = new java.net.URL("file:///" + fullname);
59386036 } catch (Exception e2)
59396037 {
59406038 e2.printStackTrace();
Object3D.java
....@@ -140,7 +140,7 @@
140140 projectedVertices[i] = new cVector2(); // Others
141141 }
142142 projectedVertices[0].x = 100; // bump
143
- projectedVertices[1].y = 5000; // punchthrough. only for png
143
+ projectedVertices[1].y = 1000; // punchthrough. only for png
144144 }
145145
146146 void MinMax(cVector minima, cVector maxima)
....@@ -641,6 +641,9 @@
641641 boolean random = false;
642642 boolean speedup = false;
643643 boolean rewind = false;
644
+
645
+ // Option to sort triangles, e.g. for transparency.
646
+ boolean sort = false;
644647
645648 float NORMALPUSH = 0;
646649
....@@ -1213,24 +1216,28 @@
12131216 {
12141217 // return true;
12151218
1216
- if (material == null || material.multiply)
1217
- return true;
1219
+// if (material == null || material.multiply)
1220
+// return true;
1221
+//
1222
+// if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1223
+// return false;
1224
+//
1225
+// // Transparent objects are dynamic because we have to sort the triangles.
1226
+// return material.opacity > 0.99;
12181227
1219
- if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1220
- return false;
1221
-
1222
- // Transparent objects are dynamic because we have to sort the triangles.
1223
- return material.opacity > 0.99;
1228
+ return !sort;
12241229 }
12251230
12261231 boolean IsOpaque()
12271232 {
12281233 // return true;
12291234
1230
- if (material == null || material.multiply)
1231
- return true;
1235
+// if (material == null || material.multiply)
1236
+// return true;
1237
+//
1238
+// return material.opacity > 0.99;
12321239
1233
- return material.opacity > 0.99;
1240
+ return !sort;
12341241 }
12351242
12361243 Object3D()
....@@ -6307,8 +6314,8 @@
63076314 Globals.lighttouched = true; // all panes...
63086315 }
63096316
6310
- touched = GetBRep() == null; // this instanceof Composite || this instanceof FileObject; // false;
6311
- //touched = false;
6317
+ //touched = GetBRep() == null; // this instanceof Composite || this instanceof FileObject; // false;
6318
+ touched = false;
63126319
63136320 if (this instanceof Texture || this instanceof TextureNode)
63146321 {
....@@ -6455,6 +6462,7 @@
64556462 boolean failedPigment = false;
64566463 boolean failedBump = false;
64576464
6465
+ CameraPane.lastObject = this;
64586466 try
64596467 {
64606468 display.BindPigmentTexture(tex, texres);
cMaterial.java
....@@ -362,7 +362,7 @@
362362
363363 float color = 0.5f, modulation /*SATURATION*/ = 0.001f, metalness = 0.001f;
364364 float diffuse = 1f, specular = 0.25f, shininess = 0.75f, shift = 1;
365
- float ambient = 0.001f, lightarea = 0.025f, factor = 0.001f, velvet = 0.001f;
365
+ float ambient = 0.001f, lightarea = 0.005f, factor = 0.001f, velvet = 0.001f;
366366 float sheen = 1f, subsurface = 0.001f, bump = 0.75f, aniso = 0.001f, anisoV = 0.001f;
367367 float cameralight = 0.5f, diffuseness = 0.001f, shadow = 5f, texture = 1f, opacity = 1;
368368 float fakedepth = 0.5f, shadowbias = 0.01f; // 0.001f;
fullscenes/alsace.png
Binary files differ
fullscenes/skullcove.png
Binary files differ
fullscenes/viking.png
Binary files differ
fullscenes/yvoire.png
Binary files differ