Problem with Flexbody position

Discussion in 'Content Creation' started by Unslinga, Sep 25, 2014.

  1. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    A friend of mine (Hilux85) and I are making a M939 military vehicle and I'm having problems with the placement of the flexbody mesh compared to the jbeam, I would expect it to be centered.
    The group is centered in the middle of the railings, and I've had no luck with the transform function.
     

    Attached Files:

    • screenshot_00016.png
  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,696
    Have you defined the 'Ref Nodes' correctly?
    Also, are you sure your mesh has origin point to (0,0,0)?
     
  3. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    Ref node is the bottom of the chassis, but the mesh is still on top.
     
  4. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,696
    Could you try to change the ref node to a node that is closer to the (0,0,0) location. I don't really remember what would cause that, so let's try.
     
  5. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    I already tried that with same result. I'm just wondering, aren't mesh groups supposed to center to the jbeam group?
     
  6. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,958
    is the mesh properly centred in blender/3ds max or whatever? I've seen alot of people have to reset transforms or something before export for it to work in BeamNG or this issue occurs.
     
  7. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    All the groups in the mesh are centered.
     

    Attached Files:

    • Chassis_Center.png
  8. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,958
    Thats what I mean though, there have been issues where the mesh appears centred correctly, but its loaded into game funny and yet reset the transforms has fixed it.

    I think its because every part has an origin that its position is relative to and that part origin isnt always the 0,0,0 that it should be.
     
  9. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,696
    Your mesh origin isn't set up correctly.

    1) Go to Edit > Transform Toolbox

    (imported from here)
    2) Click "Origin" in the align pivot area with objects selected

    (imported from here)

    3) Reset your XForms (select all objects first)

    (imported from here)
    If you're modifiers has XForm you should be good to go!

    (imported from here)

    If the export comes out incorrectly again, you can also try changing the up axis

    (imported from here)

    Hope it helped!
     
    #9 Dummiesman, Sep 25, 2014
    Last edited by a moderator: Sep 25, 2014
  10. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    We've pretty much gotten it center now, but I'm still unsure of how the whole group center works. I thought the center of each mesh group would be in the center of each jbeam group.

    Hilux is using blender to model the truck.


    Also, does anyone know why the texture darkens?
     

    Attached Files:

    • screenshot_00018.png
    • screenshot_00019.png
    #10 Unslinga, Sep 25, 2014
    Last edited: Sep 25, 2014
  11. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,696
    If you just moved it in 3dsmax till it was "center" then you have dnoe it wrong.

    Anyways, materials.cs in the vehicle directory will contain the colors for the material.
     
  12. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    Ok, so I found the materials.cs in the cache folder, deleted that and the dts, then changed the settings. Worked.

    Now need to figure out if things are properly alligned.

    Correct me if I'm wrong, but the visible mesh will always be in the same position, so you have to build the jbeam around it? I can't seem to move parts around.
    then how does things move apart from eachother?
     
  13. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,696
    The base position of the mesh is determined by the ref nodes. After that it should not need to be moved, so yeah you build the jbeam around it.
     
  14. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    I'm still failing to understand how flexbodies work, and I'm not grasping the concept of groups.

    I've got the mesh frame grouped to the jbeam frame group, but my problem is that the front axle mesh, even tho I have another group for the axle jbeam, is still somehow stuck on the frame, with no movement for the jbeam.

    Please do excuse my load of questions, but it's for a great cause.
     

    Attached Files:

    • screenshot_00021.png
    • screenshot_00022.png
  15. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,696
    //axle nodes
    {"group":"axleGroup"},
    ["axleNode1",0,0,0],
    ["axleNode2",0,0,0],
    ["axleNode3",0,0,0],
    ["axleNode4",0,0,0],
    ["axleNode5",0,0,0],
    ["axleNode6",0,0,0],
    {"group":"none"},
    //structure nodes that wont affect stuff

    //frame nodes
    {"group":"frame"},


    Basically you set the axle group for axle nodes, therefore making the flexbody "axle" assigned to the group, and only those nodes will affect the mesh.
     
  16. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    I still can't get it to work tho. and I've got no idea why.

    m939.jbeam:
    Frame mesh:
    Code:
    ["mesh", "[group]:", "nonFlexMaterials"],
    //frame
    ["Frame_NWB", ["chassis_rails"]],
    
    Frame beam:
    Code:
    ////////////////////////////////////////////////////////////
    {"group":"chassis_rails"}
    {"nodeWeight":50.0},
    //segment 1
     ["chassis_1_L_U",0.4318,-3.6576,0.1143]
    ...
    {"group":""}
    ////////////////////////////////////////////////////////////
    
    m939_front_suspension.jbeam:
    Axle mesh:
    Code:
    ["mesh", "[group]:", "nonFlexMaterials"],
    ["Axle_f", ["front_axle_group"]],
    
    Axle beam:
    Code:
    ////////////////////////////////////////////////////////////
    {"group":"front_axle_group"}
    ["axle_F_M_C",0,-2.667,-0.3302]
    ...
    {"group":""}
    ////////////////////////////////////////////////////////////
    

    Update:

    I've pretty much fiddled around with everything now, and I can't get the visual front axle to move with the jbeam front axle, I'm in desperate need of help!
     
    #16 Unslinga, Sep 27, 2014
    Last edited: Oct 1, 2014
  17. Unslinga

    Unslinga
    Expand Collapse

    Joined:
    Jun 9, 2013
    Messages:
    43
    Making a new post to get some attention, please excuse the double post.

    The mesh issue has not been resolved as explained per the last two posts, I'm making it in the experimental version, but it still doesn't explain why the axle mesh won't move separately from the frame mesh. I've tried everything I know of so far, but with no luck.
     
  18. Goosah

    Goosah
    Expand Collapse
    Global Moderator
    BeamNG Team

    Joined:
    Aug 30, 2013
    Messages:
    790
    Just to re-iterate, all mesh parts should have their origins (or pivots) at 0,0,0 and then xforms reset. then, where the mesh is in reference to the origin should be the same as where the jbeam is with respect to its origin. So say the nodes at the end of your chassis are (5,6,7) then the end of the chassis mesh should be at (5,6,7) in the modelling program. If your xforms arent reset then even if the chassis appears in teh correct place, as soon as the object moves in BeamNG the mesh will start shifting around and won't appear locked down to the jbeam.

    What I do in 3dsmax is:

    Save first! Reset xforms cannot be undone and sometimes it messes up!

    1.) Select all parts, click in the heirarchy tab on the right, select "affect pivot only"

    2.) use the "select and move" transform to place all pivots at 0,0,0

    3.) alt+rightclick, choose freeze transform, the freeze rotation, then transform to zero, then rotation to zero

    4.) In the utilities tab, click reset xforms, reset selected.



    I don't see the problems in your snippets of code but it should look like this for example, looking in a jbeam from my car project called ke17_suspension_R.jbeam

    {
    "ke17_axle_R": {
    "information":{
    }
    "slotType" : "ke17_suspension_R",
    "slots": [
    ],
    "flexbodies": [
    ["mesh", "[group]:", "nonFlexMaterials"],
    //rear axle
    ["ke17_hub_R", ["wheelhub_RR", "wheelhub_RL", "ke17_axle_R","ke17_rearshockmounts"]],
    ["ke17_axle_R", ["wheelhub_RR", "wheelhub_RL", "ke17_axle_R","ke17_rearshockmounts"]],
    ],
    "nodes": [
    {"group":"ke17_axle_R"},
    ...
    {"group":"ke17_rearshockmounts"},
    ...
    {"group":""},
    ],

    "beams": [
    ...
    ],
    "hubWheels": [
    ["name","group","node1:","node2:","nodeS","nodeArm:","wheelDir"],
    {"propulsed":0}
    ],
    "triangles": [
    ["id1:","id2:","id3:"],

    ],
    }

    3rd edit: if you are wondering, wheelhub_RR and wheelhub_RL groups are defined in the wheels jbeam
     
    #18 Goosah, Oct 8, 2014
    Last edited: Oct 8, 2014
  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