The first thing I did however, was to increase the size of the objects. In the last blog there are some screenshots of the scalings I used - values like 0.005. I did this so I could zoom out far enough without the objects disappearing out of the matrix. I've done some experimenting with making the matrix larger though, and now the objects are scaled to a size easier to manage.
As a result I have implemented a seperate distance scale for the outer planets - this was done simply by adding another scalefactor variable. I'm not sure how I'm going to use these two seperate scales yet, but it's useful to have the option.
Finally, the main thing I've been working on is getting some text to display the Julian date. This should increase as the planets move around. I've also worked on converting the Julian date back into a regular (Gregorian) date format, and displaying that too.
The text strings that will be output are defined at the top of the DrawSolarSystem class. They're pretty simple, and look like this:
Drawing numbers that update, like the julian date and regular date, is a slightly different process, to start with anyway. Defined at the top of the DrawGLScene method, I used a function called gcvt to convert the numbered variables into strings, so that they can be displayed in the same way as the text strings. Here's the code:
And here is a screenshot of what the screen looks like:
Very fetching text I'm sure you'll agree! The Julian date updates nicely, although the more observant may notice that the julian date and regular date don't match. Only the year seems to be updating in the date. There seems to be a problem somewhere in the date calculations, but I'm not sure where yet. The program seems to be starting on the 2nd of December 2004, despite being coded to start on the 1st January 2004, so there's obviously a problem somewhere. I'll try and address this before next weeks blog.
That's all for this week. I've got lots of other coursework due in for next week, so I can't see next weeks blog being all that long either!
No comments:
Post a Comment