Solved Setting up a driveshaft correctly ?

Discussion in 'Mod Support' started by CrashHard, Mar 25, 2017.

  1. CrashHard

    CrashHard
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    1,581
    Hey have some problems with the driveshafts for my mod, it will not follow the rear axle, should really need some help on this
    Beamng_driveshaft.jpg Beamng_driveshaft2.jpg
    Beamng_driveshaft3.jpg
     
  2. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    I've been working on a similar project. Last night I edited the wiki on props, hopefully I clarified it a little bit about setting the pivot. The stock driveshaft has it's pivot set in the middle so it will not behave the way you want even if you have your refnodes setup correctly.

    With the official parts the vehicle is pretty heavily damaged by the time you get lateral movement. The driveshaft will probably break and disappear before that point. I guess if you want lateral movement to look correct you may be able to get it to work by moving the pivot to TRA1 (or similar). As long as the transfer case never moves in relation to the rest of the truck it should work. Although now that I think about it, TRA1 moves in the official content based on installing different-length transmissions.

    I've been considering moving from 1 driveshaft prop to 3 props. I probably won't, but if done carefully I think this would allow for better-looking u-joints.
     
    • Informative Informative x 2
  3. CrashHard

    CrashHard
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    1,581
    Thank you for replying :)
    Have done like you said and moved the pivot point to where it connect to the transfer case, now it moves nicely up and down, but still having trouble with side to side movement. Can it even be done?
     
  4. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    You are welcome. :)

    The official pickup has the same problem. It's not obvious because the official suspensions are setup for very little lateral movement. Improving your geometry / jbeam would probably do the same for you. It looks like you have only 2 links plus the panhard/track bar. I think that you should probably have 3 links plus the panhard/track bar.

    To get the driveshaft movement you want it may be that the pivot and main refnode should be in the same place. I'm not sure how to set that up in this instance. I suppose that you'd need to move the idY node onto the axle and idRef and idX onto the transmission/transfer-case area. If you got this working I'd be interested.
     
  5. CrashHard

    CrashHard
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    1,581
    It have 3 links there is just no model for the top one yet. And are hoping for some devs to maybe give some input on this as well. So I can know if it is even possible, because as you said the stock pickup also have this problem.
     
  6. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    I did some more testing with the pickup. It doesn't look good to me, I wasn't able to get the prop to rotate around the Z-axis at all based on the refnodes's movement. :(
     
  7. H/\Z/\RDOUS

    H/\Z/\RDOUS
    Expand Collapse

    Joined:
    Apr 18, 2016
    Messages:
    307
    deleted, wrong thread
     
  8. CrashHard

    CrashHard
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    1,581
    I see, It starting to look like it is a limitation in the beamng physics engine. But i would love to be proven wrong on this.
     
  9. CrashHard

    CrashHard
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    1,581
    Thank you so much, this was very helpful, and I have now managed to fix my problem, The drive shaft now move nicely up and down, and side to side following the rear axle closely
     
  10. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    @Darren9 - Actually what I just learned about the other day, the thing which caused me to update the Wiki, was a better solution for what you're doing in Blender. You've clearly got 99% of this figured out, what you're missing is that you can move the object's origin. I linked to information for 3ds Max and Blender in the wiki, but here's what I'm doing in Blender. I'll make it an ordered list for the benefit of any less-experienced members who might read this.
    1. After highlighting the object I switch to Edit mode (Tab)
    2. Change my selection mode using the bottom toolbar for whatever I need (vertex, edge, or face). Then select where I want my pivot point to be. So far I've either been selecting a single vertex or a single edge who's middle is where I want the pivot point to be.
    3. I use the spacebar menu (Space) and type in "cursor" and choose "Snap Cursor to Active". The 3D cursor should move there.
    4. Switch back to Object mode (Tab)
    5. I use the left flyout Tools sidebar (T if it's missing/hidden) and under Tools->Edit I choose "Set Origin" and from the dropdown choose "Set Origin to 3D Cursor". An alternative to get the dropdown without using the flyout sidebar is to simply press CTRL+ALT+SHIFT+C
    6. It's important NOT to apply (A) the location for this object.
    The object will spawn with it's pivot point at the idRef refnode and it's X and Y axis aligned with their respective refnodes. It's Z axis will be aligned perpendicular to the plane intersecting the other 3.

    In fact, you can use this knowledge to store the object in it's correct location and orientation in Blender (or Max I assume). The key is to set the pivot and leave it alone (do not apply it like you would for flexbody meshes). Same with the rotation: once a reasonable rotation is established and applied so that the object spawns in a reasonable way leave that alone. You can rotate the object still so that it looks right while you're working in Blender but do not apply any more rotations. Easy!

    Unfortunately I think your axles are subject to the same problem we are discussing here. You mentioned that idY isn't critical, but it actually *is* critical for what Crash Hard 01 is asking about. If you'll take a look at the video in post #3 you'll see that it's not just minor misalignments - he gets no movement on one axis. This is due to gimbal lock, but without both idX and idY you can't have proper movement on 2 axis...

    @Crash Hard 01 - I did some more testing yesterday. @Dummiesman advised me that it sounded like a gimbal lock issue. I hate gimbal lock because it's hard to visualize and hard to wrap my head around... but sure enough, it's clearly gimbal lock on the official pickup driveshafts. Doing that initial 90° rotation to the prop is messing things up. With the pickup you can clearly see the issue go away if you change from 0,0,90 to 0,0,0. The prop will be misaligned BUT you'll see that it spins correctly AND rotates both up and down and side to side. Correcting the rotation in Blender is possible and will eliminate the gimbal lock but this just introduces new problems. :( Specifically the fact that the refnodes don't really describe the position and orientation of the driveshaft. Leaving the pivot in the lengthwise center of the driveshaft helps mask this, which is probably why it was done in the first place.

    As @Darren9 pointed out getting the refnodes positioned perfectly helps with this, but for the large side-to-side movements you showed up in post #3 I think you'll still have a problem.

    As I understand it refnodes should stay square to one another or bad behavior will occur. That's where the root of the driveshaft misalignment problems seems to lie:
    beamng_driveshaft_refnodes.jpg
    Clearly the upper illustration shows a bad thing, right?
     
  11. CrashHard

    CrashHard
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    1,581
    But it is fixed :D How it looks now (see pic and video)

    Beamng_driveshaft_fix.jpg

    Again thank you all for the help and suggestion. :D
     
    • Like Like x 1
  12. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    Oh wow, that looks great! Thanks for the video and illustration!

    I'm not sure why it works though... As Darren9 and I both mentioned, idY should form a right angle with idRef and idX. Yours forms a straight line (or very close to a straight line?). I don't understand how that works, but I'm glad that it does.
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice