.. | .. |
---|
522 | 522 | maxima.y = sel.toParent[3][1]; |
---|
523 | 523 | maxima.z = sel.toParent[3][2]; |
---|
524 | 524 | si.SendInfo(" Orig: " + maxima, "regular"); |
---|
525 | | - maxima.x = sel.globalTransform[3][0]; |
---|
526 | | - maxima.y = sel.globalTransform[3][1]; |
---|
527 | | - maxima.z = sel.globalTransform[3][2]; |
---|
528 | | - if (full) |
---|
529 | | - si.SendInfo(" Global Orig: " + maxima, "regular"); |
---|
530 | 525 | maxima.x = sel.toParent[0][0]; |
---|
531 | 526 | maxima.y = sel.toParent[1][1]; |
---|
532 | 527 | maxima.z = sel.toParent[2][2]; |
---|
533 | 528 | si.SendInfo(" Scale: " + maxima, "regular"); |
---|
534 | | - maxima.x = sel.globalTransform[0][0]; |
---|
535 | | - maxima.y = sel.globalTransform[1][1]; |
---|
536 | | - maxima.z = sel.globalTransform[2][2]; |
---|
| 529 | + maxima.x = sel.globalTransform[3][0]; |
---|
| 530 | + maxima.y = sel.globalTransform[3][1]; |
---|
| 531 | + maxima.z = sel.globalTransform[3][2]; |
---|
| 532 | + if (full) |
---|
| 533 | + si.SendInfo(" Global Orig: " + maxima, "regular"); |
---|
| 534 | + maxima.x = sel.globalTransform[0][0]; |
---|
| 535 | + maxima.y = sel.globalTransform[1][1]; |
---|
| 536 | + maxima.z = sel.globalTransform[2][2]; |
---|
537 | 537 | if (full) |
---|
538 | 538 | si.SendInfo(" Global Scale: " + maxima, "regular"); |
---|
539 | 539 | } |
---|
.. | .. |
---|
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; |
---|
.. | .. |
---|
1161 | 1161 | /*JPanel*/ cameraPanel = |
---|
1162 | 1162 | new JPanel(new BorderLayout()); |
---|
1163 | 1163 | cameraPanel.add(cameraView); |
---|
| 1164 | + //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame); |
---|
1164 | 1165 | |
---|
1165 | 1166 | //topView.camera = ; |
---|
1166 | 1167 | //frontView.camera = new Camera(2); |
---|
.. | .. |
---|
1244 | 1245 | scrollpane.setWheelScrollingEnabled(true); |
---|
1245 | 1246 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1246 | 1247 | |
---|
1247 | | - /*JTabbedPane*/ jtp = new JTabbedPane(); |
---|
1248 | | - jtp.add(scrollpane); |
---|
| 1248 | + /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
| 1249 | + scenePanel.add(scrollpane); |
---|
1249 | 1250 | |
---|
1250 | | - jtp.add(FSPane = new cFileSystemPane(this)); |
---|
| 1251 | + scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1251 | 1252 | |
---|
1252 | 1253 | optionsPanel = new JPanel(new GridBagLayout()); |
---|
1253 | 1254 | |
---|
1254 | 1255 | optionsPanel.setName("Options"); |
---|
1255 | | - jtp.add(optionsPanel); |
---|
| 1256 | + scenePanel.add(optionsPanel); |
---|
1256 | 1257 | |
---|
1257 | 1258 | |
---|
1258 | 1259 | /* |
---|
.. | .. |
---|
1275 | 1276 | jtp.add(tree); |
---|
1276 | 1277 | */ |
---|
1277 | 1278 | |
---|
1278 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel); |
---|
| 1279 | + bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1279 | 1280 | bigPanel.setContinuousLayout(true); |
---|
1280 | 1281 | bigPanel.setOneTouchExpandable(true); |
---|
1281 | 1282 | bigPanel.setDividerLocation(0.8); |
---|
.. | .. |
---|
1297 | 1298 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1298 | 1299 | aWindowConstraints.weightx = 0; |
---|
1299 | 1300 | aWindowConstraints.weighty = 1; |
---|
1300 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 1301 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
1301 | 1302 | aWindowConstraints.weightx = 1; |
---|
1302 | 1303 | aWindowConstraints.gridwidth = 3; |
---|
1303 | 1304 | // aConstraints.gridheight = 3; |
---|
.. | .. |
---|
1334 | 1335 | frame.getContentPane().add(/*"Center",*/framePanel); |
---|
1335 | 1336 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1336 | 1337 | |
---|
1337 | | -// aConstraints = gbc; // (GridBagConstraints) GraphreeD.clone(gbc); |
---|
| 1338 | +// aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1338 | 1339 | |
---|
1339 | | - frame.setSize(800, 600); |
---|
| 1340 | + frame.setSize(1024, 768); |
---|
1340 | 1341 | frame.show(); |
---|
1341 | 1342 | |
---|
1342 | 1343 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1859 | 1860 | } |
---|
1860 | 1861 | |
---|
1861 | 1862 | // 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"))) |
---|
| 1863 | + if (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")) |
---|
1873 | 1873 | { |
---|
1874 | | - DropTexture(filename); |
---|
| 1874 | + if (textures) |
---|
| 1875 | + DropTexture(filename); |
---|
| 1876 | + else |
---|
| 1877 | + CreateBillboard(filename); |
---|
1875 | 1878 | continue; |
---|
1876 | 1879 | } |
---|
1877 | 1880 | |
---|
.. | .. |
---|
1880 | 1883 | } |
---|
1881 | 1884 | |
---|
1882 | 1885 | ResetModel(); |
---|
| 1886 | + } |
---|
| 1887 | + |
---|
| 1888 | + void CreateBillboard(String filename) |
---|
| 1889 | + { |
---|
| 1890 | + Object3D source = null; |
---|
| 1891 | + Object3D group = copy; |
---|
| 1892 | + |
---|
| 1893 | + if (group.selection.size() > 0) |
---|
| 1894 | + { |
---|
| 1895 | + source = group.selection.get(0); |
---|
| 1896 | + } |
---|
| 1897 | + |
---|
| 1898 | + Grid grid = new Grid(1,1); |
---|
| 1899 | + grid.material = null; |
---|
| 1900 | + |
---|
| 1901 | + grid.toParent = LA.newMatrix(); |
---|
| 1902 | + grid.fromParent = LA.newMatrix(); |
---|
| 1903 | + LA.matYRotate(grid.toParent, Math.PI/2); |
---|
| 1904 | + LA.matXRotate(grid.toParent, -Math.PI/2); |
---|
| 1905 | + LA.matXRotate(grid.fromParent, Math.PI/2); |
---|
| 1906 | + LA.matYRotate(grid.fromParent, -Math.PI/2); |
---|
| 1907 | + |
---|
| 1908 | + BillboardNode bb = new BillboardNode(); |
---|
| 1909 | + bb.addChild(grid); |
---|
| 1910 | + |
---|
| 1911 | + Object3D newgroup = new Object3D(); |
---|
| 1912 | + newgroup.CreateMaterial(); |
---|
| 1913 | + |
---|
| 1914 | + File file = new File(filename); |
---|
| 1915 | + newgroup.name = file.getName(); |
---|
| 1916 | + newgroup.addChild(bb); |
---|
| 1917 | + |
---|
| 1918 | + Object3D main = newgroup; |
---|
| 1919 | + |
---|
| 1920 | + main.SetPigmentTexture(filename); |
---|
| 1921 | + |
---|
| 1922 | + if (source != null) |
---|
| 1923 | + { |
---|
| 1924 | + main.material = new cMaterial(source.material); |
---|
| 1925 | + if (main.projectedVertices.length < source.projectedVertices.length) |
---|
| 1926 | + { |
---|
| 1927 | + main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length]; |
---|
| 1928 | + } |
---|
| 1929 | + |
---|
| 1930 | + for (int i=0; i<source.projectedVertices.length; i++) |
---|
| 1931 | + { |
---|
| 1932 | + main.projectedVertices[i].x = source.projectedVertices[i].x; |
---|
| 1933 | + main.projectedVertices[i].y = source.projectedVertices[i].y; |
---|
| 1934 | + } |
---|
| 1935 | + |
---|
| 1936 | + main.texres = source.texres; |
---|
| 1937 | + } |
---|
| 1938 | + |
---|
| 1939 | + makeSomething(newgroup, false); |
---|
1883 | 1940 | } |
---|
1884 | 1941 | |
---|
1885 | 1942 | Point location; |
---|
.. | .. |
---|
2138 | 2195 | { |
---|
2139 | 2196 | Mocap sel = (Mocap) copy.selection.get(0); |
---|
2140 | 2197 | |
---|
| 2198 | + sel.SetCurrentBones(sel.frame); |
---|
| 2199 | + |
---|
2141 | 2200 | sel.fullname = fullname; |
---|
2142 | 2201 | |
---|
2143 | 2202 | if (changename) |
---|
.. | .. |
---|
2151 | 2210 | sel.smoothed = false; |
---|
2152 | 2211 | |
---|
2153 | 2212 | // if (!changename) |
---|
2154 | | - sel.SetPositionDelta(false, true, true, true/*?*/); // false |
---|
| 2213 | + //sel.SetPositionDelta(false, true, true, true/*?*/); // false |
---|
| 2214 | + sel.SetGlobalTransform(); |
---|
| 2215 | + sel.LoadData(); |
---|
| 2216 | + sel.Rewind(); |
---|
| 2217 | + sel.Fade(); |
---|
2155 | 2218 | // sel.setPose(0); |
---|
2156 | 2219 | refreshContents(); |
---|
2157 | 2220 | } else |
---|
2158 | 2221 | { |
---|
2159 | 2222 | mocap.Reset(); |
---|
2160 | 2223 | // new skeleton |
---|
2161 | | - makeSomething(mocap, false); // true); |
---|
| 2224 | + makeSomething(mocap, true); // true); |
---|
2162 | 2225 | } |
---|
2163 | 2226 | } catch (Exception e) |
---|
2164 | 2227 | { |
---|
.. | .. |
---|
2185 | 2248 | { |
---|
2186 | 2249 | Mocap sel = (Mocap) select; |
---|
2187 | 2250 | |
---|
| 2251 | + sel.SetCurrentBones(sel.frame); |
---|
| 2252 | + |
---|
2188 | 2253 | File file = new File(fullname); |
---|
2189 | 2254 | |
---|
2190 | 2255 | // Mocap mocap = new Mocap("Mocap" + file.getName()); |
---|
.. | .. |
---|
2251 | 2316 | |
---|
2252 | 2317 | if (!changename) |
---|
2253 | 2318 | { |
---|
2254 | | - sel.SetPositionDelta(false, true, true, true/*?*/); |
---|
| 2319 | + //sel.SetPositionDelta(false, true, true, true/*?*/); |
---|
| 2320 | + sel.SetGlobalTransform(); |
---|
| 2321 | + sel.LoadData(); |
---|
| 2322 | + sel.Rewind(); |
---|
| 2323 | + sel.Fade(); |
---|
2255 | 2324 | } |
---|
2256 | 2325 | |
---|
2257 | 2326 | // sel.setPose(0); |
---|
.. | .. |
---|
2345 | 2414 | |
---|
2346 | 2415 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2347 | 2416 | { |
---|
2348 | | - if (GraphreeD.standAlone) |
---|
| 2417 | + if (GrafreeD.standAlone) |
---|
2349 | 2418 | { |
---|
2350 | 2419 | /**/ |
---|
2351 | 2420 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
.. | .. |
---|
3183 | 3252 | |
---|
3184 | 3253 | CameraPane.ANIMATION ^= true; |
---|
3185 | 3254 | |
---|
3186 | | - GraphreeD.wav.cursor = 0; |
---|
3187 | | - GraphreeD.wav.loop = 0; |
---|
| 3255 | + GrafreeD.wav.cursor = 0; |
---|
| 3256 | + GrafreeD.wav.loop = 0; |
---|
3188 | 3257 | } |
---|
3189 | 3258 | } else |
---|
3190 | 3259 | { |
---|
.. | .. |
---|
3596 | 3665 | |
---|
3597 | 3666 | if (obj.parent != null) |
---|
3598 | 3667 | { |
---|
3599 | | - obj.parent.TransformToWorld(interest); |
---|
| 3668 | +// obj.parent.TransformToWorld(interest); |
---|
3600 | 3669 | } |
---|
3601 | 3670 | |
---|
3602 | 3671 | if (!CameraPane.TRACK) |
---|
.. | .. |
---|
4085 | 4154 | |
---|
4086 | 4155 | void load() // throws ClassNotFoundException |
---|
4087 | 4156 | { |
---|
4088 | | - if (GraphreeD.standAlone) |
---|
| 4157 | + if (GrafreeD.standAlone) |
---|
4089 | 4158 | { |
---|
4090 | 4159 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4091 | 4160 | browser.show(); |
---|
.. | .. |
---|
4190 | 4259 | |
---|
4191 | 4260 | void saveAs() |
---|
4192 | 4261 | { |
---|
4193 | | - if (GraphreeD.standAlone) |
---|
| 4262 | + if (GrafreeD.standAlone) |
---|
4194 | 4263 | { |
---|
4195 | 4264 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4196 | 4265 | browser.setVisible(true); |
---|
.. | .. |
---|
4213 | 4282 | |
---|
4214 | 4283 | Object3D object = copy.selection.get(0); |
---|
4215 | 4284 | |
---|
| 4285 | + FileObject fileobj = null; |
---|
| 4286 | + |
---|
| 4287 | + if (object instanceof FileObject) |
---|
| 4288 | + fileobj = (FileObject)object; |
---|
| 4289 | + |
---|
4216 | 4290 | if (object.fileparent != null) |
---|
4217 | 4291 | { |
---|
4218 | | - FileObject fileobj = (FileObject) object.fileparent; |
---|
| 4292 | + assert(fileobj == null); |
---|
4219 | 4293 | |
---|
| 4294 | + fileobj = (FileObject) object.fileparent; |
---|
| 4295 | + } |
---|
| 4296 | + |
---|
| 4297 | + if (fileobj != null) |
---|
| 4298 | + { |
---|
4220 | 4299 | System.out.println("WriteObject " + object + " : " + fileobj.name); |
---|
4221 | 4300 | WriteObject(object, fileobj.name); |
---|
4222 | 4301 | } |
---|
.. | .. |
---|
4259 | 4338 | } |
---|
4260 | 4339 | } |
---|
4261 | 4340 | else |
---|
4262 | | - //if (GraphreeD.standAlone) |
---|
| 4341 | + //if (GrafreeD.standAlone) |
---|
4263 | 4342 | { |
---|
4264 | 4343 | FileDialog browser = new FileDialog(frame, "Export", FileDialog.SAVE); |
---|
4265 | 4344 | browser.setVisible(true); |
---|
.. | .. |
---|
4291 | 4370 | Object3D objectparent = obj.parent; |
---|
4292 | 4371 | obj.parent = null; |
---|
4293 | 4372 | |
---|
4294 | | - Object3D object = (Object3D) GraphreeD.clone(obj); |
---|
| 4373 | + Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
4295 | 4374 | |
---|
4296 | 4375 | obj.parent = objectparent; |
---|
4297 | 4376 | |
---|
.. | .. |
---|
4325 | 4404 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4326 | 4405 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4327 | 4406 | copy.generatePOV(buffer); |
---|
4328 | | - if (GraphreeD.standAlone) |
---|
| 4407 | + if (GrafreeD.standAlone) |
---|
4329 | 4408 | { |
---|
4330 | 4409 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4331 | 4410 | browser.show(); |
---|
.. | .. |
---|
4393 | 4472 | JSplitPane gridPanel; |
---|
4394 | 4473 | JSplitPane bigPanel; |
---|
4395 | 4474 | JPanel bigThree; |
---|
4396 | | - JTabbedPane jtp; |
---|
| 4475 | + JTabbedPane scenePanel; |
---|
4397 | 4476 | JPanel cameraPanel; |
---|
4398 | 4477 | JSplitPane framePanel; |
---|
4399 | 4478 | JTextArea/*Field*/ nameField; |
---|