Sunday, August 19, 2012

Pencils down tomorrow (updated)

Thanks to my mentor Alexander Wolf, and Stellarium. The hard pencils-down date is tomorrow, so I'll clean up the code, add documentation, and do some last minute edits, then push the finalized branch tomorrow when I have a better Internet connection. Will post a link to that branch here.

The promised deliverables were pretty much met:
- Added comets to ssystem.ini
- Instead of control in Sky Tab, on Alex Wolf's suggestion, made functions for users to script and thereby control the tail/ coma appearance. Scripting is easy though, and I also provided an example script comet_control.ssc
- Drew plasma tail and dust tail realistically. However, implementation for dust tail can be improved in the future to be physically realistic.

Future:
- Was unable to do the optional deliverables (nucleus split, sun collision) during this time frame.
- To improve dust tail (and coma if needed)
--> Dust tail's drawing is not physically accurate, for now just looks feasible. Have to project fan-on-a-plane dust tail into 2D coordinates on the screen
---> after that, may need to implement coma-specific function

Misc notes:
- Overestimated what could be achieved within the time frame. Had school and exams during Community Bonding Period and first 3 weeks of GSoC, then last 2 weeks of GSoC.
- Changed implementation several times; the final solution was usually a lot simpler and different from what I thought it would be in the proposal
- Took some time to get familiar with code base, working in a large project, and using Bazaar
- Took too long on one bug, went the wrong route, spending 1+ months trying to even put something on the screen correctly

Comet control script videos (updated)

As demonstrated in the screencast below, the user can write scripts to:
1) control the coma size,
2) return to the default coma size,
3) increase/ decrease the plasma tail length,
4) increase/ decrease the dust tail length.

(View in full screen)


Note:
- The coma, dust tail and plasma tail size was enlarged so that it's easier to see in the video. The actual code makes the comet a lot smaller. For example, the currently only possibly visible-tails comet, P/2005 K3 (McNaught), which is less than 1.0 AU from the Sun and therefore the solar heat is enough to melt the ice for us to see the dust tail. (see below video for actual representation)
- At other times, the dust tail and plasma were more distinct from each other, but from this angle they overlap.

Video of actual size in Stellarium
How you would see it when the sizes are not artificially enlarged for debugging purposes:

(View in full screen)


Here are the public slots (a kind of Qt-unique functions) that are available from the CometMgr class:
void setDefaultComaSize()
Revert current coma size to the default size.
void plasmaTailLengthMultBy(float factor)
Multiply current plasma tail length by "factor". Not allowed to be negative number.
void dustTailLengthMultBy(float factor)
Multiply current dust tail length by "factor". Not allowed to be negative number.
void comaBurstTo(float new)
Set the coma size to "new". Note, the more negative, the larger the coma will be. Limited to -50 < new < 50
float getDefaultComaSize()
Get default coma size for when you want to adjust the coma more realistically according to how much you change the tail lengths

Future possibilities:
Illustration of nucleus split and collision with Sun.
But first, I would have to improve the tail rendering to be more physically realistic and clear bugs.

Friday, August 17, 2012

How to make the dust tail realistic?

In an old model, I got the 3d coordinates of the dust tail, then projected it to the 2d screen. This is because the dust tail in reality is considered to be on a plane, so viewed from different angles, it could either look like a line or a fan. (Note the oval was supposed to be a substitute coma for the time being)




Unfortunately, it didn't look realistic like the pictures online:


If I used a similar method to the plasma tail, however, it looked more like the pictures (from zoom in to zoomed out, view from Earth):



Tuesday, August 7, 2012

Plasma tail





Somehow coded the plasma tail to rotate. First it was written to be a cone, but this was too thin and unrealistic... you couldn't see the coma. Then I changed it to a frustum, and it turned out like this. And because it was rotating, there is a continuously changing streaky effect.

what I mean by unrealistic when a cone:





Sunday, August 5, 2012

Working backwards, Comets to Sun



Found out that my initial getting of coordinates of comet and Sun was wrong, and they needed to be projected onto the 2d screen from their Right Ascension/Declination coordinates. Now, finally, the coordinates are correct. I drew a line from comet to Sun so that it would be obvious where the coordinates are.

Another issue was getting the Sun's coordinates, because in Planet.cpp and Comet.cpp, to a comet, the Sun's coordinates would always be (0., 0., 0.), which on screen is at the bottom left. So I had to get the Sun from Stellarium's SolarSystem via GETSTELMODULE.

With this, I have to rewrite the plasmaTail() and dustTail() functions, but it should be fairly fast now that the bug I couldn't get rid off is out of the way.

Process: