Locomotive Matrix Editing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ColeWix88
    Member
    • Oct 2024
    • 34
    • Pacific Northwest
    • MSOR

    #1

    Locomotive Matrix Editing

    I'm currently in the process of updating the textures, physics and sounds on the Maple Leaf Tracks SP locomotives to match up well with the locomotives from the Shasta addon in both color and function. Getting the textures and everything else redone is going well, however there's one thing I would like to fix on these locomotives, and the included caboose and that is the ride height. The locomotives and caboose from the MLT packs are sitting noticeably lower than the newer locomotives that come with the Shasta addon, and correcting this would go lengths in terms of bringing the MLT stock up to date. However when attempting to alter the height in the shape file, the locomotive body itself remains unaffected by the changes made to the matrix entry. The wheels and bogeys however adjust to the changes made just fine.

    Is there a way around this that I'm missing, or does Open Rails not necessarily allow for the main body of an asset to be moved like this?

    RunActivity 2025-09-08 08-45-47.png RunActivity 2025-09-08 08-42-24.png RunActivity 2025-09-05 09-41-33.png
  • pschlik
    Senior Member



    • Jun 2011
    • 289
    • Missouri
    • MSOR

    #2
    Fun (not so fun for this situation) fact: OR is specifically programmed to ignore any changes made to the transform matrix of the MAIN shape body, instead always overwriting that data with an identity matrix. I can only assume this was done to replicate some sort of MSTS behavior, though nobody truly knows how MSTS functions.

    Now I was working on a feature that would allow for more manipulation of shapes, including changing those matrices, through the .sd file so that the original shape didn't have to be edited. That would include changing the position of the main body, which would 'flip a switch' so to speak that would allow the MAIN matrix to be something other than an identity matrix. There's not a great way to do that without adding a new feature like this, as I'm sure allowing non-identity matrices in MAIN all the time would break many more things than it would fix.

    The problem is that feature set is not going to be part of 1.6 and has been stuck in a sort of limbo for quite some time now. The management team gets concerned when you mess with MSTS file formats and give users direct control over anything...not that editing the shape file itself is any different (except you still can't solve your problem with that method). But this is yet another thread where my additions to the .sd file would perfectly solve the problem at hand. Hopefully that's ammo for my case that the features are useful and solve problems, and it's not just arbitrarily giving people new and fun ways to break things.

    Contributing to ORTS since 2023
    Find me on GitHub @SteelFill

    Like what I do? Join my Patreon to help me do more!

    Comment

    • ColeWix88
      Member
      • Oct 2024
      • 34
      • Pacific Northwest
      • MSOR

      #3
      That's good to know I appreciate the insight! So essentially for the time being, this isn't something that's modifiable is what I'm understanding? It's interesting how on both ends of the spectrum, matrix editing for the main shape is uneventful. Since if you also try to shift the shape in SFM it ends up stretching out the wheels, making for unsuccessful results with both methods.

      Comment

      • lineman
        Senior Member

        • Mar 2007
        • 539
        • Phoenix AZ
        • General

        #4
        The closest you can get is to manually edit the matrix for the bogies and raise them to get the wheels on top oif the rails.

        Comment

        • jbtower
          Senior Member


          • Jul 2005
          • 572
          • Yorkville, Illinois, USA.
          • ORTS

          #5
          Bogies=British, European, etc
          Trucks=American, Canadian, etc
          Kevin Kelleher

          Comment

          • kraus
            1000 Post Veteran

            • Jan 2001
            • 1086
            • Madison, Wisconsin
            • General

            #6
            To alter the height of the main shape body only some of the points need to be altered. The difficult part is identifying which points. The primitive elements link matrix and point. From primitive to prim_state to vtx_state to matrix. And from primitive to vertex to point. Below are some more notes:

            matrix

            vtx_state, linked by matrixIdx

            prim_state, linked by vertStateIdx

            lod_controls\lod_control\distance_levels\distance_ level\sub_objects\sub_object\primitives, is linked by prim_state_idx

            find vertex in indexed_trilist\vertex_ids\vertexIdx

            find matching vertex in vertices\vertex which links to point by pointIdx

            points in points\point

            Would a tool that altered some of the points be useful?

            Comment

            • SD40-2
              1000 Post Veteran


              • May 2010
              • 1011
              • Metairie, Louisiana
              • English, C++, HTML
              • General

              #7
              Originally posted by kraus

              Would a tool that altered some of the points be useful?
              Yes, I think so, at least for me. I have a locomotive in a similar predicament, I just need to move it down just a bit.
              Parker B. - A Misplaced Midwesterner.
              Also known as Mr. Two Bits and Mr. Squarewheels.

              Comment

              • emd645e3c
                Senior Member

                • Sep 2007
                • 250
                • .

                #8
                Originally posted by SD40-2

                Yes, I think so, at least for me. I have a locomotive in a similar predicament, I just need to move it down just a bit.
                If people just want to move the model up/down to get the wheels on the rail, doesn't Shape File Manager do this ?

                Steve

                Comment

                • superheatedsteam
                  Senior Member


                  • Jun 2004
                  • 764
                  • Perth, WA, Australia.

                  #9
                  If you are going to alter the geometry of a model, why not just use one of the .S conversion tools so that you can import the model into a 3D modelling program, make the desired adjustments and re-export the 'fixed' .S file. Same end result without the hassle.

                  Cheers,

                  Marek.

                  Comment

                  • kraus
                    1000 Post Veteran

                    • Jan 2001
                    • 1086
                    • Madison, Wisconsin
                    • General

                    #10
                    Sometimes you don't have permission to distribute an altered shape file. A tool where you could tell it to lower the main shape by 0.1cm could be included in the distribution instructions. Shape File Manager alters all the points of the model.

                    Comment

                    • baldwin
                      6000 Post Veteran


                      • Nov 1999
                      • 6358
                      • Chippenham, Wiltshire, UK.
                      • ORTS

                      #11
                      Beyond my paygrade, but would a simple shift in the origin point do the job.
                      Beer is not a matter of life or death, it is much more serious than that.

                      Comment

                      • ColeWix88
                        Member
                        • Oct 2024
                        • 34
                        • Pacific Northwest
                        • MSOR

                        #12
                        Originally posted by emd645e3c

                        If people just want to move the model up/down to get the wheels on the rail, doesn't Shape File Manager do this ?

                        Steve
                        From my experience SFM does allow you to shift an object up and down, however it stretches the wheels out so they become unaligned and don't rotate on their center. So the results are less than optimal.

                        Comment

                        • pschlik
                          Senior Member



                          • Jun 2011
                          • 289
                          • Missouri
                          • MSOR

                          #13
                          Editing the vertex data of the shape would work but that does make it a lot harder for anyone 'at home' to follow along with the shape editing process. Ripping and re-exporting the model is further beyond the limit of practicality. If I saw a reskin telling me to go into blender that's about when I'd give up!

                          Contributing to ORTS since 2023
                          Find me on GitHub @SteelFill

                          Like what I do? Join my Patreon to help me do more!

                          Comment

                          • ColeWix88
                            Member
                            • Oct 2024
                            • 34
                            • Pacific Northwest
                            • MSOR

                            #14
                            Originally posted by pschlik
                            Editing the vertex data of the shape would work but that does make it a lot harder for anyone 'at home' to follow along with the shape editing process. Ripping and re-exporting the model is further beyond the limit of practicality. If I saw a reskin telling me to go into blender that's about when I'd give up!
                            Yeah, best case scenario would be for me to attach simple instructions in a reskin folder that would allow people to make the small edits necessary. But to get the results I'm after, it seems the best option would be to raise the locomotive body in Blender and export the new shape.

                            Comment

                            • Erick_Cantu
                              1000 Post Veteran


                              • Jun 2004
                              • 1041
                              • Brighton, MA 02135
                              • General

                              #15
                              Your best bet at this point is to build a new model and map it to the old textures. Sorry if it's not a quick fix, but you'll be more skilled for it.
                              Erick Cantu
                              North American V-Scale
                              Facebook | Email
                              Those who would give up essential liberty, to purchase a little gasoline, deserve neither liberty nor gasoline.

                              Comment

                              Working...