3D editing is possible

A private forum for those folks working on patches for RRT3.
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

3D editing is possible Unread post

Well, I have exciting news to report!

Hex-editing of 3DP files is capable of reshaping the model, not just remapping skin coordinates but actually doing things like lengthen a steam engine's boiler or shift a wheel forward or back. It is VERY tedious to do so, but with patience and perseverance, you can achieve some remarkable things.

My current project is to produce a Norfolk & Western Class A 2-6-6-4, so as to complete my trilogy of famous N&W steam. I got into this based on looking at the Red Devil's nice long boiler, and wondering if it would make a decent articulated engine. I used Bombardier's techniques to add in the Challenger's front truck, and the result was pretty good - but not quite right. The wheels were a little bit big and not a match for the rear driver set, and there was a big gap between the front of the smokebox and the pilot deck. If only there was a way to move a few of those points...

Well, if you look at the 3DP file in a hex editor, there is a section in the first half where all of the points are declared with X, Y, and Z coordinates; this is right after an integer declaration of how many points are in the model, then how many faces. For remapping the skin coordinates, the faces are what you are concerned with. However, for reshaping the 3DP, you want to change those X, Y, or Z values.

"Reshaping" includes such things as moving a wheel forward; you're not really changing the shape of the wheel, you're just giving it new Y values. Write down the hex code for the Y-value at each corner, as well as at the pivot point. Next, use a conversion tool to determine what the "real world" decimal value is for each point. Then, determine how far it needs to move. This is where the guesswork comes in, although if you can find an object with a feature that has the right Y-value then you can just copy from that. In my case, the challenger's front truck had the front-most axle in the right spot, so by seeing that its axle was at, say, -31.5 (I'm making this up, I don't recall the real value), compared to the smaller wheel I'd like to use, which has an axle with Y-value of -10.4, I can tell that I need to change every Y-value by -21.1. Determine the new decimal value for each point, use a conversion tool to figure out the hex code for that value, and edit the 3DP accordingly.

I stretched the boiler on my steam engine by similar means, although figuring out which points to edit is immensely difficult on a _Body.3DP file; it contains literally hundreds of points. By changing an X-value to an absurd value, like 30 or so (to give an idea of scale, the wheels are set about 6.5 units apart), for just one point, then loading the model in-game, you can see which point you've affected because the model will be warped. Using this technique you can hunt around, about every four points or so, until you find the set of points you need. Murphy's law came through for me, in that I ended up mapping almost the entire engine body in this manner, before I got to the smokebox front, right at the end of the points declarations.

The nice thing about the smokebox, though, was that, at least in this case, all the points in question had the same Y-value. Once I had figured out what the original Y-value was, added the 6 or so units of length I wanted, then all I had to do was a "replace" function to change all the instances of the old Y-value with the new. Presto - a new longer boiler! No more giant gap!

Now, I am doing the same thing in order to move the cylinders back to align with the rear driver set. Yes, this is immensely complex. In any kind of 3D editing tool it would be a simple operation "move 5 feet in the +Y direction". So, doing major _Body edits is probably out of the question, though I can still see a few simpler ones in my future - a simple stretch of the frame of a GP-35 can yield an SD-40, to ride on the FP-45's trucks. The diesel bodies are not quite as complex, at least I think so.

But it is VERY useful and straightforward for the simple components, like wheels. You can just take a wheel that you like, based on size, and move it forward and back to fit the engine's body, by just changing 5 Y-values. This means, as well, that a given driver set can be extended... like, if you were to try to model a 4-12-2. There are no 12-driver sets in the game, but you can take an 8 or 10 driver set and extend it by adding bogies and transforming their Y-values by whatever amount of displacement there is between the other wheels - compare the center points.

And yes, this would apply to buildings and any other asset in the game that is defined by 3DP file(s). However, these do not break down into simple components like individual wheels, so you'd be forced to map out the whole set of points. It is very cumbersome - I spent all day Sunday just mapping out the RedDevil_Body.3DP file.

Keep watching these forums; I'll soon have a Class A worth looking at, and it will be utterly unique.
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

Re: 3D editing is possible Unread post

Hey, another thing I realize is possible is to do multiple-car sets. Like, making one hopper look like two. Then, you could theoretically run a train of 16 cars, which would look much better. How would you do this?

Well, you'd have to translate the Y-values of every point in the car's _body file, actually twice. Once, you'd move everything forward by half a car length, and second time you move it back by the same amount. Then, you just save each modified body as if it were a truck assembly. You'd also need to take the car's original trucks, copy and paste in their points and faces as part of the body (what you are now calling the truck), and you'd essentially have fixed trucks and wheels that no longer either swivel or roll. But, the two "cars" would swivel since they are now acting as trucks. Then, all you need is a _body to unify them, and this could be as simple as just a little coupler-looking block... at least I think so! I don't know if the body needs to have points declare where the trucks attach; I think not, since we've been able to freely mix and match trucks and bogies to do all the loco mods that have been done already. Final thing needed would be an appropriate LengthPoint file, which might have to be hex edited if there is not already one that is as long as two cars.

This whole conjecture seems like it would only really work with short cars; on longer ones it would probably look awkward, at best. But for little iron ore hoppers, it would be fairly convincing, I think. If you want to see an implementation of this, you can just look at the EP-2 Bipolar; the front and rear portions of its "body" are really just "trucks".

