Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Author Topic: Use of Outerra in satellite dynamics game  (Read 8689 times)

DeltaSim

  • Jr. Member
  • *
  • Posts: 48
Use of Outerra in satellite dynamics game
« on: October 11, 2012, 05:54:36 am »

Hi,

I am thinking about setting up a game for schoolchildren where they can throw a ball and a PC simulates what would happen if they were 500 km high giants throwing a satellite. This should be a fun way to teach kids why satellites stay up. Of course, Outerra would be the first choice for visualisation :-). The satellite's position and velocity can be calcuated from orbital elements, the initial velocity of the ball can be measured with OpenCV and a webcam. Is there already a way that I could use Outerra as a visualisation engine, following the flight path of the satellite?

Cheers, Martin 
Logged
"The only way of discovering the limits of the possible is to venture a little way past them into the impossible." - Arthur C. Clarke

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Use of Outerra in satellite dynamics game
« Reply #1 on: October 11, 2012, 06:16:43 am »

That's an interesting idea.
Technically, if you import the satellite as an aircraft, you could be controlling its position and orientation from the aircraft's script each frame, overriding whatever JSBSim computes.
Logged

DeltaSim

  • Jr. Member
  • *
  • Posts: 48
Re: Use of Outerra in satellite dynamics game
« Reply #2 on: October 11, 2012, 06:33:32 am »

Thanks for your quick reply. That actually sounds quite straight-forward. I have a problem, however: Earlier, I tried to import a model of Sputnik-1 as an aircraft. The 3D-Model goes well, I also found where the objdef file is, but when I want to place it as an aircraft, it doesn't appear in the "aircraft" menu...
Logged
"The only way of discovering the limits of the possible is to venture a little way past them into the impossible." - Arthur C. Clarke

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Use of Outerra in satellite dynamics game
« Reply #3 on: October 11, 2012, 06:54:59 am »

They don't, yet. You have to place them through the objects tool now. Also, to be treated as an aircraft the objdef files must have physics and script assigned, as described here
Logged

DeltaSim

  • Jr. Member
  • *
  • Posts: 48
Re: Use of Outerra in satellite dynamics game
« Reply #4 on: October 11, 2012, 08:15:56 am »

OK, I'm getting there, thanks. At least, I can let Sputnik drop from where I like - as a start :-).
Logged
"The only way of discovering the limits of the possible is to venture a little way past them into the impossible." - Arthur C. Clarke

DeltaSim

  • Jr. Member
  • *
  • Posts: 48
Re: Use of Outerra in satellite dynamics game
« Reply #5 on: October 12, 2012, 05:09:55 am »

I started playing around with the aircraft script, just trying to manipulate the satellite's position as you suggested. However, I haven't quite understood yet how this works. I tried to initialise JSBSim with a given position and I also tried to set the position of the geomob in the update_frame method. Neither seems to have an effect. Here's what I wote so far:

Code: [Select]
var geom,jsb;

function initialize(reload){
  geom = this.get_geomob(0); // get first geometry isntance
  jsb = this.jsb();                      // get JSBSim interface
 
  this.set_fps_camera_pos({x:0,y:0,z:0});
  jsb['position/lat-gc-deg'] = 0.0;
  jsb['position/long-gc-deg'] = 0.0;
  jsb['position/h-sl-meters'] = 200000.0;
 
  this.activate_event_group("plane");
}


function update_frame(dt) {
//geom.set_pos({x:6570000,y:0,z:0})

Can you help me? I just need to set the position (and maybe attitude) of the model, overriding JSBSim.
Logged
"The only way of discovering the limits of the possible is to venture a little way past them into the impossible." - Arthur C. Clarke

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Use of Outerra in satellite dynamics game
« Reply #6 on: October 12, 2012, 05:52:31 am »

I didn't mean to set the positions via the jsb, but to use the set_pos and set_rot methods of the geom. Basically, that jsb is there just because without it OT wont treat it as a dynamic object (yet).

Though I'm not sure whether the camera would follow an object manipulated this way, need to test it. Ultimately we will have a separate interface for objects that are neither simulated by JSBSim nor by the vehicle physics, for people who have their own physics engines.
Logged