[Fix] Fix orientation of star glow.
This commit is contained in:
parent
6131753132
commit
311bb6e24c
Binary file not shown.
Before ![]() (image error) Size: 3.1 KiB After ![]() (image error) Size: 20 KiB ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 1.2 KiB After ![]() (image error) Size: 57 KiB ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 1.2 KiB After ![]() (image error) Size: 14 KiB ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 1.1 KiB After ![]() (image error) Size: 22 KiB ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 1.5 KiB After ![]() (image error) Size: 21 KiB ![]() ![]() |
Binary file not shown.
Before ![]() (image error) Size: 798 B After ![]() (image error) Size: 15 KiB ![]() ![]() |
10
src/star.cpp
10
src/star.cpp
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user