.. | .. |
---|
692 | 692 | protected static ImageIcon createImageIcon(String path, |
---|
693 | 693 | String description) |
---|
694 | 694 | { |
---|
695 | | - java.net.URL imgURL = GraphreeD.class.getResource(path); |
---|
| 695 | + java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
696 | 696 | if (imgURL != null) |
---|
697 | 697 | { |
---|
698 | 698 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
1107 | 1107 | //frontScroll.setLabel("------------------------------ XZ (front) ---------------------------------------------------"); |
---|
1108 | 1108 | //sideScroll.setLabel("------------------------------- YZ (side) ---------------------------------------------------"); |
---|
1109 | 1109 | |
---|
1110 | | -// GridBagConstraints gbc = (GridBagConstraints) GraphreeD.clone(aConstraints); |
---|
| 1110 | +// GridBagConstraints gbc = (GridBagConstraints) GrafreeD.clone(aConstraints); |
---|
1111 | 1111 | Camera cam = GetCamera(copy, 0); |
---|
1112 | 1112 | |
---|
1113 | 1113 | Composite cams = null; |
---|
.. | .. |
---|
1334 | 1334 | frame.getContentPane().add(/*"Center",*/framePanel); |
---|
1335 | 1335 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1336 | 1336 | |
---|
1337 | | -// aConstraints = gbc; // (GridBagConstraints) GraphreeD.clone(gbc); |
---|
| 1337 | +// aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1338 | 1338 | |
---|
1339 | 1339 | frame.setSize(1024, 768); |
---|
1340 | 1340 | frame.show(); |
---|
.. | .. |
---|
1859 | 1859 | } |
---|
1860 | 1860 | |
---|
1861 | 1861 | // Images/textures |
---|
1862 | | - if (textures |
---|
1863 | | - && (filename.toLowerCase().endsWith(".jpg") |
---|
1864 | | - || filename.toLowerCase().endsWith(".jpeg") |
---|
1865 | | - || filename.toLowerCase().endsWith(".gif") |
---|
1866 | | - || filename.toLowerCase().endsWith(".png") |
---|
1867 | | - || filename.toLowerCase().endsWith(".tre") |
---|
1868 | | - || filename.toLowerCase().endsWith(".bmp") |
---|
1869 | | - || filename.toLowerCase().endsWith(".tga") |
---|
1870 | | - || filename.toLowerCase().endsWith(".sgi") |
---|
1871 | | - || filename.toLowerCase().endsWith(".tif") |
---|
1872 | | - || filename.toLowerCase().endsWith(".tiff"))) |
---|
| 1862 | + if (filename.toLowerCase().endsWith(".jpg") |
---|
| 1863 | + || filename.toLowerCase().endsWith(".jpeg") |
---|
| 1864 | + || filename.toLowerCase().endsWith(".gif") |
---|
| 1865 | + || filename.toLowerCase().endsWith(".png") |
---|
| 1866 | + || filename.toLowerCase().endsWith(".tre") |
---|
| 1867 | + || filename.toLowerCase().endsWith(".bmp") |
---|
| 1868 | + || filename.toLowerCase().endsWith(".tga") |
---|
| 1869 | + || filename.toLowerCase().endsWith(".sgi") |
---|
| 1870 | + || filename.toLowerCase().endsWith(".tif") |
---|
| 1871 | + || filename.toLowerCase().endsWith(".tiff")) |
---|
1873 | 1872 | { |
---|
1874 | | - DropTexture(filename); |
---|
| 1873 | + if (textures) |
---|
| 1874 | + DropTexture(filename); |
---|
| 1875 | + else |
---|
| 1876 | + CreateBillboard(filename); |
---|
1875 | 1877 | continue; |
---|
1876 | 1878 | } |
---|
1877 | 1879 | |
---|
.. | .. |
---|
1880 | 1882 | } |
---|
1881 | 1883 | |
---|
1882 | 1884 | ResetModel(); |
---|
| 1885 | + } |
---|
| 1886 | + |
---|
| 1887 | + void CreateBillboard(String filename) |
---|
| 1888 | + { |
---|
| 1889 | + Object3D source = null; |
---|
| 1890 | + Object3D group = copy; |
---|
| 1891 | + |
---|
| 1892 | + if (group.selection.size() > 0) |
---|
| 1893 | + { |
---|
| 1894 | + source = group.selection.get(0); |
---|
| 1895 | + } |
---|
| 1896 | + |
---|
| 1897 | + Grid grid = new Grid(1,1); |
---|
| 1898 | + grid.material = null; |
---|
| 1899 | + |
---|
| 1900 | + grid.toParent = LA.newMatrix(); |
---|
| 1901 | + grid.fromParent = LA.newMatrix(); |
---|
| 1902 | + LA.matYRotate(grid.toParent, Math.PI/2); |
---|
| 1903 | + LA.matXRotate(grid.toParent, -Math.PI/2); |
---|
| 1904 | + LA.matXRotate(grid.fromParent, Math.PI/2); |
---|
| 1905 | + LA.matYRotate(grid.fromParent, -Math.PI/2); |
---|
| 1906 | + |
---|
| 1907 | + BillboardNode bb = new BillboardNode(); |
---|
| 1908 | + bb.addChild(grid); |
---|
| 1909 | + |
---|
| 1910 | + Object3D newgroup = new Object3D(); |
---|
| 1911 | + newgroup.CreateMaterial(); |
---|
| 1912 | + |
---|
| 1913 | + File file = new File(filename); |
---|
| 1914 | + newgroup.name = file.getName(); |
---|
| 1915 | + newgroup.addChild(bb); |
---|
| 1916 | + |
---|
| 1917 | + Object3D main = newgroup; |
---|
| 1918 | + |
---|
| 1919 | + main.SetPigmentTexture(filename); |
---|
| 1920 | + |
---|
| 1921 | + if (source != null) |
---|
| 1922 | + { |
---|
| 1923 | + main.material = new cMaterial(source.material); |
---|
| 1924 | + if (main.projectedVertices.length < source.projectedVertices.length) |
---|
| 1925 | + { |
---|
| 1926 | + main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length]; |
---|
| 1927 | + } |
---|
| 1928 | + |
---|
| 1929 | + for (int i=0; i<source.projectedVertices.length; i++) |
---|
| 1930 | + { |
---|
| 1931 | + main.projectedVertices[i].x = source.projectedVertices[i].x; |
---|
| 1932 | + main.projectedVertices[i].y = source.projectedVertices[i].y; |
---|
| 1933 | + } |
---|
| 1934 | + |
---|
| 1935 | + main.texres = source.texres; |
---|
| 1936 | + } |
---|
| 1937 | + |
---|
| 1938 | + makeSomething(newgroup, false); |
---|
1883 | 1939 | } |
---|
1884 | 1940 | |
---|
1885 | 1941 | Point location; |
---|
.. | .. |
---|
2345 | 2401 | |
---|
2346 | 2402 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2347 | 2403 | { |
---|
2348 | | - if (GraphreeD.standAlone) |
---|
| 2404 | + if (GrafreeD.standAlone) |
---|
2349 | 2405 | { |
---|
2350 | 2406 | /**/ |
---|
2351 | 2407 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
.. | .. |
---|
3183 | 3239 | |
---|
3184 | 3240 | CameraPane.ANIMATION ^= true; |
---|
3185 | 3241 | |
---|
3186 | | - GraphreeD.wav.cursor = 0; |
---|
3187 | | - GraphreeD.wav.loop = 0; |
---|
| 3242 | + GrafreeD.wav.cursor = 0; |
---|
| 3243 | + GrafreeD.wav.loop = 0; |
---|
3188 | 3244 | } |
---|
3189 | 3245 | } else |
---|
3190 | 3246 | { |
---|
.. | .. |
---|
4085 | 4141 | |
---|
4086 | 4142 | void load() // throws ClassNotFoundException |
---|
4087 | 4143 | { |
---|
4088 | | - if (GraphreeD.standAlone) |
---|
| 4144 | + if (GrafreeD.standAlone) |
---|
4089 | 4145 | { |
---|
4090 | 4146 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4091 | 4147 | browser.show(); |
---|
.. | .. |
---|
4190 | 4246 | |
---|
4191 | 4247 | void saveAs() |
---|
4192 | 4248 | { |
---|
4193 | | - if (GraphreeD.standAlone) |
---|
| 4249 | + if (GrafreeD.standAlone) |
---|
4194 | 4250 | { |
---|
4195 | 4251 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4196 | 4252 | browser.setVisible(true); |
---|
.. | .. |
---|
4213 | 4269 | |
---|
4214 | 4270 | Object3D object = copy.selection.get(0); |
---|
4215 | 4271 | |
---|
| 4272 | + FileObject fileobj = null; |
---|
| 4273 | + |
---|
| 4274 | + if (object instanceof FileObject) |
---|
| 4275 | + fileobj = (FileObject)object; |
---|
| 4276 | + |
---|
4216 | 4277 | if (object.fileparent != null) |
---|
4217 | 4278 | { |
---|
4218 | | - FileObject fileobj = (FileObject) object.fileparent; |
---|
| 4279 | + assert(fileobj == null); |
---|
4219 | 4280 | |
---|
| 4281 | + fileobj = (FileObject) object.fileparent; |
---|
| 4282 | + } |
---|
| 4283 | + |
---|
| 4284 | + if (fileobj != null) |
---|
| 4285 | + { |
---|
4220 | 4286 | System.out.println("WriteObject " + object + " : " + fileobj.name); |
---|
4221 | 4287 | WriteObject(object, fileobj.name); |
---|
4222 | 4288 | } |
---|
.. | .. |
---|
4259 | 4325 | } |
---|
4260 | 4326 | } |
---|
4261 | 4327 | else |
---|
4262 | | - //if (GraphreeD.standAlone) |
---|
| 4328 | + //if (GrafreeD.standAlone) |
---|
4263 | 4329 | { |
---|
4264 | 4330 | FileDialog browser = new FileDialog(frame, "Export", FileDialog.SAVE); |
---|
4265 | 4331 | browser.setVisible(true); |
---|
.. | .. |
---|
4291 | 4357 | Object3D objectparent = obj.parent; |
---|
4292 | 4358 | obj.parent = null; |
---|
4293 | 4359 | |
---|
4294 | | - Object3D object = (Object3D) GraphreeD.clone(obj); |
---|
| 4360 | + Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
4295 | 4361 | |
---|
4296 | 4362 | obj.parent = objectparent; |
---|
4297 | 4363 | |
---|
.. | .. |
---|
4325 | 4391 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4326 | 4392 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4327 | 4393 | copy.generatePOV(buffer); |
---|
4328 | | - if (GraphreeD.standAlone) |
---|
| 4394 | + if (GrafreeD.standAlone) |
---|
4329 | 4395 | { |
---|
4330 | 4396 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4331 | 4397 | browser.show(); |
---|