Jump to content

Model origins and relationships


Recommended Posts

I'm trying to work through the basics of models and their placement, so I thought I'd start out with some observations and ask for validation or clarification.

 

First, all models should orient looking forward along the positive X axis.

 

Second, pretty much every aircraft model I've seen has the origin going through the aircraft centerline. I'm not sure if this is convenience for the modeler or by design, but I'm guessing it has an impact on how the aircraft rotates (pitch up/down, yaw, ...), which I assume happens about the origin. Intuitively, I think this should actually be located at the aircraft center of gravity and not just a convenient location for the modeler, though I'm not sure how much this would be noticeable.

 

Third, it appears that cockpit models should locate the origin at the eyepoint.

 

Fourth, when flown by a human, both the aircraft model and cockpit model will be drawn superimposed over each other, with the cockpit model origin located at the Cockpit/mainpanel_init.lua:cockpit_local_point delta distance from the aircraft model's origin.

 

So, how do the two models display without overwriting each other when the aircraft model already has a non-functioning cockpit?

 

Also, I see how the cockpit gets positioned relative to the aircraft, but what positions the aircraft relative to the concrete it sits on when parked?

 

Thanks

Link to comment
Share on other sites

First, Correct.

 

Second, 0,0,0 is Usually the Center Of Gravity or Center for Appearance Sake. (Example, A-10C)

ModelViewer2013-07-2519-43-04-01_zps5710665c.png

 

Third, The Cockpit Model for Cockpit view should have the Eye's Point at 0,0,0 (example, A-10C Cockpit Viewed from Side)

ModelViewer2013-07-2519-43-55-69_zps6005596b.png

 

Forth, The External Model has an Animation Argument to turn off the External Model Pit in Cockpit view. (Example, A-10C W/ Animation Set for Cockpit View)

ModelViewer2013-07-2519-47-56-00_zps978921a2.png

 

The Position the Cockpit is Rendered Relative to the External Model is Set in the MainPanel LUAs


Edited by SkateZilla

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

the gear positions or the collision lines?

 

Clarify what you mean by on the ground.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

If I create a mission which uses the aircraft and the first waypoint is takeoff from ramp, the aircraft will (should) have it's wheels on the ground.

 

Is the nose_gear_pos, main_gear_pos responsible for this or is it handled by collision_shells around the wheels or is there something else?

Link to comment
Share on other sites

gear_pos.

 

I have meshes in game with no collision shells around the gear. and they sit on the ground correctly

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

I did a quick (I thought) exercise to validate this:

 

1. Created a VERY basic model:

 

WunderluftModelViewer_zps2dba6bb3.jpg

 

As you can see, it has its origin at the CG (more or less).

 

2. I extracted the Wunderluft sample and added the EDM file to the Wunderluft/Shapes directory.

 

3. Started DCSW and created an instant mission. Since I didn't update the Wunderluft.lua file, I expected it to look odd when started:

 

Screen_130726_163240_zps15b52fba.jpg

 

As expected, the wheels are below the surface of the concrete. So...

 

3. A quick change to the Wunderluft file should fix that:

 

WunderluftGearEdit_zpsd4a30456.jpg

 

This should extend the nose gear forward a bit more and raise the aircraft by an additional meter.

 

4. Restart DCS, create an instant mission, and:

 

Screen_130726_164236_zpse171e16c.jpg

 

The aircraft doesn't appear to have changed it's position at all. There's some kind of magic going on that is not making sense to me.

Link to comment
Share on other sites

I'll look at teh max file you sent me.

 

I'd recommend using NotePad++ for Windows to edit LUA Files.


Edited by SkateZilla

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

1. The Model wasnt orientated correctly, I Had to rotate it 90 degrees counter clockwise in MAX.

