Showing posts with label orrery. Show all posts
Showing posts with label orrery. Show all posts

Wednesday, 9 February 2011

Week 20 - User Interaction

Following a short break, it's back to work on the Honours Project. I'm aiming to have the program fully finished by the end of February, the features I'm aiming to improve/add are:

  • More user interaction. This has been partly addressed this week.
  • Improve lighting and shadows. Currently the planets don't have a 'dark side' where the Suns light doesn't hit them. I've no idea why this is as the lights are set up in the centre of the Sun, so I may not be able to solve this.
  • Implement pop up menus. All the user interaction is keyboard and mouse based at the moment, and there's too many functions going on to have them all implemented by a key press - I want to move some stuff over to menus, and also include a pop up with control details for the keyboard functions.
  • Rotate planets as they orbit. Currently the planets aren't rotating as they move, and implementing this has proved more difficult than I first thought it would be.
  • Improve movement controls. This is the least important update, so it may get cast aside if I run out of time, but I would like to improve the way the user moves around the 3D solar system - it's not brilliant but it works, so I wouldn't be too worried about leaving it if need be.

So onto the improvements in the user interaction that have been added this week. The major cosmetic change is the addition of a speed control. I had previously attempted to add this in using a variable called speedFactor which was adjusted everytime the user pressed a key - but could not get it to work. I solved this by moving the code which updates the julian date:


   julDate += (0.1 * speedFactor);

from the updateMercPosition function that it was in, into the main myDrawGLScene method, which fixed the issue of the speedFactor variable not being updated by a user key press. Now whenever the user presses 'm' the speed is increased (to a maximum of 25x), with n decreasing the speed (minimum of 1x). The program launches in 1x speed, and can be increased by the user to 25 times the launch speed. The speed is displayed on screen, beneath the two date displays like so:




The second piece of functionality that has been added is the ability for the user to increase the size of the individual planets. This was something discussed in my last meeting with Rob, and I decided that in order for the user to get a good look at the models (especially the smaller inner four planets) without lots of zooming and panning, this would be a great feature to implement. At the moment, only the planet Earth has this fucntionality coded, and it is controlled by the 'u' (to increase size to a max of 8x the original) and 'i' (to decrease size) keys. This is a feature I intend to move to the menu system, simply for the reason that I will run out of keyboard keys if I use two per planet. In order to code this, I introduced a variable earthSize, which is controlled in a similar way to the speed variable, increasing or decreasing the variable on a key press. I had to move the scaling function for the model from InitGL, where it was located in the display list, into myDrawGLScene, in order for it to update correctly whilst the program is running.


The final piece of functionality that I added this week was scaling the distances from the Sun. There are two options for the user in this case - they can increase/decrease the distance of the inner four planets from the Sun (currently using the 'f' and 'g' keys) or increase/decrease the distance of the outer four planets from the Sun. This gives the user the option to see the planets bunched in much more closely than the correct scale that the program launches in. This is controlled by two variables - innerScale and outerScale, with a default setting of 16 (purely for aesthetic reasons, although this could change). The positions of the planets that are defined in earth Update..Position method are multiplied by these variables, which are increased or decreased by a key press. The increase value for both variables is limited to 20, whilst different limits are applied for the inner and outer decrease values - in the inner case, so Mercury does not disappear into the Sun model, and in the outer case, so Jupiter and Mars' orbits don't collide.
The image below shows the outer planets decreased to their lower limit, Jupiter appearing very close to the inner four planets.


That's all for this week.

Sunday, 10 October 2010

Blog Week 1 - Direction

The first decision that I need to make in undertaking this project is which direction I would like to take the project in.

The coding language I have settled on is C++. Programming in this language means I can interact with OpenGL far easier than I could in other languages, such as Java. The orrery program should allow the user to view the planets orbiting the Sun initially from the furthest point out, with the option to zoom and view the other planets. Intial timescale should relate to a day passing every second, but the user will have the option to increase this in order to see the planets orbit at a higher speed. 

I am unsure yet as to how many moons I will include in this program. Initially I had thought to include only moons with a radius greater than 1000km - this gives me 16 planetary bodies in the system:
  • The Sun
  • Mercury
  • Venus
  • The Earth
    • The Moon 
  •  Mars
  • Jupiter
    • Io
    • Europa
    • Ganymede
    • Callisto
  • Saturn
    • Titan
  • Uranus
  • Neptune
    • Triton
This means that none of Mars' or Uranus' moons and only one of Saturn's and Neptune's would be included. This is something I will need to discuss further with my supervisor before making a cast iron decision. I do not think that the dwarf planets (such as Pluto) will be included, but as I say this is something I need to discuss and return to.


The following is a list of programs that I intend to use during this project:
  • Microsoft Visual Studio 2010 - for C++ programming
  • Autodesk 3Ds Max 2011 - for modelling of planets etc
  • Microsoft Word 2010 - any necessary word processing
  • Adobe Photoshop CS5 - texture editing etc


I will be using this blog to keep track of any links with useful information that I feel may prove useful in the future of the project. Here are a few that I have come across during my intial research this week:

http://nineplanets.org/ - comprehensive information site on the eight planets (despite the name), their moon, dwarf planets, and various other small bodies in the solar system.


http://star.arm.ac.uk/~dja/planets.html - orbital positions of the planets, dating from January 2000 to projected positons in December 2019.

http://www.etsu.edu/physics/etsuobs/starprty/22099dgl/planalign.htm - information on Planetary aligments. I had initially thought that a "planetary alignment" would make a perfect starting time for the program, yet this seems more complex than I had first realised.

http://www.easytorecall.co.uk/orrery_simulation.htm - A very basic Javascript 2D digital orrery. Shows orbits of Mercury, Venus, Earth and Mars and their moons around the Sun.

http://www.gifford.co.uk/~principia/orrery.htm - Another very simple digital orrery. Shows all planetary orbits, but no moons. Also shows current position of planets.

Welcome

Welcome to my honours project blog.

This blog should contain weekly updates, detailing what I've worked on in the current week. I'll also post any links to interesting information or good websites that I've used to aid my development of this project.

The project I have chosen to do is to produce a digital orrery. An orrery is a mechanical device which demonstrates the planetary postions (with their moons) and orbits in the the solar system, an example is below:

 
My task is to reproduce this in a digital form on a computer.

Update on this weeks work coming up!