Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating diminishing size in perspective

I'm trying to figure out a formula on how to calculate the size of a distant object at a viewing pane closer to me. I'm sure I had this in high school, but I couldn't find any resources on what the correct calculation is.

I found the following page explaining the correct way to DRAW such a thing, but I don't see a fomula (e.g. size of object, distance): Calculating diminishing size in perspective. I also know I can calculate the angle of view, like shown in this angular size calculator - however this assumes a triangle, not a rectangle.

Pictures are worth more than words, behold for my drawing skills: Mind boggle

Explanation: How would I go about and calculate the size of the target, when looked at from the viewing pane (marked red). When you look through the scope, the target sure looks a lot smaller - how much smaller in terms of size/relation?!
Is it as simple as dividing 30cm/1000cm to know the size of the target at a distance of 10m? Don't I have to do some sin/cos kung-fu? What about the scope of 2cm, assuming it is my entire field of view - it surely must go somewhere in the equation.

I'm not trying to reinvent the wheel here and all ego shooter do this already automatically, but I just can't figure out a reference to the correct formula, some pointers? I'm looking for the size of the target in the scope, either in absolute numbers (5mm) or in relative numbers assuming the scope is 100% of the field of view, the target will take up 1/10th of the scope's field of view.

like image 756
Dennis G Avatar asked Nov 24 '10 15:11

Dennis G


People also ask

How is perspective calculated?

P=f(X). It has the property that points are mapped to points and lines to lines. However, parallel lines in three space which are not parallel to the drawing plane must be drawn to converge at their vanishing points.

What is diminishing size in art?

The easiest way to depict depth in a two dimensional artwork is with diminishing scale. The simple principle at work with diminishing scale is this: things that are larger in the work appear closer to the viewer, and things that are smaller appear farther away.

How do you draw a scale in two point perspective?

Step One: Define the horizon line and the vanishing points. Step Two: Draw the corner of the object in between the vanishing points. Step Three: Draw lines from each end of the corner to each of the vanishing points. Step Four: Draw parallel, vertical lines to indicate where the object ends.


1 Answers

No trig but to do it properly you will need Pythagoras.

See the scaling at the end of: http://en.wikipedia.org/wiki/3D_projection#Perspective_projection

You scale according to ratios of distances from the eye to the screen (assumed to be a constant), and the distance from the eye to the object being drawn. This latter measurement is calculated with Pythagoras (the hypotenuse of the triangle formed by your 10m and 30cm, ie. Sqrt(10*10+0.3*0.3)

Note that by changing the eye to screen constant, you effective change the focal length of your 'camera'.

like image 182
winwaed Avatar answered Sep 30 '22 00:09

winwaed