# Mirror-ball for fisheye effect with orthographic camera

I am modelling a fisheye lens for Blender using a mirror-ball and an orthogrpahic camera as shown below:

Black circle represents the mirror and red lines the orthographic camera and its output/incoming rays. The camera records the environment reflected on the mirror-ball, which gives an equisolid fisheye effect to the final image rendered.

The thing is that I have certain parameters of a lens and need to model the group camera+mirror accordingly as a fisheye equisolid. Using the equisolid projection equation I can calculate the radius of the ball, but I have doubts about the orthographic scale of the camera. I do not know what should it be in order to obtain the desired results.

For instance, I know that the sensor is 648x488px (4.032mm horizontal size), focal length = 1.134mm and FOV = 160deg (80+80). Then, radius of the ball should be r = 2.268mm according to the following equation:

$$Radius = 2*FocalLength*sin(AngleMax/2)$$

I think that the orthographic scale is related to the sensor size and the radius probably, but I would appreciate if someone could help me work this out.

I have found the mirror-ball designed in the internet, but notice that I want to know how to design it myself so that I can create different ones for each lens.

-------------------------------------EDIT-------------------------------------

I have the following setup:

Blue and red lines are separated 5 degrees and cover a range of 180 degrees. Yellow cylinder is located at 98 degrees from what I consider the center (negative y-axis, which goes into the half colored ball).

I place in the middle of the scene (where x-axis and y-axis cross) two systems:

1. A fisheye equisolid camera with certain parameters that has 196 degrees
of horizontal field of view when rendering in cycles. The render of this
camera:


2. A mirror ball on the center with an orthographic camera pointing at it.
When rendering with Bledner Render (image below) the objective is to
obtain the same image obtained in system 1 with Cycles. In other words, I
need to design the mirror ball and orthographic camera pair in a way that
the 196 degrees requirement is fulfilled and there is a very similar
equisolid distortion (I know it will not be exact because of the nature
of the procedure, but a good approximation is okey to me).


I am not sure which is the relation between the radius of the mirror ball and the orthographic camera scale (if there is any). I do not know how to calculate the radius of the ball in order to obtain the desired results or if it is an arbitrary value. I have found that radius_ball/(horizontal_sensor_size/2) = focal_length but I am not really sure about this. My question is how to design the mirror ball camera system so that the results are the desired ones.

I have found a pair of radius-orthographic scale values that do a pretty good job (see images above) but I would like to know the whole mathematics behind this and if my assumption is true.

Thanks,

The sensor size or camera object scale has no effect on the projection. It works like this:

It's the camera plane (the base of the pyramid shape) projected into the scene.

• render resolution sets the plane's sides ratio
• orthographic scale sets the plane size, scale of 1.0 means the camera's plane is 1.0 units wide

You can calculate the camera corners with python:

Export rendered image corners coordinates

You will get them at camera origin where the sensor is, not where the camera border is displayed in viewport. Since the projection is orthogonal this should not matter.

• Right, camera scale has no effect on the projection. What should the camera scale be in order to see the reflection of the objects on the mirror ball in the correct size. I am using as reference 1m = 1000BU or 1mm = 1BU. I have a camera+mirrorball system created but I do not find the relation between the orthographic camera scale and the readius of the ball (or whatever relation exists) – Miguel Sep 24 '18 at 10:23
• @Miguel are you just trying to fit the mirror-ball into render-frame precisely or are you actually trying to render some object's reflection on the ball in specific size (that would be in pixels) - because that's a lot harder thing because of the distortion of the reflection. – Jaroslav Jerryno Novotny Sep 24 '18 at 11:48
• I am trying to render some object-s reflection on the ball in specific size. The thing is I know there will be an equisolid like distortion but do not find a way to scale the image so that the objects of the scene have the size expected. With cycles I can model a fisheye-equisolid lens, so I know what the result will be but I am interested in getting the same (or pretty accurate at least) result on Blender Render. – Miguel Sep 24 '18 at 12:38
• @Miguel Can you edit your question and add some screenshots of examples of what you are getting and what is wrong and how it should be? The reflection's distortion is dependent on the location on the mirror-ball, so some pictures would help. Maybe there is some quick solution to this. – Jaroslav Jerryno Novotny Sep 24 '18 at 14:00
• Question edited. Hope now it is clearer what I am trying to do. – Miguel Sep 27 '18 at 9:16