I don't know if one could do more than 2 cars with this method, but I have a hunch that more is possible. I've successfully added features to cars by calling the new element "truck3", so I think that, like the bogies, all you gotta do is number them sequentially. However, I don't know whether the trucks would stay on track or if they would overhang with the long invisible _body when going around curves.

I still have plenty to do in other regards, so I probably won't follow up on this for a while. But it seems like there may be an open door to long strings of 16 or 24 hoppers, if anyone wants to give it a try!
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
User avatar
pure al
Dispatcher
Posts: 306
Joined: Sat Dec 23, 2006 11:38 am
Location: British Rail Class 450

Re: 3D editing is possible Unread post

Hex editing a 3D file really shows enthusiasm! Maybe sign-up to blenderartists.org and ask someone for help with a 3DP exporter for Blender? I assure you it can be done easily by someone who knows what they’re doing.
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

Re: 3D editing is possible Unread post

Milo said long ago that he made something to read them into Blender, but not to go back out to 3DP; the problem was the iterations of "INST" segments in the file. However, the declaration of X,Y,Z values for points is just one portion of the file, and maybe this could be isolated out, edited, then re-pasted back in.

The bigger transformations, such as anything done to a _Body file, are really taxing via hex editor. However, components like bogies and trucks are really not difficult at all.

If I could have the 3D export/import tool of my choice, it would go to and from SketchUp. This is a simple tool that would work well with these simple models. Basically, all we are talking about is an interface for the operation "Select This Set of Points - Change Their Y-Values by +5 - Write New Floating Point Values", which in SketchUp is basically just a mouse gesture; the way I'm doing it now, it is laborious recording (pen on paper) of each Y coordinate, calculating what the new value should be, then typing in the replacement hex code. Of course, hex editing doesn't require any conversion back and forth; you make a change and test it immediately in-game.
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

Re: 3D editing is possible Unread post

Here is a progress shot of my N&W Class A 2-6-6-4. I've got a little more skinning to do, including the entire tender, but it is really coming along nicely. I've found a much better Hex Editor, called "Tiny Hexer", which offers a Structure Viewer which lets you edit the floating point numbers directly. One thing I want to try someday is to flip a unit backwards... N&W liked to run diesels long hood forward, so I think the GP-7 should be a first candidate. All it will take is to make each X and Y coordinate into the negative of itself, and doing so will be easy (if tedious) using Tiny Hexer.

This project is more complex than I expected it to be, but then I figured I might as well set the bar high. With dedication and perseverance, all kinds of mods are possible. I'm looking forward to some simpler transformations, such as stretching the frame of the GP-35 to produce an SD-40. And, of course, now I'm thinking of doing a much more complete N&W overhaul, with skins for the diesels and freight cars and more.
Attachments
In-progress Class A
In-progress Class A
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
User avatar
nedfumpkin
CEO
Posts: 2163
Joined: Sat Feb 16, 2008 9:16 pm
Location: Hamilton - Canada

Re: 3D editing is possible Unread post

It looks really, really good. I am following your progress closely because I may want to dabble in that after I have all the things I'm working on now completed. The TH&B had a gas-electric locomotive that I might want to try when I am making the scenario.
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

Re: 3D editing is possible Unread post

For those of you that want to try to learn how to do what I am doing, I have added a segment to my web page to describe the 3DP file structure; this is based on PJay's notes from when he cracked it, but I guess he never exploited his discovery. Thanks go to Bombardiere for sharing this info with me! If there is anything about it that leaves you in more than just a mild state of confusion, let me know, I can add some clarification to my page.

Go to:
http://wpandp.com/CarModHowTo.html

This page includes my description of doing car mods just based on skin editing and recombination of elements; the 3D editing is down below. Obviously, together they make a lot of things possible... for instance, changing the Dining Car to look like a boat-tailed observation car (I mention this example because I'm hoping someone else will jump on it and make it happen!). Just don't take on a 3DP editing project without counting on it taking a nice long time; I'm 2 weeks into my Class-A and there's plenty still left to do.
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
User avatar
WPandP
Engineer
Posts: 762
Joined: Tue Sep 11, 2007 5:16 pm
Location: Cincinnati, Ohio
Contact:

Re: 3D editing is possible Unread post

Here is a little graphic I whipped up to explain a little about how this can be exploited. When I started my Class A, what I was looking to do was a light mallet, like a USRA 2-6-6-2, and I tried the Challenger's front truck with the Red Devil's long boiler, which *almost* looked right. I noticed the similar proportions to the Class A, though, so I had to go in that direction.

However, a 2-6-6-2 is still relatively achievable, and this is how I'd go about it. Rather than blending parts from 2 or three locomotives (as I did), you could just edit the parts of one loco, and thus not have to do all the remapping of skin file coordinates that I am now doing. The trick is, you have to create Truck1 (the swiveling front driver assembly) out of the Body file, by reducing it down to just the parts (like the cylinders and pilot) that will remain on the truck, and eliminate those same parts from the original body. The other edits to the body, such as lengthening the boiler, are exactly what I've done with my Class A, and they take a lot of time. But with perseverance, this kind of project is achievable.
Attachments
How to stretch a Mikado into a Mallet
How to stretch a Mikado into a Mallet
=Winchester, Paston & Portsmouth=
====== We Provide Pride! ======
Post Reply