# [Original] image programming in actionscript3 games)

Source: Internet
Author: User

2.2.4 projection angle conversion from Photoshop to flash

Next, the Photoshop opacity option is the projection angle. The default value is 120 °, while the angle in Flash is 45 °. The difference between the two is nearly 90 °, but the projection angle is similar. Why? Let's set the projection filter of flash to 120 °. (Fig. 2.20)

Figure 2.20 flash projection with an angle of 120

The projection goes to the left, and the X direction is opposite to the projection position in Photoshop. It is observed that the angle of the flash projection is exactly the same as that of the coordinate system of ActionScript. It is equal to the angle between the current direction and the horizontal line. The clockwise direction is positive and the clockwise direction is negative.

I did not come to the conclusion from these two perspectives alone. I did this after I tried 360 degrees, however, it is unlikely that I will post all the results from 360 angles. Otherwise, I will not be able to post all the 100 pages. You can try it on your own.

The angle logic of Photoshop is a little complicated. It does not directly represent the position of the projection, but the angle of the illumination. In addition, the coordinate system is opposite to that of ActionScript, And the Clockwise is negative. The projection will fall in the opposite position of the light direction (according to the linear propagation principle of the Light, figure 2.21). Therefore, the angle between the Projection Direction and the horizontal line is equal to (projection angle * (-1) + 180 degrees + 360 degrees) % 360 °. (+ 360 ° then the remainder is used to ensure that the angle value ranges from 0 ~ Within 360)

Figure 2.21 principle of linear propagation and projection of light

Place 120 ° into the upper formula and obtain the final angle = (-120 + 180 + 360) % 360 = 60 °.

Therefore, flash should set the angle to 60 ° to ensure that the effect is consistent with that of Photoshop. (Fig. 2.22)

Figure 2.22 flash projection with an angle of 60

It can be seen that their actual angle is only 15 degrees different, but this subtle difference has a great impact on appearance. After 60 degrees, due to the wide gap between projection and text in the Y direction, the visual appearance of the text is more prominent and the three-dimensional sense is stronger.

Since photoshop has multiple styles used to create a three-dimensional effect (such as projection, slope relief, luster, etc.), the final colors they output are related to the light direction, therefore, there is a "Use global light" check box on the right side of Photoshop projection style settings. When this box is checked, these styles share the illumination of the same angle (any change to one of them will automatically follow the adjustment ), this ensures a better fit between multiple styles.

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.