Tuesday, 31 March 2009

Week 28: 30th march - 5th April: Problems Problems Problems!

I think I spoke too soon!!! It does not work!! It is back to working every now and again. Although the test that put the particle at different x and z values above the flat plane has resulted correctly. The only possible problem left that I can see may be the equation of the plane itself as it is the only thing I can think of that will change every time the program renders that will result in different outcomes each time.
Time to try that!!!!

Week 28: 30th march - 5th April: Progress Meeting

Today I had the very last Progress Meeting with Dr Ozveren (shown below):
-
Progress
-
Particle is falling perfectly and the calculations seem to be working correctly.
-
Next Step
-
To make the particle slide properly and fall after it leaves the plane. I may need to change the plane equation as it is for an infinite plane and with my current collision detection this means that the particle will never leave the plane. There the equation needs to be of a plane segment. Another possible step is to add more particles bouncing together and perhaps adding friction.
-
Problems
-
Was only bouncing correctly every now and again and this was due to a mix up with a letter! Absolute value does not work either but I do not think I will need it.
-
Dissertation
-
Underway - progress is slow but it will pick up once the programming is done which should be soon hopefully.
-
Changes
-
I have to just focus on this stage done - nearly is. Add more particles to the system although I need to run this past Dr Lucas to see if it is a possible option.

Monday, 30 March 2009

Week 28: 30th March - 5th April: Meeting and Possible Solution to Problem

Over the weekend, I have had problems with the bounce of the particle working correctly. Sometimes it would work and other times it seems to fail and either not hit the plane and bounce anyway, go through the plane and then bounce or even collide with the plane and then just move to a completely new position entirely. I was a little stumped by this and so tried to work out what could be causing the problem. I tried bouncing the ball on a flat plane and it worked. I then moved the x coordinate of the particle keeping all other coordinates constant, and this was perfectly correct also. The same was done for the y coordinate. It was fine. Last but not least was the z coordinate and it surprisingly did not work. There was nothing obvious in the code that could be causing this so I decided to investigate further. I then tried the plane rotations individually with the particle in its original position. All but the x rotation worked this time. Considering that the y and z rotations worked fine, I decided to use them both together as I thought if they are both correct then the concatenation of both of them will be correct also. This was not the case. This left me completely confused so I left it alone until today as I had my meeting with Dr Lucas.
When this was explained to Dr Lucas, he was very confused also. He asked me about my collision detection and if I was using the absolute value which I thought I was but turns out I am not. I got him to explain in to me again and he went over a few other things that I needed to look at just in case they were causing the problem. Once I got a chance to look at the problem today, I did all of this although I did get very confused with the absolute value and how I could use that for the collision detection. I emailed Dr Lucas again and he made his way down to the labs to help. We worked out the collision detection but if failed to work in this new method. We spent a while looking over the code and he had to leave before the problem was fixed. He just left it to me to debug the program to see where it might be failing. While he was helping however, Dr Lucas stumbled across a umber of little mistakes in my code which I fixed but of course could not check as the particle was not colliding correctly. Therefore, I decided to revert back to the collision detection I had before Dr Lucas helped for the time being as it worked and change the small mistakes that he had found to see if it would make a difference to my original problem. It seems to work correctly this way and so I have decided that I will spend the rest of today and most of tomorrow to see if I can get the absolute value working in the collision detection and if not I think I will just stick to the collision detection I had originally.

Sunday, 29 March 2009

Week 27: 23rd March - 29th March: Weekend Progress

The last few days have been very bitter sweet. While all the problems were fixed and the new motion was implemented, I did encounter more problems along the way. I eventually got the correct motion, or so I thought. At this point in time, the particle bounces correctly every now and again. So far I do not see a pattern in the problems. I did try each rotation individually and it seems that for the x rotation and the y rotation of the plane, there seemed to be no problems. However, the z rotation did not work. I then tried the concatenation of the x and y rotation which in theory should be fine as the x and y rotations work individually. This was not the case however. I then tried the position of the coordinate itself by making the plane flat. The bounce worked correctly again for changes in the x and y coordinates. Again, the z coordinate when changed, caused the particle to move to a position quite a bit below the plane. So far, I am completely confused as to what the problem could be as the results at the moment are varied. I have a meeting with Dr Lucas tomorrow and so I will have a talk to him about what the problem could be. So stay tuned.
Next steps (once the problem I have just now is fixed) is to make the particle slide down the plane once it has stopped bouncing, to make the particle fall under gravity once it leaves the planes surface and to make the particle fall with a velocity falling at an angle.

