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.

Pages: 1 2 [3] 4 5

Author Topic: Model - JBSim guidance?  (Read 58671 times)

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: Model - JBSim guidance?
« Reply #30 on: August 30, 2012, 04:44:40 pm »

Yes it is suitable for vehicles and aircrafts but not for characters and skinned animations.


So how would animations for ailerons and landing gear and all of the other moving bits of an aircraft be handled without exportation of the original animations crafted in Milkshape?
Logged

Deutschmark

  • Member
  • **
  • Posts: 50
Re: Model - JBSim guidance?
« Reply #31 on: August 30, 2012, 07:27:40 pm »

Am no expert here, but from reading what Angrypig said on page one you just need to define the pivot point orientation on the part and the movement of the part will be done by external files like .xml, that's if am understanding it right, am sure Angrypig will be able to tell us both better how it works.

Deutschmark
Logged
I have not come across a polygon yet that I have not been able to model with

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: Model - JBSim guidance?
« Reply #32 on: August 30, 2012, 08:06:30 pm »

Pretty much what I'm hoping for.  My experience is in X-Plane, and I model with Rhino3D, which also exports Collada.  This is going to be a bit of a learning curve, especially since my mind is rather set in the X-Plane development path.
Logged

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Model - JBSim guidance?
« Reply #33 on: August 31, 2012, 03:23:20 am »

Yes it is all about right pivot point setup and script.
First what you have to do is tell importer that you want to convert node into bone let say "elevator" node. This is done in our import UI so it is easy. The second step is the script, in first iteration we will expose Javascript interface only, later we will add support for C++ native "scripting"...

Code: [Select]
function update(obj, dtime)
{
    // get normalized elevator position from JSBSim in range [-1, 1]
    var elevator_pos = obj.get_fdm_value("surface-positions/elevator-pos-norm");

    // this is simplified version real elevator has range [-28, 23] degrees for c172
    obj.rotate_node_X_abs("elevator", elevator_pos * 25.0);

    // this is exampe for propeller rotation
    var eng_rpm = obj.get_fdm_value("engines/engine[0]/rpm");
    obj.rotate_node_Y("propeller", eng_rpm * (1.0 / 60.0) * dtime);
}

This could be challenging for complex animation like a landing gear on B737 but for such complex animations i will going to support animations from COLLADA. We are currently working on scripting so if you have any ideas don't hesitate to write them here. :)
« Last Edit: August 31, 2012, 04:36:20 am by angrypig »
Logged

Deutschmark

  • Member
  • **
  • Posts: 50
Re: Model - JBSim guidance?
« Reply #34 on: August 31, 2012, 04:30:18 am »

Hi Angrypig, the game I work in now has a very nice and easy way for doing moving gears, its a free animation meaning it can be as many frames as the one making it would like to use and as many parts as well, the gear 3D file is a separate 3D X file from the full 3D model and is called ( gear.x ) and the in game key is ( G ) and if you have a gear.x file in the model folder and the user hit the G key the animation of that file will then be activated there is no scripting, coding nothing for the mod maker to do other then to do the animation in the 3D app and export it and put it in the models folder.

Deutschmark
Logged
I have not come across a polygon yet that I have not been able to model with

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Model - JBSim guidance?
« Reply #35 on: August 31, 2012, 04:58:12 am »

It sounds simple but it is limiting too, as i said i will support animation but it won't be the X format it will be our own format created from COLLADA file. And for complex parts like flaps on B777 you have to control animation or multiple animations in script and if you want to simulate failures the script is the only way how to do it in efficient and simple way... Every aircraft is different and the scripting is the only way how to give people freedom. There are other things that will be controlled in script like sounds systems etc.
Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: Model - JBSim guidance?
« Reply #36 on: August 31, 2012, 07:41:54 am »

How will the hierarchy of animations work?  Say, for easy example, you want to animate the elevator trim tab.  Will groups of objects be possible?
Logged

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Model - JBSim guidance?
« Reply #37 on: August 31, 2012, 09:03:17 am »

The hierarchy is supported implicitly so if you have nodes in hierarchy in 3dmax and you mark them to export in importer the same hierarchy is exported into our pkg file.
Logged

