Solved Simple box spawns inside ground

Discussion in 'Mod Support' started by fufsgfen, Jan 19, 2017.

  1. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    I did follow a tutorial here, but made object to be a small box http://www.beamng.com/threads/tutorial-dummiesmans-jbeam-guide-part-7-multidae.13152/

    My box just never learned to spawn above ground, from first moments it was in ground, only 4 top nodes seem to be on surface of ground and if I grab and pull from those nodes box comes to top of the ground and stays there, but it spawns what I would think being negative Z coordinates.

    I'm not entirely sure if positive Y is what would become front, or if that is opposite, I'm quite sure that positive Z should be up.

    Code:
    ["box_bottom_back_left",-0.25,-0.5,0],
                ["box_bottom_back_right",0.25,-0.5,0],
                ["box_bottom_front_right",0.25,0.5,0],
               ["box_bottom_front_left",-0.25,0.5,0],
               ["box_top_back_left",-0.25,-0.5,0.5],
                ["box_top_back_right",0.25,-0.5,0.5],
                ["box_top_front_right",0.25,0.5,0.5],
               ["box_top_front_left",-0.25,0.5,0.5],
    
    I did put mesh to box and it appears inside the nodes, but still box spawns 0.5 meters too low.

    I'm bit surprised that search did not return anything, I guess it would be common beginner mistake which I have made.
     

    Attached Files:

    #1 fufsgfen, Jan 19, 2017
    Last edited: Jan 19, 2017
  2. Inertia

    Inertia
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    1,692
    If you used Blender to model the object, and used it to export the jbeam coordinates, just position the box above the grid. Also I'm pretty sure Beam uses Z as the up axis the same as Blender, I could be wrong.
     
  3. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Thanks from reply, I did input coordinates to jbeam manually, I did read coordinates from blender though and box is above the grid.

    Also I did try to set box 1m higher by editing all Z values +1 in jbeam, but result is same, also if I remove everything else and just have nodes and beams box spawns inside the ground.

    Before the box I made pyramid object like instructed in tutorial, which did spawn correctly. I did clear the cache in hopes of easy solution, but no help.

    Another thing I noticed is that when I pull box out from ground, mesh seems to get offset, this happened earlier too and I set origin in Blender to be center of model, but after clearing cache (which might be unrelated), mesh gets offset again when I pull box out from ground. Can't spot what might be off, I even added one comma after nodes section bracket which was not there in tutorial, but not change from that either, quite stuck with the issue now.

    box_mesh_offset.png
     
  4. Inertia

    Inertia
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    1,692
    Do you want to upload the files here so I can take a look? It would be easier if you could zip the whole thing.
     
  5. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Sure, it is nothing special really, it has slot with part that does nothing, but removing those should not affect the issue as issue began right when I made beams after nodes, even mesh should not have anything to do with that spawning on ground, but if you have time and interest have a look, it is probably something very simple and incredible stupid which I have done, that I just can't figure out :)
     

    Attached Files:

  6. Inertia

    Inertia
    Expand Collapse

    Joined:
    Dec 29, 2015
    Messages:
    1,692
    I took a look, you have no cameras setup so it goes a bit silly when you spawn it, but the only real problem I could see was that you must have forgotten to apply location in blender (CTRL A). It basically sets the origin of the object to 0, 0, 0, (the absolute centre) so that it spawns on the floor, where as you had the origin in the middle of the box, so only half spawned above. It's something I do all the time, nothing to worry about :)
     

    Attached Files:

  7. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Thanks, that helps with mesh staying with the nodes.

    However box still refuses to spawn above the surface of the ground.

    I did just manage to fix it though, I had nodes declared so that bottom ones were declared first, top ones after that. What I did was to swap them around, I declare top nodes first and after that bottom nodes and box spawns correctly. Anyone wishes to guess why such happens and what benefit such has?

    You can compare this to first post to see difference. So there I learned something, order which nodes are declared must be from top to bottom, now I would just remember that in a future :p
    Code:
    ["box_top_back_left",-0.25,-0.5,0.5],
                ["box_top_back_right",0.25,-0.5,0.5],
                ["box_top_front_right",0.25,0.5,0.5],
               ["box_top_front_left",-0.25,0.5,0.5],
               ["box_bottom_back_left",-0.25,-0.5,0],
                ["box_bottom_back_right",0.25,-0.5,0],
                ["box_bottom_front_right",0.25,0.5,0],
               ["box_bottom_front_left",-0.25,0.5,0], 
     
  8. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Oh, thank you so much, this helps a lot, I had missed that information from tutorial or it was not given then, either way, now I feel very much educated and perhaps I can dare to try with more complicated shapes as now I understand much better what is needed to make it work.

    Hopefully this stumbling of mine will help some other newbie in a future, feels so stupid to stumble with such things, but baby must fall n times before managing to take first steps :)
     
    • 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