Thursday, 26 March 2009

Week 27: 23rd March - 29th March: Help

Over the last couple of days, I have had trouble with the programming of the project. There have been a number of problems encountered and so I decided to ask Dr Lucas for help. The first problem was with the collision detection. When the particle was falling and it hit the plane, it passed right through the plane. I had the collision detection set as checking whether the particle lay on the plane by putting the coordinates into the plane equation and if it equals zero then collision happens. However, as Dr Lucas pointed out, the particle moves under time and so moves under small increments of position and so it may not hit exactly on the plane. Therefore, I have to allow for some error below the plane. Another problem I had was that I was not sure whether the impact equation (ie. V = U - (1+E)(1-F)(U.uNormal)uNormal) was implemented correctly. I found out I was doing the cross product for U.uNormal instead of the dot product. I was also confused about the derivation of the angle at which the particle rebounded. I did not know whether this would be found simultaneously as the position and velocity or the rebound is found or whether it would need to be calculated with perhaps the equation a.b = abcos(angle). As I had not implemented the parabolic making equations yet, I was not to sure. Dr Lucas explained that the equations after the impact would describe the correct bounce of motion. After all this, I felt a lot better and I set off to fix the problems and implement the new equations.

Tuesday, 24 March 2009

Week 27: 23rd March - 29th March: Progress Report

Although I did not attend this meeting in person as I am ill, I have attached my progress report.
-
Progress
Rotation is completely fixed and the particle is falling under gravity correctly (i think)
-
Next Step
Make it collide with the plane as the detection is not working as of yet
-
Dissertation
Still slow in this area however, work is being done to it as much as possible.
-
Problems
Collision detection going to see my supervisor as soon as possible.

Sunday, 22 March 2009

Week 26: 16th March - 22nd March: Week in Review

So far, the program has the particle falling properly (i.e. gets faster as it falls, starts from rest etc.) At the moment, I am working on the collision detection and then the resulting motion following that collision.
-----------------
Below are reference links to some of the resources I have used recently:

---------------------------------------

I forgot to add a post last Tuesday about my most recent progress meeting therefore I have attached it below

-
Progress
not much done since the last time. Sorted the rotation, added matrix/vector class for all my calculations to come. Particle is falling under gravity, bouncing of the surface not correctly as of yet. Not done full testing as to why this is so.
-
Next Step
Fix problems. Make the particle move correctly (like parabola). Got equations/theory from
meeting with Dr Lucas.
-
Dissertation
This is still in the early stages as I am on the Literature Review.
-
Problems
Rotation - matrix addition
-
Changes
Talked to Dr Lucas who said that getting this stage done will have to be the focus now.
-----------------------------------------------------------------------------------
While at the progress meeting, we were given the dates for some of the hand-ins, shown below:
Presentations - 5th/6th May - marked by Dr Ozveren and Dr Lucas
Dissertation - 20th May - Dr Lucas and Dr Paris
Showcase - 22nd May - not officially marked but could be used as decider
Execution of the project - Lucas and moderated by Ozveren

Monday, 16 March 2009

Week 26: 16th March - 22nd March: Meeting

The meeting today was productive. I did not have a program to show Dr Lucas but I did let him know what had been done. The plane now rotates correctly. I did have a problem over the weekend where the plane rotates correctly in the x axis but not in the y and z axes. I tested the calculations on paper and the numbers did not work out correctly. I found out later that the problem was that OpenGL calculates matrices by column major instead of row major which is done when written on paper. I need the bounce to work properly now. Dr Lucas and I have also talked about starting the writing of the dissertation and also the future of the programming. He has explained to me in detail the next stage of the program which is to make the particle bounce in a parabolic motion. Equations shown below:
-------
  • XPosition = XVelocity x time
  • YPosition = YVelocity x time
  • ZPosition = ZVelocity x time

