Report word count: 4150
I have still been writing the implementation section this week. I have written about the vector class, the first model loading stages and implementing the orbital calculations to get animation. I've been having a slight problem, in that I am not sure whether it is best to discuss the implementation in a linear fashion, as in when I coded them, or discussing things in a class by class basis. What I've settled on so far is a mix, discussing small classes like Vector3D and CreatePlanet on their own, but breaking down the main DrawSolarSystem class into seperate discussions like Model Loading and Animation.
I'm finding loads to write about in this section, and I think it will end up the longest section in the report by far.
No word back from Rob on the draft I sent in last week, hopefully that means its not too bad! I'm sure we'll discuss any issues with it in the meeting tomorrow.
That's all for this week.
Wednesday, 30 March 2011
Wednesday, 23 March 2011
Week 26 - Report.3
This week I'm up to about 2,800 words in the report.
I've finished the research section - it's 1668 words, and I'm currently writing the implementation section. I'm going to send a copy of the report so far to Rob tonight, so he can give some feedback on my writing style and correct any issues there may be with it!
Hopefully I'll be able to finish the implementation section by next week, although I've only written about two classes and I'm already over 1,000 words so it could be quite a long section.
I've finished the research section - it's 1668 words, and I'm currently writing the implementation section. I'm going to send a copy of the report so far to Rob tonight, so he can give some feedback on my writing style and correct any issues there may be with it!
Hopefully I'll be able to finish the implementation section by next week, although I've only written about two classes and I'm already over 1,000 words so it could be quite a long section.
Thursday, 17 March 2011
Week 25 - Report.2
Still writing the report!
I've got the cover pages and contents sorted, and I've made a start on the research section - I've wrote about 1,200 words so far, and I'm hoping to get to at least 2,000 in this section, if not more.
Another exciting report update next week!
I've got the cover pages and contents sorted, and I've made a start on the research section - I've wrote about 1,200 words so far, and I'm hoping to get to at least 2,000 in this section, if not more.
Another exciting report update next week!
Friday, 11 March 2011
Week 24 - Report
The blogs will be a lot shorter now, as I'm just using them to record my progress as I get this report done! I'm aiming for somewhere around 10,000 words, and here's the initial report structure (subject to change):
1. Introduction
2. Requirements Analysis
3. Research
4. Design
5. Implementation
6. Testing
7. Conclusions
8. Reflections
Appendices
A. References
B. Initial Project Brief
C. Extra Program Screenshots
D. Selected Code Sections
E. Presentation Slides
F. Project Log
I'm planning on getting started this coming week, likely on writing the research section.
1. Introduction
2. Requirements Analysis
3. Research
4. Design
5. Implementation
6. Testing
7. Conclusions
8. Reflections
Appendices
A. References
B. Initial Project Brief
C. Extra Program Screenshots
D. Selected Code Sections
E. Presentation Slides
F. Project Log
I'm planning on getting started this coming week, likely on writing the research section.
Sunday, 6 March 2011
Jupiter Planet View
I made a short video demonstrating Jupiter's planet view option, check it out at:
http://www.youtube.com/watch?v=ldHQ8yLYRLc
The video demonstrates two orbits of the Sun, you can see it passing the Sun and the inner 4 planets, and Saturn on it's second orbit.
http://www.youtube.com/watch?v=ldHQ8yLYRLc
The video demonstrates two orbits of the Sun, you can see it passing the Sun and the inner 4 planets, and Saturn on it's second orbit.
Thursday, 3 March 2011
Week 23 Continued - Planet View images
Please check the previous blog for a technical summary of this weeks work!
Here are some images of the planet views that I implemented this week, and a final program shot. Click to expand images. The Saturn view is my favourite, be sure to check them all out!
Here are some images of the planet views that I implemented this week, and a final program shot. Click to expand images. The Saturn view is my favourite, be sure to check them all out!
Shot of the final program, defualt planet sizes and distances (they're hard to spot!)
Shot of the final program, expanded model sizes and distances decreased
Mercury, default size
Mercury, largest size
Venus, default size
Venus, largest size
Earth, default size
Earth, largest size
Mars, default size
Mars, largest size
Jupiter, default size
Saturn, default size
Saturn, largest size
Uranus, default size
Neptune, default size
Labels:
Earth,
Jupiter,
Mars,
Mercury,
Neptune,
planet view,
Saturn,
screenshots,
Uranus,
Venus
Wednesday, 2 March 2011
Week 23 - Planet View and Completion!
This week was the deadline I had set myself to complete the program, so - have I managed it?
Just about! I still have a couple of tweaks I want to make, and clean up some code, but effectively the program is now fully functional and as advanced as I am going to make it.
I've changed quite a bit this week, cleaning a few things up - I've implemented arrays in several places where I had lists of variables for each planet, and completely reworked my planet rotation method to fix an error where the planet would stop if the speed became too great. The main addition this week though is the implementation of "planet views", an option on the menu which allows the user to focus the camera on one planet, and the camera will follow along as the planet orbits the Sun.
Firstly, the arrays I've implemented. I've replaced four variable lists with arrays:
Previously there was a model variable for each planet, a size variable for each planet etc, but using an array instead cleans things up greatly, and hopefully improves the program speed a little as well. Example: mercSize is now size[0], venSize is now size[1] etc.
Now, onto the planet rotation. The problem was that the rotation value is given by the rotation amount times the speed factor. When that equals 360, the planet stops spinning. Example: Earths rotation amount is 18 degrees. When the speed factor is increased to 20, the rotation amount is 18x20 = 360, so the planet appears to be still when the speed of the program is at 20 times. Since each planet reaches it's fastest speed when the rotation amount = 180 degrees, I simply worked out when this was for each planet and stopped increasing the rotation amount at that point. It's all explained in the method comments, here it is:
Finally, the planet views. To implement these I had to create 8 new methods in the DrawSolarSystem class - one for each planet, called mercuryView(), venusView etc. I also had to modify the camera controls to use gluLookAt, so I could focus the camera on a position.
So, in each view method I set the camera's position, and the camera's focus, using the X,Y,Z coordinates of each planet. For the cameras position, I had to move it slightly off the X,Y,Z of the planet so you could see it - I perfected each position by assigning a 'test' variable to be added or subtracted to the Y or Z, and controlled the increments with the keyboard. These keyboard controls are now commented out, and I replaced the test variables with an actual number once I'd gotten the best camera position. I also had to set certain booleans to false so they did not affect the camera. Here is an example of the mercuryView method:
The next step was to add this method into the DrawGLScene method. Since i wanted this view to be activated when a menu option is selected, a boolean trigger is required to be set to 'true' in order for the view to be shown.
Finally, in the menu responder I simply set the boolean for the planet view I want implemented to true (in this case Mercury), and all the rest to false.
I've also included an option to return to the default view, which simply resets the camera and loops through the planetView array, setting all the booleans to false.
I'm going to post a blog following this one, with screenshots of all the planet views.
Save for some minor tweaks, thats the program pretty much finished. I'm really pleased with the end result, and delighted I've been able to implement all the features I wanted to in the desired timeframe. Onto the report!
Just about! I still have a couple of tweaks I want to make, and clean up some code, but effectively the program is now fully functional and as advanced as I am going to make it.
I've changed quite a bit this week, cleaning a few things up - I've implemented arrays in several places where I had lists of variables for each planet, and completely reworked my planet rotation method to fix an error where the planet would stop if the speed became too great. The main addition this week though is the implementation of "planet views", an option on the menu which allows the user to focus the camera on one planet, and the camera will follow along as the planet orbits the Sun.
Firstly, the arrays I've implemented. I've replaced four variable lists with arrays:
Previously there was a model variable for each planet, a size variable for each planet etc, but using an array instead cleans things up greatly, and hopefully improves the program speed a little as well. Example: mercSize is now size[0], venSize is now size[1] etc.
Now, onto the planet rotation. The problem was that the rotation value is given by the rotation amount times the speed factor. When that equals 360, the planet stops spinning. Example: Earths rotation amount is 18 degrees. When the speed factor is increased to 20, the rotation amount is 18x20 = 360, so the planet appears to be still when the speed of the program is at 20 times. Since each planet reaches it's fastest speed when the rotation amount = 180 degrees, I simply worked out when this was for each planet and stopped increasing the rotation amount at that point. It's all explained in the method comments, here it is:
Finally, the planet views. To implement these I had to create 8 new methods in the DrawSolarSystem class - one for each planet, called mercuryView(), venusView etc. I also had to modify the camera controls to use gluLookAt, so I could focus the camera on a position.
So, in each view method I set the camera's position, and the camera's focus, using the X,Y,Z coordinates of each planet. For the cameras position, I had to move it slightly off the X,Y,Z of the planet so you could see it - I perfected each position by assigning a 'test' variable to be added or subtracted to the Y or Z, and controlled the increments with the keyboard. These keyboard controls are now commented out, and I replaced the test variables with an actual number once I'd gotten the best camera position. I also had to set certain booleans to false so they did not affect the camera. Here is an example of the mercuryView method:
The next step was to add this method into the DrawGLScene method. Since i wanted this view to be activated when a menu option is selected, a boolean trigger is required to be set to 'true' in order for the view to be shown.
Finally, in the menu responder I simply set the boolean for the planet view I want implemented to true (in this case Mercury), and all the rest to false.
I've also included an option to return to the default view, which simply resets the camera and loops through the planetView array, setting all the booleans to false.
I'm going to post a blog following this one, with screenshots of all the planet views.
Save for some minor tweaks, thats the program pretty much finished. I'm really pleased with the end result, and delighted I've been able to implement all the features I wanted to in the desired timeframe. Onto the report!
Labels:
arrays,
booleans,
C++,
camera,
class,
loop,
menus,
orbits,
planet view,
rotation,
speed control,
spin
Subscribe to:
Posts (Atom)