Angle of the field of view

Dear Avogadro developers,

I’m a beginner of avogadro. I use avogadro for watching crystal
structures. Sometimes the angle of the default field of view is a
little bit wide for me and I want to make it narrower such as 10. I
looked for the button or menu for that, but I could not find it. Is
there a way to change it? If not, is it possible to be considered for
ToDo?

Because I have no idea about Qt and GUI implementations, I can not
contribute to the implementation directly now. I though at least I
should understand how the angle of the field of view is controled in
avogadro, and I have looked into the code.

The variable of angleOfViewY is defined as a member variable of the
Camera class. This is used when calling gluPerspective. When changing
angleOfViewY, the viewpoint distance should be changed, too. The
default angle is 20, so if the desired angle is ‘theta’, the viewpoint
distance will be multiplied by tan( 20/180 * PI ) / tan( theta/180 *
PI ). I think this multiplication can be done in the argument of
pretranslate in Camera::initializeViewPoint(). I hope this information
will be some help, though this may be quite common knowledge.

Best regards,


Atsushi Togo
http://atztogo.users.sourceforge.net/
atz.togo@gmail.com

On Thu, Mar 31, 2011 at 4:41 AM, Atz Togo atz.togo@gmail.com wrote:

Dear Avogadro developers,

I’m a beginner of avogadro. I use avogadro for watching crystal
structures. Sometimes the angle of the default field of view is a
little bit wide for me and I want to make it narrower such as 10. I
looked for the button or menu for that, but I could not find it. Is
there a way to change it? If not, is it possible to be considered for
ToDo?

It is not currently exposed, but I have been thinking about how we
might expose more of the camera matrix to users. I would be happy to
add it to my todo, but can’t make any promises on precisely when I
will get it in. I would like to add this along with orthographic views
etc in the near term though.

Thanks for the pointers, it has been a while since I touched the class
and so a refresher does not go amiss.

Best wishes,

Marcus