and

  • Velocity = previous Velocity + (gravity x time)
--------
He also told me to now focus on just getting this stage done now and not to worry about the other stages yet. I may have to ask him at the next meeting whether or not this will affect my project at all i.e. grade etc. He also talked about how I must remember the other coursework and especially the exam as it is worth the same as the dissertation.
-----------
Plan:
  • Start dissertation
  • Finish stage one as soon as possible
  • New Gantt Chart

Tuesday, 10 March 2009

Week 25: 9th March - 15th March: Group Meetings and Schedule

Today we had group meetings with Dr Ozveren to discuss our progress. Below is my progress report which I did in preparation for today's meeting. Included at the end is an up-to-date gantt chart.
Progress Report
INTRO:
My Project is entitled 'Realistic Modelling for Motion Involving Collisions with 3D Environments' and I am looking into how basic 3D movements can be simulated realistically and at what point the calculations need to be approximated so that processing speed is not compromised too much.
Project implementation has been broken down into four main areas. Stage 1 - point mass bouncing on an inclined plane. Stage 2 - point mass bouncing on a curved surface. Stage 3 - sphere colliding with an inclined plane. Stage 4 - sphere colliding with curved surface.
PROGRESS SUMMARY
So far, the project is still in its first stage although it is close to being finished. At the moment, there is an inclined plane in the scene with the point mass falling and bouncing off. to finish this stage, all that needs to be done is some more calculations and some extra calculations involving friction and bounciness. Once this is complete the project will proceed into the next stages. So far for the dissertation, the literature review has been started but it is not near completion as of yet.
PROBLEMS
The problems encountered so far have really come down to time. I have spent more time than expected working through how the maths can be put into OpenGL. It has also been made clear that I spend to much time bogged down on one tiny aspect of a calculation. e.g. I spent days working out what was wrong with the rotation of the plane in the x and z axes and this was completely unnecessary as it was not an important part of the project at all. Not to sure if I do that maybe to unconsciously avoid moving on to more tricky tasks. I have also spent time worrying about whether I am doing calculations correctly without just simply going to see my supervisor.
CHANGES
Looking at my original gantt chart, I should be starting stage 4, so it looks like I am miles behind. However, the original gantt chart does seem a little too optimistic and there was too much time scheduled for testing etc. which when I look at it now, can be done as I go along (and probably should be because then it will be clear what calculation is at fault.) A new gantt chart has been made, this time without time specified for extra work as I know now there will be no time for this (at least no time to do it well) so just need to focus on getting stages 1-4 done well.
OVERALL ASSESSMENT
The project, at the moment is behind, however even though it has taken longer than expected to complete stage 1, most calculations will be repeated in the later stages so I do think it is best to take time now to get them right. Worst comes to worst, I may have to leave out stage 4 also, but this is not too big a problem. Learning from mistakes made already and what I know about myself and how it does take me longer to do things than others, I just need to focus on getting work done every day from now on.

Saturday, 7 March 2009

Week 24: 2nd March - 8th March: Week in Review

Work done this week - I have gotten stuck into the plan and so far I have added a FPS and in turn I believe I know how to use the timer. Next on the list of to dos is to fix the rotation and add the matrix class. This will not only help with the rotation but also calculations later on.

Monday, 2 March 2009

Week 24: 2nd March - 8th March: Meeting

I had a meeting this morning with Dr Lucas. I showed him what I had, along with all the problems I have had. He agrees that the program needs a timer and he suggested that the rotation problem could be sorted using the equation set out in the formula booklet. He told me to just keep focused on getting the particle bouncing of the inclined smooth plane first and that I 'should not run before I can walk' as I tend to over-think things too much, which is a recurring bad habit of mine. He also walked me through the maths and physics behind the bounce again.
-------
Plan:
  • Fix rotation by adding matrix class
  • Add timing code
  • Make particle fall under gravity
  • Make the point into a line so easier to see
  • Calculate resultant motion correctly

*Show Dr Lucas *