Steve.Wilson

  • Full Member
  • ***
  • Posts: 176
  • Home Cockpit Builder
Re: Model - JBSim guidance?
« Reply #38 on: August 31, 2012, 09:25:03 am »

What about Milk Shape and exports from other modelers besides 3DS?  Given the extreme expense of 3DSMax it's pretty important to find a low cost way to facilitate the import of aircraft and other articulated models.
Logged

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Model - JBSim guidance?
« Reply #39 on: August 31, 2012, 09:40:05 am »

I used the 3dsmax as an example, the hierarchy is always exported into COLLADA file, it doesn't matter what 3D modeler you have at least i don't know one which is not using a hierarchy for modelling...
Logged

User_name

  • Newbie
  • Posts: 6
  • newbie
Re: Model - JBSim guidance?
« Reply #40 on: September 02, 2012, 09:38:25 pm »

Suggestions that’s a hard one.

First one would be to try to schedule script execution and JSBsim independent of frame rate, e.g. it runs every 20ms (milliseconds) or 50 times a second. In a flight sim periodic time interval operation is a must when trying to script a F35B as an example. 



Yes, know Windows will never be a deterministic OS, but perhaps return a ms (us preferred) interval since last execution of script so dt in control loops can be better accounted for.  If you could provide a good periodic task, then this would put you ahead of X-plane in many respects from the start.

Something that hasn’t been mentioned is “instruments” in which most if not all variables from JSBsim should be exposed to script (know this is a loaded proposition). With this custom instruments or displays can be created down the road.

Last one - documentation… I suck at this in real life and 80% of the time have to go back and reverse document, but if script or eventual C++ is going to be successful, the end user needs to know what it is “X” function does and how.
« Last Edit: September 02, 2012, 10:07:40 pm by User_name »
Logged

ddenn

  • Sr. Member
  • ****
  • Posts: 374
Re: Model - JBSim guidance?
« Reply #41 on: October 08, 2012, 12:00:13 pm »

Does anybody know what property to use to get wheels position in JSB (rotations and vertical movements)? Is there any list of JSB properties?
Logged
i7 3930K 3.50 (3.80) Ghz, 32Gb RAM, GTX980 4 Gb VRAM, Windows 7 64-bit

About Outerra in Russian

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Model - JBSim guidance?
« Reply #42 on: October 08, 2012, 12:32:58 pm »

jsb["gear/unit[0]/compression-ft"]; // gear compression in feets
jsb["gear/unit[0]/z-position"]; // probably the gear Z position in aircraft space
jsb["gear/unit[0]/wheel-speed-fps"]; // speed in feets per second


i never tested these values so you will be the first one :) i am going to test it on ah64. If you need more just give me know i will find them in JSBSim source...then i will add them to our wiki too
Logged

ddenn

  • Sr. Member
  • ****
  • Posts: 374
Re: Model - JBSim guidance?
« Reply #43 on: October 08, 2012, 12:37:19 pm »

Thanks, will test it
« Last Edit: October 08, 2012, 03:30:02 pm by angrypig »
Logged
i7 3930K 3.50 (3.80) Ghz, 32Gb RAM, GTX980 4 Gb VRAM, Windows 7 64-bit

About Outerra in Russian

angrypig

  • Sr. Member
  • ****
  • Posts: 454
Re: Model - JBSim guidance?
« Reply #44 on: October 08, 2012, 03:28:48 pm »

jsb["gear/unit[0]/compression-ft"] tested it's working for c172r...

Code: [Select]
  val = jsb["gear/unit[1]/compression-ft"];
  geom.rotate_joint_orig(landing_gear_l_id, val * 0.225, {x:0,y:1,z:0});
  val = jsb["gear/unit[2]/compression-ft"];
  geom.rotate_joint_orig(landing_gear_r_id, val * 0.225, {x:0,y:-1,z:0});
  val = jsb["gear/unit[0]/compression-ft"];
  geom.move_joint_orig(landing_gear_nose_id, {x:0,y:0,z:val*F2M});
« Last Edit: October 08, 2012, 03:30:22 pm by angrypig »
Logged
Pages: 1 2 [3] 4 5