• Content count

  • Joined

  • Last visited

Community Reputation

160 Neutral

About StratfordCanning

  • Rank
  1. How to calculate polyhedra in realtime...

    Have a look at this, I think it is what you want!  Basically I make a tetrahedron of tiles and then split each one along the longest side and project the new corners onto the surface of the shape (in this case a sphere, but it could be anything).  The algorithm stops when the side length of the triangles gets less than a pre-defined setting.  The meat of it is in SplitTile and SearchforSurface (these work on the body object to tell it what its new tiles are). I then inflate the sphere to get the bouncing effect, but you wouldn't do this so you don't need to worry about what happens next.   I am looking for work so if anyone sees this and likes it, give me a shout.  I am a native English speaking database person in real life.  Farting round with games and physics is for fun. From poking around on here it seems like a heartbreaking way to make a living!   Steal away, all my work apart from the bits I have acknowledged, please acknowledge me in return.
  2. Steps on How to Become a game Developer

    Morning all!   JackB   Maybe not deliberately rude or negative, but some if it came across that way I think. It is difficult in writing to always play the ball and not the man.   As I said above, try to keep criticism to something specific: this content is incorrect; that lighting is poor; too long; too short.   If you hate it utterly, easy, don't engage.
  3. Steps on How to Become a game Developer

    And I apologise for my previous post on this thread. It was a snide remark and proves that wisdom and courtesy do not always come with age.
  4. Steps on How to Become a game Developer

    What's the point of being young if you can't be arrogant sometimes? This lad has put something out there, and good on you Mobin. Just creating something that you believe in already puts you one up on almost all the windbags on the internet, this forum included. I say good luck to you, sir, and keep going. Your next effort will be better, the next will be better still.   Please keep criticism to specifics. So here comes mine: Leave out the funny voices, it's intrusive to the message.
  5. Beginner Programmer Help

    Sorry, Khaiy just said the same thing! (Great minds think alike, though fools seldom differ.)
  6. Beginner Programmer Help

    Guesswork here, is it because you're creating a new object each time you generate the list?    public void GenerateList() { Buy buy = new Buy(); //this 'buy' object is empty Console.Clear();
  7. Steps on How to Become a game Developer

    I found it oddly compelling.
  8. Textures in javascript Canvas

    Serapth, thanks for the reply, I think I've done what I think you mean, take another look. It doesn't look right, I'd like it to rotate as the view rotates and scale properly as it moves into the distance.
  9. Textures in javascript Canvas

    Morning All,   I've written a working game and I'm pretty pleased with the physics and the look in general, but I'd love to make the ground look sandy or grassy. The texture needs to move around in a realisitic way when the viewpoint moves so I can't just load a picture of some sand. Are there any plausible ways to achieve this with the canvas in javascript? Google has not enlightened me!   Use the arrow keys to roll the ball around and chase the rubies:
  10. Javascript 3d project

    Evening All,   As a challenge I took the step to 3d and came up with a simple game, steer round the screen (arrows,x,z) and bash into the crystals:   I think it looks rather nice, hit all ten crystals and get your best time. If you want, please use, adapt and impove; but keep me informed.  It's called marbles because I lost them in the 3d geometry. Is this a UK only phrase?!?   contact: accounts(at)
  11. No Actual Game

    Evening All,   I think I've found my groove for now with the sort of things I want to make - little practice projects that demonstrate some physics and/or demonstrate a numerical technique.  Also amusing my children for a few minutes is important.   Anyway my latest thing has physics (gravity) and implements a variable sized grid to show the gravitional potential (and looks quite pretty I think).  Trouble is there's no actual gameplay, you just click on the grid and add a planet.   Any ideas?  It is Javascript and you need FireFox or IE9+ because it uses the Canvas object.   Go to and go to the Games Links, it's at the bottom called Planets, Pot Noodle.
  12. Collision response forces in rigid body simulation

    Would you mind posting back with how you get on with this?  Maybe with a link?  If you do it in JavaScript I'll even host it for you!
  13. Collision response forces in rigid body simulation

    I started out trying the impulse approach as in the mechanics textbooks, but a problem arises when you want the objects to eventually calm down and rest against each other in equilibrium; there is no velocity, so no collisions, so nothing stopping one falling through the other.  Also with more than two bodies you can get weird jittery effects.  I ended up just thinking about forces which I think are a more fundamental quantity.   How do you use impulses in a many-bodied system and in such a way as you don't need a special case to show one thing coming to rest on top of another?  I couldn't work it out!
  14. Collision response forces in rigid body simulation

    I hope I'm not teaching you to suck eggs but I would seriously recommend simplifying everything down to one object moving under gravity and getting that going first.   I haven't used impulses at all, just forces.  I am just playing around with things myself with no ambition beyond my own amusement so I've no idea if there's a standard way of laying these things out.   Obviously this won't compile and the numbers are made up, but the sort of framework I've used is:   Object MyThing = new Object(); double MyThing.mass=5; double MyThing.x_position=100; double MyThing.y_position=100; double MyThing.x_velocity=0; double MyThing.y_velocity=0; double MyThing.x_force=0; double MyThing.y_force=0;   controlLoop(RunMeEvery TimeInterval) {      GetBulkForces(MyThing);    GetCollisionForces(MyThing,YourThing);       //velocity is change in postion per unit time    MyThing.x_position += MyThing.x_velocity;    MyThing.y_position += MyThing.y_velocity;      //acceleration is change in velocity per unit time (F=ma, rearranged into a=F/m)    MyThing.x_velocity += (MyThing.x_force/MyThing.mass);    MyThing.y_velocity += (MyThing.y_force/MyThing.mass);     DrawOnScreen(MyThing); }   GetBulkForces(Thing) {    //Let's just have it falling under gravity, F=m*g, on a planet where gravity is -0.1 in some units    double g=-0.1;    Thing.yforce = Thing.mass*g; }   GetCollisionForces(Thing1,Thing2) {    if(CollisionHappened(Thing1,Thing2))    {       double x_force=ForceOfTheCollision(Thing1,Thing2,"X");       Thing1.x_force += x_force;       Thing2.x_force -= x_force; //i.e. opposite to Thing1!         double y_force=ForceOfTheCollision(Thing1,Thing2,"Y");       Thing1.y_force += y_force;       Thing2.y_force -= y_force; //i.e. opposite to Thing1!    } }   ForceOfTheCollision(Thing1,Thing2,XYdirection) {   //Lots of trig and geometry to work out how far the Things overlapped and in what direction the collision should rebound }   CollisionHappened(Thing1,Thing2) {    //Did a collision happen? }
  15. Collision response forces in rigid body simulation

    I made a multi-rigid-body game (a load of boxes falling about) in javascript and found that trying to solve the explicit impulse equations is basically a total nightmare when there are multiple collisions and bodies in contact with each other.   My approach was to let them overlap a bit and then say that the reactive force is some suitable function of the overlap.  The reactive force acts in equal and opposite directions on each body (Newton three), this is crucial and means that the momentum and angular momentum work out right.  You need the function to have a hysterisis so that energy gets swallowed up in each collision or your objects go haywire.  Basically, the force function must make the force smaller as the bodies push apart but the exact details are not so important.   I have let the overlap effect be quite noticeable to show what is going on, but you could reduce it by making the bodies more rigid and also having a bit of a buffer around each object.   Realistic friction is a whole other question though.   Feel free to grab and modify the javascript.  I'm learning about websites and things and have put up a site as a project and some of my silly javascript games are on it.  The site works in Mozilla but looks poo in IE8 and the Canvas object the game uses needs at least IE9 anyway.   Go here:   Go to 'Games Links' and look at 'Boxes and Cat'.  Double click the boxes to make them vanish.  Reply if you have trouble, I'll try to respond to any questions.