The task is to click snapshots of front/back/right/left of a 3d Chair objects. To automate it, we first align all the Chairs such that the height is along z-axis, y-axis is the horizontal axis, and x-axis is into the acreen.
Now, the next thing is to place camera somewhere in first quadrant of y-z plane, so that Camera is by default facing the front of object. If I use the View->Align View->Align Camera View to Selected, the camera is positioned anywhere in 3d space. I would necessarily want the x-location of Camera to be 0. How to do automatic positioning of Camera in y-z plane ? I could think of one solution. To create a Bounding Box around Chair, and then shoot rays from 4 corners of Camera, and detect collision. A python script will handle this and the logic to position Camera accordingly in y-z plane. For that, I will need to know how to do ray shooting and collision detection. I couldn't find any simple step-by-step guide over it.
Clarification: I am not looking for Camera rotation help. I already have that script.