(When Viewing from the 3ds Max TOP View, Nose should be pointed towards the top of your Screen, it was pointing along the X Axis.

 

2. I Had no Problems with taking the coordinates for the gears from max, inputing them in the data LUA, along with the gear tire width, and getting it to position and react correctly.

 

 

So, After Rotating and Centering it.:

 

nose_gear_pos = {2.948, -2.009, 0.07}, --Position in M of Nose Gear, Y, Z, X

main_gear_pos = {-1.731,-1.958, 1.34}, -- Position in M, Y, Z, X for Main Gear Tire, Opposite Side Tire will Automatically be placed on opposing side.

nose_gear_wheel_diameter = 0.395, --Diameter in M of Nose Gear

main_gear_wheel_diameter = 0.395, -- Diameter in M of Main Gear

 

Mission Start:

Screen_130726_202912_zps1867425d.jpg

 

Landing:

Screen_130726_203253_zps208d065a.jpg

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

1. The Model wasnt orientated correctly, I Had to rotate it 90 degrees counter clockwise in MAX.

(When Viewing from the 3ds Max TOP View, Nose should be pointed towards the top of your Screen, it was pointing along the X Axis.

 

I was so happy finding out it was an editor problem that I missed this. If I rotate the model in MAX so that the nose points to the top of the screen and export, then the model viewer shows the aircraft pointing forward along the postitive Y axis. This is different from all other models I load in the model viewer.

 

Is this a difference in MAX 2011 / 2012?

Link to comment
Share on other sites

I was so happy finding out it was an editor problem that I missed this. If I rotate the model in MAX so that the nose points to the top of the screen and export, then the model viewer shows the aircraft pointing forward along the postitive Y axis. This is different from all other models I load in the model viewer.

 

Is this a difference in MAX 2011 / 2012?

 

 

Aircraft Models are supposed to have the fuselage on the Y Axis, and Wings on the X Axis.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

Aircraft Models are supposed to have the fuselage on the Y Axis, and Wings on the X Axis.

 

However, if I rotate like you said, then when I export the model from MAX 2012 and display in game, the AI flies the aircraft sideways and the Wunderluft HUD is offset by 90 degrees. This is a screenshot with the cockpit view zoomed way back and looking between the HUD (cockpit fwd) and the nose of the aircraft (off to the left):

 

Screen_130727_165915_zps53232756.jpg

 

I don't know why MAX 2012 appears to be different in this regard, but it looks like the rule is that when exported, the standalone Model Viewer needs to have the model oriented with the nose along the positive X axis.

Link to comment
Share on other sites

Max 12 differs from 2009/2010 not sure in 2011. Or it could be the Plugins. As there is no change log for them we don't know.


Edited by joey45

The only way to make sense out of change is to plunge into it, move with it, and join the dance.

"Me, the 13th Duke of Wybourne, here on the ED forums at 3 'o' clock in the morning, with my reputation. Are they mad.."

https://ko-fi.com/joey45

 

Link to comment
Share on other sites

I determined the wheel size

 

z8dz.png

 

click on a wheel, click tools tab ont eh right side and click measure, simple.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

However, if I rotate like you said, then when I export the model from MAX 2012 and display in game, the AI flies the aircraft sideways and the Wunderluft HUD is offset by 90 degrees. This is a screenshot with the cockpit view zoomed way back and looking between the HUD (cockpit fwd) and the nose of the aircraft (off to the left):

 

Screen_130727_165915_zps53232756.jpg

 

I don't know why MAX 2012 appears to be different in this regard, but it looks like the rule is that when exported, the standalone Model Viewer needs to have the model oriented with the nose along the positive X axis.

 

What are your export settings for the Exporter? If you use the Wrong Export Space it will export sideways.

 

Max_Space_Export_zps739f214f.jpg

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

What are your export settings for the Exporter? If you use the Wrong Export Space it will export sideways.

 

Awesome! I don't know what Export Space: Land means, but it definitely does the trick. I was using the default of World.

Link to comment
Share on other sites

<sigh> Two steps forward, one step back.

 

Ok, I've managed to get an aircraft looking reasonably correct for the moment and have managed to animate the canopy open / close, so I'm pretty sure I understand that. However, ...

 

I've tried installing a human cockpit so that I can start experimenting with controls, but I can't get the cockpit to display in the correct location. It appears to be using some default location.

 

Again, I started with Wunderluft and modified it. I started with just changing the cockpit_local_point in Cockpit/mainpanel_init.lua to where I thought it should be for my model { 5.5, 0.81, 0.0}, but it doesn't move. I've tried, 0, 0, 0 as well, but no change.

 

I've commented out all of the gauges and most of the Wunderluft devices except for TEST and ELECTRIC_SYSTEM. I also created a Dummy connector called POINTER to match the required registration in clickabledata.lua.

 

In one last desparate attempt at random change and assess, I tried modifying this in Wunderluft.lua:

 

crew_members = 
   {
       [1] = 
       {
           ejection_seat_name = "pilot+ejectionseat",
           drop_canopy_name = "Wunderluft_canopy",
           pos =  {5.5, 0.0, 0.0},
           canopy_pos = {5.5, 0.81, 0.0},
       }, -- end of [1]
   }, -- end of crew_members

Amazingly, that did move the human cockpit, which has now confused me beyond all hope. This pos here is not the same pos I have in mainpanel_init.lua. So, it appears that these positions are somewhat related, but in unknown ways as I can't find a way to rationalize the model's origin with the display. Can anyone shed some light on this?

 

Once this is solved, I need to understand why canopy animation works, but landing gear animation does not. <sigh>

Link to comment
Share on other sites

if you leave the cockpit folder empty, the engine will load one of the 2d FC Cockpits, systems and all as a placeholder. So the General Position would have to be in the Data LUA.

Windows 10 Pro, Ryzen 2700X @ 4.6Ghz, 32GB DDR4-3200 GSkill (F4-3200C16D-16GTZR x2),

ASRock X470 Taichi Ultimate, XFX RX6800XT Merc 310 (RX-68XTALFD9)

3x ASUS VS248HP + Oculus HMD, Thrustmaster Warthog HOTAS + MFDs

Link to comment
Share on other sites

I've also noticed that the Wunderluft Cockpit model is reusing draw argument numbers with different purposes than the external model draw arguments.

 

For example, the Cockpit/mainpanel_init.lua uses argument #1 for the Canopy position gauge, but the external model is using argument #1 for nose gear strut compression. Are these argument domains completely independent?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...