When you make a landscape, you may want to orient some part of the image towards North or some other bearing.

When you make a landscape, you may want to orient some part of the image towards North or some other bearing.

−

For '''spherical''' type landscapes (the formal name for this sort of panorama is a '''equirectangular''' panorama), you can use the following procedure for calculating the rotation needed. The rotation can be specified using the '''angle_rotatez''' setting in the landscape.ini file.

+

For '''spherical''' type landscapes (the formal name for this sort of panorama is a '''equirectangular''' panorama), you can use the following procedure for calculating the rotation needed. The rotation can be specified using the '''angle_rotatez''' setting in the landscape.ini file (note that this is only possible for version 0.9.1 and later. For older versions of Stellarium you must edit the image).

+

+

Consider the following panorama which is to be used as a landscape image:

http://porpoisehead.net/misc/calc_landscape_rot1.png

http://porpoisehead.net/misc/calc_landscape_rot1.png

Line 12:

Line 14:

where:

where:

−

*b is the bearing you want to have the chosen object, in degrees. Use 0 for North, 90 for East etc.

+

*'''b''' is the bearing you want to have the chosen object, in degrees. Use 0 for North, 90 for East etc.

−

*x is the distance in pixels from the left side of the image to the object you want to align.

+

*'''x''' is the distance in pixels from the left side of the image to the object you want to align.

−

*X is the horizontal image size.

+

*'''X''' is the horizontal image size.

For example, here's the landscape image again, with some measurements:

For example, here's the landscape image again, with some measurements:

Revision as of 13:38, 2 December 2008

When you make a landscape, you may want to orient some part of the image towards North or some other bearing.

For spherical type landscapes (the formal name for this sort of panorama is a equirectangular panorama), you can use the following procedure for calculating the rotation needed. The rotation can be specified using the angle_rotatez setting in the landscape.ini file (note that this is only possible for version 0.9.1 and later. For older versions of Stellarium you must edit the image).

Consider the following panorama which is to be used as a landscape image:

In this image, there is a tree. Let's say you want this tree to appear at bearing 0 degrees in Stellarium (due North).

First, you need to calculate the distance from the left side of the landscape image to the tree as a fraction of the total image width, and then use these numbers in the following formula:

270 + b - ( 360 * x / X )

where:

b is the bearing you want to have the chosen object, in degrees. Use 0 for North, 90 for East etc.

x is the distance in pixels from the left side of the image to the object you want to align.

X is the horizontal image size.

For example, here's the landscape image again, with some measurements:

Putting the figures in the equation:

270 + b - ( 360 * x / X )
= 270 + 0 - ( 360 * 364 / 512 )
= 14.06

If the result is outside the range 0 ... 360, you should add or subtract 360 to bring it into this range.

The figure of 14.06 should be put into the landscape.ini file like this:

Note that the landscape image I am using in the example will work, but it's not a very good landscape image, so you might want to try this with a better panorama.

The moon landscape which comes with Stellarium is a good one to practice on. As an exercise, apply a rotation to the moon landscape, having the astronaut due South (the astronaut who is in the distance, not the shadow in the foreground).