Skip to content

Avogadro and POV-Ray Export

I have made some more progress with Avogadro and exporting to POV-Ray. Currently the export is working quite well, but is a more manual process than it will be once I have finished all aspects of its implementation. You can export to POV-Ray, but then need to run POV-Ray yourself on the .pov file created to actually get an image. It is not too much work to add the dialog to call POV-Ray, pass it a few options and display the rendered image.

Right now I have the issue that I cannot properly translate between the OpenGL camera matrix and the POV-Ray camera system. If anyone has any experience of doing this I would love to hear about it. I have tried using the direction, up and right keywords but POV-Ray claims my coordinates are not orthogonal, and they are - Benoit double checked they were too. I am probably missing something simple. So right now I can export to POV-Ray but only get one view of the atom which does not follow the view in Avogadro - not ideal but certainly usable.

1d66 rendered in POV-Ray with shadows1d66 rendered in POV-Ray without shadows

The images above show a rendering of 1d66 from the protein data bank thing (I sometimes grab interesting and large example structures from there to test Avogadro and Carsten liked this one). The first image shows it rendered with shadows and the second shows it rendered without shadows. Carsten pointed out that effects such as shadows can serve to confuse students but this can be made a configurable option as shadows also help the mind to visualise the three dimensional structure in my opinion (if used right).

There are lots of things that can be tweaked about the way the files are exported as well as the rendered image look and feel. A lot of work has actually gone into getting this working as I have made the painter independent of the paint device being used. This means that the engines can paint to any device where a painter implements the primitives in the virtual base class and I think this will allow Avogadro to scale very well as more features are added.

Avogadro Gets More Eye Candy (Visual Cues)

During my trip to Paris Benoit and I discussed our ideas for adding some nice eye candy to Avogadro that would give better visual cues as to what exactly the tool was doing. In the case of the navigation tool each mouse button triggers a movement around the atom in a different sense, i.e. the left mouse initiates rotation, the middle initiates zooming/tilting and the right initiates translation. We had considered how best to convey this to the user without them needing to read the manual as most of us avoid doing that!

Avogadro rotation

The screen shot above shows the visual cue we worked on for atom centric rotation. Benoit and I worked on the initial code in the Versailles gardens and I finished it off when I got back. I really like this one which shows rotation about the x and y axes. As you rotate about the atom the arrows rotate around too allowing you to quickly see how much you have rotated the view by. I have been thinking about the usefulness of adding a text display of x and y rotation to the tool too.

Avogadro translation

This screen shot shows the visual cue for atom centric translation. This cue isn't quite as dynamic as the rotation one but I think it conveys very quickly what the tool is doing. It also moves around the atom surface with perspective and that looks quite nice. We have planned one for zooming and tilting but I haven't had chance to implement that yet.

Avogadro angle measurement

Today I added another visual cue to our click measure tool too - showing the angle which is being measured by the tool. Much credit goes to the guys who worked on the bond centric manipulation tool who added the code to the painter for drawing shaded sectors. I took the opportunity to add units to the displayed measurements too as they really should be displayed.

I do have more plans for eye candy and will try to highlight them as they are implemented. I would love to know if people think that these additions are useful. I think it makes the tools far more intuitive and so reduces the learning curve.

Hectic Week

Wow - what a hectic week. This has got to have been one of the most exhausting weeks I have had in years. Started off with final corrections and tweaking of my doctoral thesis. After many hours of printing I got the three copies submitted on Tuesday afternoon. Managed a few celebrations on Wednesday evening along with a friend who submitted her thesis on Wednesday. Thursday we went to a friend's wedding which was really nice.

Yesterday we had a really long day, we caught a train at just after 7am down to London. We weren't allowed to take any electronics as we were going to the US embassy to apply for a visa. I really missed having my mobile phone and being in London it would have been good to have had a camera. We got to the embassy in good time, spent about three hours in there before having our applications approved, which means we can finally start making travel arrangements! I start my new job in Pittsburgh at the start of October and am really looking forward to getting out there. I am sure I will talk more about my postdoctoral position more soon! We didn't get back home until just after midnight, by which pointy we were very tired.

Now we are on Saturday and I can finally sit down in front of a computer. I am surrounded by electronics again and so am much happier now ;-) I don't think people appreciate how hard it is for someone like me to be without electronics for a day. I am now surveying what I can get done for my Google Summer of Code project before it ends. I will blog shortly about some of the stuff I have done recently but just haven't found the time to talk about yet too.