How do I add new mirrors?

Discussion in 'Content Creation' started by RoofyFEED, Dec 14, 2023.

  1. RoofyFEED

    RoofyFEED
    Expand Collapse

    Joined:
    Apr 23, 2021
    Messages:
    4
    Hello everyone I want to know how to add a new mirror system to my mod? I found a new section in jbeam called "Mirrors", entered it into my mod, but the mirrors did not appear, what am I doing wrong? I also found a new menu in f11 called Mirror debug. (I use a translator)
     
  2. Ai'Torror

    Ai'Torror
    Expand Collapse
    QA, Mod Support, Vehicle Physics
    BeamNG Team

    Joined:
    Aug 29, 2015
    Messages:
    1,572
    Hey,
    Your best bet is to locate one of the mirror files from the new T-series, so lets say us_sem_cabover_mirror.jbeam
    as you've found out theres the "mirrors" section
    It is what defines your mirror
    upload_2023-12-14_22-52-29.png
    As you see first part is the mesh name, this would be the name of your mirror model
    then you have relative ref nodes that are set up same way as props are https://documentation.beamng.com/modding/vehicle/sections/props/
    Next you have translation and rotation parameters which you can copy paste from the debug menu that you've found already.
    Main thing to note is that your mirror surface NEEDS TO use
    Code:
    mirror
    material any other material will not work for mirror surfaces
     
    • Like Like x 3
  3. RoofyFEED

    RoofyFEED
    Expand Collapse

    Joined:
    Apr 23, 2021
    Messages:
    4
    Faced with the problem that the mirrors go down during sharp turns, what could be wrong? (I use a translator)
     
    • Like Like x 1
  4. sibgeorge

    sibgeorge
    Expand Collapse

    Joined:
    Sep 24, 2023
    Messages:
    3
    hi everyone, what should i do to fit reflective surface into a mesh? now i have this
    and also, why does car in a mirror is chrome?
     

    Attached Files:

    • D1E_AqzA1iA.jpg
    #4 sibgeorge, Dec 18, 2023
    Last edited: Dec 18, 2023
  5. MrX13415

    MrX13415
    Expand Collapse

    Joined:
    Mar 1, 2014
    Messages:
    181
    Detailed Mirrors Mini-Tutorial
    Here is a quick tutorial on how to add the detailed mirrors to any car. In this example for the City Bus.

    Add the following section to the JBeam file of your part and change the values accordingly.
    The first parameter is the name of the mirror mesh, followed by reference nodes similar to props.
    The material of the mirror surface needs to be named mirror and for the reference nodes, just use some of the nodes of your part.
    Code:
        "mirrors": [
             ["mesh", "idRef:", "id1:", "id2:"],
             ["citybus_mirror_L","mi3l","mi4l","mi2l",{"refBaseTranslation":{"x":0.12,"y":0.05,"z":0.15},"baseRotationGlobal":{"x":-3.8,"y":0,"z":-10.8},"offsetRotationGlobal":{"x":0,"y":0,"z":-8.5}}],
        ],
    To get the rest of the values, use the Mirror Debug Tool in the World Editor: Press F11 to open the World Editor and open the Vehicle Editor in menu Window > Experimental. Switch to the Live Editor at the top and open Mirror Debug in menu Apps. You can close the World Editor with F11 now, the Mirror Debug window will stay open.
    a.png b.png

    1. Use the X Pos, Y Pos and Z Pos values to position the gizmo on the surface of the mirror.
    2. Use the X nrm, Y nrm and Z nrm values to align the red and blue axis of the gizmo with the surface of the mirror
    3. Use the X Nrm offset, Y Nrm offset and Z Nrm offset values to adjust the viewing angle of the mirror.

    Update the values in the previously added JBeam section of your part: Copy the X Pos, Y Pos and Z Pos values in to refBaseTranslation and enter the already calculated values for baseRotationGlobal and offsetRotationGlobal from the Mirror Debug window.




    If someone is interested, the attached mod adds detailed mirrors to the City Bus and Autobello Stambecco
     

    Attached Files:

    • Like Like x 6
  6. ywyattwhy

    ywyattwhy
    Expand Collapse

    Joined:
    Mar 29, 2024
    Messages:
    10
    Hi I am very dumb can you make it easier for dummies or maybe a video tutorial
     
    • Agree Agree x 1
  7. Jean-Pierre Dupont

    Jean-Pierre Dupont
    Expand Collapse

    Joined:
    May 17, 2021
    Messages:
    1
     
    • 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