SyntaxHighlighter

Tuesday 23 July 2013

Day 31: ExportJPEGs automation

ExportJPEGs automation

The user has to perform some fine tuning of the export jpeg parameters in order for an acceptable rotating head to be exported.

This is because every single head coming from 123D Catch is widely different in terms of its size, its orientation (luckily they are only either the right way up, or upside down, so it isn't too difficult to normalize the orientation), and its vertical position and therefore the camera in the ExportJPEGs program must be set in the right place for every head, to give consistent images overall.

The best way to manage this user input is via a GUI. The program could run and display a test image of the model, the user changes parameters in the GUI and the test image updates itself. When satisfied, the user hits the "Export" button and the JPEGs are output.

So today, I made GUIs.

Need to incorporate exporting of JPEGs into Goblin XNA so that I can use Goblin's GUI wrappers and easy to use GUI features. Trying to manually work out WinForms would take too long.

Implemented the writing to alternate render target and dumping that target to a JPEG feature. The dumped images show the GUI display correctly, but do not show the rotating shape in the centre at all.

I'm using the Scene.RenderScene() method to draw the scene to the rendertarget. Normally you use Scene.Draw() but that also updates all physics etc that you want to update on a frame, in comparison RenderScene just draws the scene as is without updating anything (which is what we want, we will be drawing the scene 36 times on a single frame, each time rotate the model 10 degrees).

After consideration, it seems best to use the original Scene.Draw() anyway, because we do update the scene graph by rotating the shape. If we use RenderScene, that does not implement updates to the graph and so would draw the same shape 36 times on one draw cycle.

To use Scene.Draw we simply need 36 frames to be rendered to the back buffer and dumped off as jpegs consecutively, and in each frame the object needs to rotate 10 degrees. To implement this I'll make a simple boolean called drawingJPEGs or something, where no update to the scene graph and no input to the GUI can be made whilst it is set to true. In addition a message saying "PROCESSING" or something will appear over the GUI, so the user knows that JPEGs are being exported.

Foamalux, Animation13 Gallery

The foamalux arrived from eBay!
I think it may be a bit more flexible than we anticipated, but we'll test it once it's cut down to size. Definitely seems hard wearing enough.

I got a little side job - processing images to upload to the new Animation13 photo gallery. Rina (Web and Publications Officer) selected 60 or so from the massive bunch we received from Chris Foster the photographer (and they really are amazing photos!), and it's my job to ensure they have the correct names, and that we have large images, preview images and a thumbnail of the correct dimensions, aspect ratio and dpi suitable for web viewing. And then to upload them to our web server on babbage.cs.man.ac.uk.

Unfortunately I couldn't log into babbage - my CS password wasn't being accepted. After further inspection I noted that I couldn't log into my CS account at all - a quick email to Tim from duty office ensued, and it should be fixed tomorrow.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.