Suggestion: Mirrored face command
5 posters
Page 1 of 1
Suggestion: Mirrored face command
This post here https://bveworldwide.forumotion.com/t1474-a-small-wip-teaser#16020 made me think. Wouldn't it be sensible to add a command for faces interpreted the other way round, something along the lines of RevFace or similar? While using 3D editors like Blender can safely be assumed to be the long-term future, hand-coding won't disappear anytime soon. A mirrored face command would, I guess, streamline and ease the manual process a lot with negligible preloading time impact and absolutely no performance impact in-sim.
Quork- Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union
Re: Suggestion: Mirrored face command
I am not sure I get the point correctly, but if so, you can already do this.
You can use:
You can use:
- AddFace2,0,1,2,3 (shows both sides of the face, but with incorrect lighting)
- AddFace,0,1,2,3 + AddFace,3,2,1,0 in the same MeshBuilder section, which creates correct lighting
Re: Suggestion: Mirrored face command
I think Quork meant the texture was to be flipped horizontally, same as swapping the co-ordinate values.
Re: Suggestion: Mirrored face command
Wrong and wrong. I was thinking along the lines of RevFace,0,1,2,3 = AddFace,3,2,1,0. This would make it way easier to mirror one vehicle side to the other. "Replace all 'AddFace' in selection with 'RevFace'" can be done with few clicks in any text editor. Reversing the vertices in the AddFace command on the other hand is tedious, manual, non automatisable labour.
Quork- Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union
Re: Suggestion: Mirrored face command
But you still need to set some parameters... how far in width you need the face to be displayed etc. RevFace on its own would not help, as you would still need to take into account - OK, this vehicle is 2.5 meters wide, so the RevFace needs to be placed elsewhwre than the AddFace...
And if you think reverting faces is tedious, try building custom length curved rail / switch.
Re: Suggestion: Mirrored face command
You'd copy the whole code for one vehicle side into a new MeshBuilder, multiply all x coordinates with -1 (can be automated in any csv editor) - and then you'd simply replace all AddFace with RevFace instead of editing all faces manually. Of course you'd need manual adjustments still for nonsymmetrical parts (text etc.), but the biggest part of the work would be way easier.
Quork- Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union
Re: Suggestion: Mirrored face command
I just either flip faces (0,1,2,3 becomes 3,2,1,0, 1,4,5,2 becomes 2,5,4,1 (that's a special "knitting" technique for complex objects in the second example - makes keeping track of what's happening waaaay easier), these "normal face" and "flipped face" sequences are usually repeating and after some time you just remember them and write "2,5,4,1" or so almost subconsciously) or swap vertex coordinates. I don't think we need this command, but some tool to automate the process would be very handy.
Delsin- Posts : 313
Join date : 2016-08-20
Re: Suggestion: Mirrored face command
It'd be relatively trivial to run up an app which reverses *all* the face statements in any given file, but doing it in a more fine-grained manner would be more problematic.
RevFace is an interesting concept, but it feels to me like a solution looking for a problem....
A more interesting concept I've thought of on a tangent though is a specific Mirror command for use in object files.
Something like this:
I've used Smace's convertor for this a large amount, and I suspect others have too.
Will play with some prototyping tomorrow and see what I get.
RevFace is an interesting concept, but it feels to me like a solution looking for a problem....
A more interesting concept I've thought of on a tangent though is a specific Mirror command for use in object files.
Something like this:
Mirror X,Y,Z,Normals
Where each parameter (X, Y, Z.....) is either 1 for true or 0 for false
I've used Smace's convertor for this a large amount, and I suspect others have too.
Will play with some prototyping tomorrow and see what I get.
Re: Suggestion: Mirrored face command
I wasn't aware of the mentioned converter, if that's automating face flipping then, indeed, the problem I was thinking to solve isn't nearly as bad as I thought it is. Also it seems most don't consider the flipping process as tedious as I do - I'd be less than thrilled to do it manually for a 100+ face object, but the fact is, I haven't done anything that complex, so naturally I'm less competent on that field than you guys.
The mirror command sounds really interesting, as it'd allow for mirroring over diagonals as well. That's certainly more versatile. I'd add an optional fifth parameter though - a new texture file path. That'd allow for using the command for objects which are symmetrical as far as the mesh is concerned, but not in texture.
The mirror command sounds really interesting, as it'd allow for mirroring over diagonals as well. That's certainly more versatile. I'd add an optional fifth parameter though - a new texture file path. That'd allow for using the command for objects which are symmetrical as far as the mesh is concerned, but not in texture.
Quork- Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union
Re: Suggestion: Mirrored face command
Texture editing is more of a PITA I'm afraid.
What you need to remember is that the file cascades downwards, and so the texture has no knowledge (per-se) that the face above it has been mirrored.
I've implemented basic mirroring for this build:
https://vps.bvecornwall.co.uk/OpenBVE/Builds/OpenBVE-2018-02-06.zip
Usage:
I've tested it with some reasonably complex loco parts, and this appears to work as expected, but anyone else testing would be interesting
What you need to remember is that the file cascades downwards, and so the texture has no knowledge (per-se) that the face above it has been mirrored.
I've implemented basic mirroring for this build:
https://vps.bvecornwall.co.uk/OpenBVE/Builds/OpenBVE-2018-02-06.zip
Usage:
Mirror X, Y, Z, nX, nY, nZ
X - Vertex X co-ordinates
Y - Vertex Y co-ordinates
Z - Vertex Z co-ordinates
nX - Vertex normal X co-ordinates
nY - Vertex normal Y co-ordinates
nZ - Vertex normal Z co-ordinates
Each parameter must either be 0 - False, or 1 - True.
If nX, nY and nZ are omitted, it is assumed that the normals are to be processed identically to the vertex. If one (or more) of these is set, it is assumed that the others are 0 - False.
MirrorAll X, Y, Z, nX, nY, nZ
This command behaves identically to Mirror, but is applied to all previous faces declared in the object
I've tested it with some reasonably complex loco parts, and this appears to work as expected, but anyone else testing would be interesting
Re: Suggestion: Mirrored face command
To make a mirror version of an object, you'll still have to repeat its code and then apply mirroring to it. So you can simply change texture name in the copy-pasted code and have a mirrored object with different texture.
Never heard of this converter, where can I get it? Googling didn't give any results.
Speaking of *All commands, I thought it'd be helpful for building complex models to have a command doing a translation/rotation/mirroring/etc on all objects within some range defined by some kind of brackets (similar to a*3 + b*3 + c*3 vs (a+b+c)*3 in math equations) or set by number in the command itself (n objects before the command, 1 by default)
Never heard of this converter, where can I get it? Googling didn't give any results.
Speaking of *All commands, I thought it'd be helpful for building complex models to have a command doing a translation/rotation/mirroring/etc on all objects within some range defined by some kind of brackets (similar to a*3 + b*3 + c*3 vs (a+b+c)*3 in math equations) or set by number in the command itself (n objects before the command, 1 by default)
Delsin- Posts : 313
Join date : 2016-08-20
Re: Suggestion: Mirrored face command
Delsin wrote:To make a mirror version of an object, you'll still have to repeat its code and then apply mirroring to it. So you can simply change texture name in the copy-pasted code and have a mirrored object with different texture.
Never heard of this converter, where can I get it? Googling didn't give any results.
Speaking of *All commands, I thought it'd be helpful for building complex models to have a command doing a translation/rotation/mirroring/etc on all objects within some range defined by some kind of brackets (similar to a*3 + b*3 + c*3 vs (a+b+c)*3 in math equations) or set by number in the command itself (n objects before the command, 1 by default)
Both versions of the convertor attached.
These data from ~2002 or so (The file dates say 2003 and 2004, but I think they're actually older than that)
Does rotation, moving, scaling and mirroring- V3 introduces per-axis scaling, but conversion between formats is disabled. (IIRC the conversion to X and vice-versa was never written anyway)
Smace (Sanford Mace) was one of the original pioneers of BVE1 / BVE2, but vanished rather suddenly. If something unusual could be done, he'd probably tried it
- Attachments
Re: Suggestion: Mirrored face command
Ahh, the times when I already had a bunch of train design ideas, but never knew of BVE until 10 years later thanks!
Delsin- Posts : 313
Join date : 2016-08-20
Similar topics
» The Face and Face2 Commands
» Displaying a non-planar face
» New UI suggestion
» One complex face vs. several simpler faces
» Suggestion: Improvement of Bug report to Forum
» Displaying a non-planar face
» New UI suggestion
» One complex face vs. several simpler faces
» Suggestion: Improvement of Bug report to Forum
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum