France
Joined: Mar 9, 2010
Post Count: 7
Status:
Offline
A plug-in for creating a 3D video
Hi,
1-As a teacher, I participate to a project with young students and I would like to have a tool to produce videos. I have started writing a plug-in. Although I am a newbie in Java, I have got a first encouraging result. Then, I have just seen your project " Creating 3D videos" on your blog. It would be probably perfect for us. But unfortunately, we don't have much time and I would like to go further quickly. Perhaps you can help me on some points.
2- I have developed a tool – an Open Office Spreadsheet – to help building a list of all the necessaries characteristics of the camera for each image then produce a text-file. My plug-in reads this file and moves the observer in the plan. The visit is shown in the 3D-view.
3- There are three difficulties left:
a) A first option enables to follow the movements image by image, displaying a message. But the instruction:
JOptionPane.showMessageDialog(null, "");
centers the message. I don't know how to choose a better position.
b) A second option enables to chain the movements without displaying a message. But the intermediate positions are not shown. I suppose that I should send a message to a listener of the 3D view to say that something has changed; but I don't know how to do it.
c) Most important, I would like that a third option create and save the images as the "Render Tool" does. Here is my code. It does not work.
b) You're right, displaying a message to wait for the end of each move in the 3D view is probably not the best solution. Miserably, the solution is not straightforward. The best solution would be to wait for an event that tells you that a move of the camera is finished in the 3D view, but this would oblige you to create and display a 3D view that would use the canvas3DPostRendered method I added for Canvas3D instances (see line 244 in HomeComponent for a real example). If you capture images with Robot class (as I suppose you do), a simpler solution might be to include your calls to createScreenCapture in EventQueue invokeLater or invokeAndWait calls (the choice depends on the thread in which you run your video program).
final Robot robot = new Robot(); EventQueue.invokeLater(new Runnable() { public void run() { robot.createScreenCapture(...); } });
c) I don't see any error in your code. It looks almost the same as the one I used in VideoPanel.PhotoImageGenerator class. What exceptions do you get? Do you use multithreading?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer