RedBeard2 Posted July 25, 2013 Share Posted July 25, 2013 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 More sharing options...
SkateZilla Posted July 25, 2013 Share Posted July 25, 2013 (edited) First, Correct. Second, 0,0,0 is Usually the Center Of Gravity or Center for Appearance Sake. (Example, A-10C) Third, The Cockpit Model for Cockpit view should have the Eye's Point at 0,0,0 (example, A-10C Cockpit Viewed from Side) 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) The Position the Cockpit is Rendered Relative to the External Model is Set in the MainPanel LUAs Edited July 25, 2013 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 More sharing options...
RedBeard2 Posted July 26, 2013 Author Share Posted July 26, 2013 Aha! I wasn't aware of the animation argument to turn off the pit. That's interesting. So what controls the position of the external model when it sits on the ground? Link to comment Share on other sites More sharing options...
SkateZilla Posted July 26, 2013 Share Posted July 26, 2013 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 More sharing options...
RedBeard2 Posted July 26, 2013 Author Share Posted July 26, 2013 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 More sharing options...
SkateZilla Posted July 26, 2013 Share Posted July 26, 2013 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 More sharing options...
RedBeard2 Posted July 26, 2013 Author Share Posted July 26, 2013 I did a quick (I thought) exercise to validate this: 1. Created a VERY basic model: 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: As expected, the wheels are below the surface of the concrete. So... 3. A quick change to the Wunderluft file should fix that: 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: 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 More sharing options...
SkateZilla Posted July 26, 2013 Share Posted July 26, 2013 (edited) I'll look at teh max file you sent me. I'd recommend using NotePad++ for Windows to edit LUA Files. Edited July 26, 2013 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 More sharing options...
SkateZilla Posted July 27, 2013 Share Posted July 27, 2013 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: Landing: 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 More sharing options...
RedBeard2 Posted July 27, 2013 Author Share Posted July 27, 2013 Many thanks! I've been banging my head on this for days and couldn't figure out what I was doing wrong. Is there an error log somewhere that I could have looked at to see that it was complaining about an ill-formed lua file? Link to comment Share on other sites More sharing options...
trietnguyen Posted July 27, 2013 Share Posted July 27, 2013 (edited) I determined the wheel size Edited July 27, 2013 by trietnguyen Link to comment Share on other sites More sharing options...
Aginor Posted July 27, 2013 Share Posted July 27, 2013 Ahh, I love that helicopter. Nice to see it :) DCSW weapons cheat sheet speed cheat sheet Link to comment Share on other sites More sharing options...
RedBeard2 Posted July 27, 2013 Author Share Posted July 27, 2013 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 More sharing options...
joey45 Posted July 27, 2013 Share Posted July 27, 2013 (edited) It is different in MAX 12 from working in MAX 10 Edited July 27, 2013 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 More sharing options...
SkateZilla Posted July 27, 2013 Share Posted July 27, 2013 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 More sharing options...
RedBeard2 Posted July 27, 2013 Author Share Posted July 27, 2013 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): 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 More sharing options...
joey45 Posted July 27, 2013 Share Posted July 27, 2013 (edited) 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 July 27, 2013 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 More sharing options...
SkateZilla Posted July 28, 2013 Share Posted July 28, 2013 I determined the wheel size 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 More sharing options...
SkateZilla Posted July 28, 2013 Share Posted July 28, 2013 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): 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. 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 More sharing options...
trietnguyen Posted July 28, 2013 Share Posted July 28, 2013 click on a wheel, click tools tab ont eh right side and click measure, simple. Thank you very much :) Link to comment Share on other sites More sharing options...
RedBeard2 Posted July 28, 2013 Author Share Posted July 28, 2013 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 More sharing options...
RedBeard2 Posted July 29, 2013 Author Share Posted July 29, 2013 <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 More sharing options...
SkateZilla Posted July 29, 2013 Share Posted July 29, 2013 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 More sharing options...
RedBeard2 Posted July 29, 2013 Author Share Posted July 29, 2013 But I don't have nor do I want an empty Cockpit folder. I wanted to start experimenting with creating a 3D cockpit. What I don't understand is why crew_members settings is affecting the 3D cockpit or how the two are related. Link to comment Share on other sites More sharing options...
RedBeard2 Posted July 31, 2013 Author Share Posted July 31, 2013 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 More sharing options...
Recommended Posts