[Fix] Fix orientation of star glow.

This commit is contained in:
Rtch90 2017-11-25 13:37:57 +00:00
parent 1c3691b15f
commit 0aee9d7036
7 changed files with 4 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -19,12 +19,10 @@ void Star::SetPosition(vector3d p) {
static void DrawCorona(double rad, vector3d& pos, const float col[3]) {
glPushMatrix();
/* Face the camera damnit! */
vector3d dir = vector3d::Normalize(pos);
vector3d d2 = vector3d(0, 1, 0);
vector3d d3 = vector3d::Cross(dir, d2);
d3.Normalize();
d2 = vector3d::Cross(dir, d3);
matrix4x4d rot = matrix4x4d::MakeRotMatrix(d3, d2, dir);
vector3d zaxis = vector3d::Normalize(pos);
vector3d xaxis = vector3d::Normalize(vector3d::Cross(zaxis, vector3d(0, 1, 0)));
vector3d yaxis = vector3d::Cross(zaxis, xaxis);
matrix4x4d rot = matrix4x4d::MakeRotMatrix(xaxis, yaxis, zaxis).InverseOf();
glMultMatrixd(&rot[0]);
glEnable(GL_BLEND);