Multiple Thrust points

Blitz3D Forums/Blitz3D Programming/Multiple Thrust points

prefim(Posted 2003) [#1]
Im working on a project whereby an object can emit thrust from various points on its surface but can also be pushed by general forces such as wind etc.

Any ideas where i can start with the maths. I am aware of adding forces etc. but all the examples i've ever done/seen all have the forces all coming from the centre of the object.

Im guessing the best example would be a lunar lander type craft with RCS thruster on it.

Regards,
Mat Recardo


Rob Farley(Posted 2003) [#2]
I would suggest not worrying about proper maths and fudge it so it looks about right.

An easy way to do it would be create a pivot at 0,0,0
Then translate the pivot around to add forces, ie,

Wind might be translateentity pivot,-1,0,0.
Vertical thrust might be translateentity pivot,0,1,0.
Gravity might be translateentity pivot,0,-.5,0.

On top of this if you want to add thrust at an angle you can rotateentity pivot,10,0,0 then moveentity pivot,0,1,0

To dampen the movement (friction) then pointentity pivot,middle (create a pivot called middle at 0,0,0) then moveentity pivot,0,0,.1 (or the amount of dampening) this will dampen all the forces. Also a nice trick is to moveentity pivot,0,0,entitydistance(pivot,middle)/2 this will half all the forces.

The resultant would then be to translate your lander entity by entityx(pivot),entityy(pivot),entityz(pivot)

It's quite a nice 'no maths' method.


prefim(Posted 2003) [#3]
Thanks for the quick response, usually have to wait days for something!

Im kinda getting where you are coming from on this (nice site by the way!)

Your example covers forces upon the object as a whole doesnt it?

If you imagine say a craft with nose thrusters and tail thrusters. If the nose one is fired 100% to the right, it should start to push the nose round in a large circle, If the tail thruster is fired 100% to the left, the craft would then spin on the spot.

I need to be able to take all these forces (from various positions on the craft) and then translate that into a single x,y,z,h,p,b result.

If you can shed any light on it, any chance of a few lines of code please? Im learning blitz3d at a less than realistic pace and its been years since I last programmed (this is, if you like, my push back into programming).

I wrote a similar program ages ago on the amiga in AMOS, but it dealt with thrusters in pairs (so they pushed equally in opposite directions making the centre of rotation the centre of the craft ergo a lot simpler to simulate!)

I may just not be thinking this through the right way round, at some point it will click and I will be away but im kinda just bashing ideas around the moment.

Regards,
Mat Recardo.


Rob Farley(Posted 2003) [#4]
You are really making your life complicated with that sort of behaviour, and quite frankly, I don't think most people would notice that sort of thing.

There's no easy way of doing that sort of thing anyway, you're going to have to do some sort of rigid body physics model to make it work properly so when you add a force to the front the back (and sides) will respond correctly. Once you've sorted that lot out you can then see what the craft orientation would be and adjust the model acordingly.

It's perfectly do-able but a pain in the arse quite frankly.


Bot Builder(Posted 2003) [#5]
Well, you could use miracles verlet engine, our dmc's mod to it. Heck if you were insane, you could use mine. There all rigid-body physics thingamajigs. If you use this system, it would allow you to not only do multiple thrust points, but articulated segments and realistic collisions. Of course you can kludge the systems, as Dr Av says, but it might actually make it easier as you wouldn't have to work with guesswork. As far as translating the result, the current systems simply produce three xy points, one center point, one alligned with the yaxis and one alligned with the z axis. This allows you to place the object at the center point, and aligntovector it to the two other points.

What's especialy cool about the Verlet(apposed to euler's) integration is that with verlet, all you have to do is move one of the verlet points in a direction to impart velocity.

Of course, as you are sortof beggining blitz, Dr Av's solution might be preferable.


DJWoodgate(Posted 2003) [#6]

I don't think most people would notice that sort of thing.



They would notice it alright. It would make the darn thing very difficult to manoeuvre. IRL one assumes this sort of thing would be under computer control anyway, so you do not have to worry about juggling thrusters to balance your moment around your centre of gravity to avoid translation. Anway Halo was attempting to simulate angular momentum a while back and posted this code... http://www.blitzbasic.co.nz/bbs/posts.php?topic=15204.


RexRhino(Posted 2003) [#7]
Yeah, I think DJWoodgate is correct. Simulating multiple thrust points MIGHT be realistic... but realisticly something like that would be computer controled to give the illusion of a single point of thrust. (I mean, even the Apollo astronauts didn't have to fire individual thrusters manually, and that was back in the 60s).

And most spacecraft have a single powerful thruster, and then directional thrusters to turn the craft. Meaning you use turning jets to point your vehical in the currect direction, and then fire your thrusters to move in that direction. Thats how the soyez do it, the apollo craft did it, the space shuttle does it (although the space shuttle does use thrust differential for steering on reentry I believe, but that is because it is in the atmosphere. The dynamics for atmospheric flight are completly different! Also, the space shuttle sucks and is way over-enginered.) Imagine the game physics for the ship in Asteroids, or for the ship in Lunar Lander... that is actually a pretty close approximation on how modern space ships steer!

I have been playing Orbiter, which is a free and highly realistic space simulator, and even in probably the most realistic space sim out there, and each vehical is calculated as a point (which makes sense for space travel... what does the difference between the weight in the left and right half of your ship compare to the gravitation of jupiter).

If you want to be REALLY realistic, then you should consider orbital physics anyway (i.e., each ship is orbiting a planet, orbiting a star, etc., etc.). To intercept another ship, you wouldn't turn and thrust for the other ship, you would either thrust in the direction towards or away from your orbit, to lower/raise your orbital energy and have your orbit intersect the orbit of your target.

As for HOW to simulate vectors without using vector math, is to use a pivot. Lets say you have your ship, and you are thrusting forward in a direction. You point your pivot in that direction, and move it forward for the appropriate amount of time for that frame. Then, lets say the ship is deflected from the side by a beam of energy. You turn your pivot in the direction the beam of energy is traveling, move it based on the value of the vector and your frame time. You do this to the pivot for each vector, and then when all the manipulations are done, you move your object to the location of the pivot.

Note, this system has problems, so if "realistic" is what you want, you should do the math yourself.


prefim(Posted 2003) [#8]
Thanks for the many responses people. The verlet idea sounds good at the moment. I think (judging by the responses) that I may have put across the wrong idea :-(

Im actually working on the simulation of a boat type craft in water. But some boats have bow thrusters which can give lateral push to either the front middle or rear of a craft.

My example of a lunar lander was to try and explain my idea of how things would be more complex than simple centrally rotating masses.

Anyway, time to get back to it.