Rotation matrix will magnify your manufacturer logos

Hi there,

I've recently came across Herbal's

Manufacturers logos and after my first thought that was "it's a great thing that will fit into my Packs" an idea came to my mind.

You know, it's rather time-consuming and kinda irritating process to make a decent logo situated exactly in front of the camera eye (in the "standing" position) manually. Actually, the easiest way to make logo is to make it flat, with Y coordinate set to zero (roughly). That's just how, for example, already mentioned Herbal's logos were made, then in the main menu they look flat.

Despite their flatness, they surely make a very worthy addon. However, with use of some basic linear algebra, every logo, including these you might want to create in the future on your own, might look even better.

In order to raise a flat logo to make it stand as it should, you need to find a suitable linear map. In this case, we need to (some spatial imagination required

) rotate the logo by 45 degrees in the Y=0 plane (names of axis might be confusing, Car Editor doesn't use the standard basis of the 3-dimensional linear space, so directions are different. Briefly speaking, X - width, Y - height, Z - length) and then rotate it again by 45 degrees around

**x=-z** line. Yay, now our logo lies on the plane defined by equation:

**x+y+z=0** (with normal vector

**(1, 1, 1)** pointing at the camera eye).

Now it's time to find a matrix of this map. I did it already and it looks like this:

**Code:**

| 0.7 0.5 0.5 |

M = | 0 0.7 -0.7 | (where 0.7 comes from sqrt(2)/2 = 0.707, roughly)

| -0.7 0.5 0.5 |

It's called rotation matrix. What can we do with this? Let

**v=(x, y, z)** be vector representing a vertex, with its XYZ coordinates. And

*every kid knows* that if we multiply

**M*v** we will get an output vector representing our output vertex. For example:

**Code:**

| 0.3 | | 0.7 0.5 0.5 | | 0.3 | | 0.4271 |

v = | 0.03 | M*v = | 0 0.7 -0.7 | | 0.03 | = | -0.2616 |

| 0.4 | | -0.7 0.5 0.5 | | 0.4 | | 0.0029 |

So the vector

**u=(0.43, -0.26, 0)** is the image of

**v** in our linear map (the rotation). Follow this procedure with all of your remaining vertices and you'll get a beautiful, standing logo

And the final comparison:

Attachment:

logos.png [ 3.34 KiB | Viewed 9075 times ]
EDIT:

Actually, leaving 0.707 instead of sqrt(2)/2 was not very wise either, 0.7 will do the work with the same effect, so you know what to do.