Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to modify the bent viaduct
#1
NPNT, so I put image for easier reference:

This is the original viaduct:

[Image: straightviaduct.png]


And this is the bent viaduct after using object bender.


[Image: 150radiusbend.png]


Well, I know I have to adjust something in the bulk of codes in order NOT to show so many viaduct "gaps" thing but where is the part to edit?
Reply
#2
What do you mean viaduct gaps?
Mark4211
Hi there! I am a railway technology enthusiast.

North South Line for openBVE [NB: MSP - AMK]
Reply
#3
(25 August 2011, 02:01 PM)Mark4211 Wrote:   Show/Hide

See the point I have black rectangled it:


[Image: difft.png]


The code for the sector is:


CreateMeshBuilder,
AddVertex, -1.1, -1.175, 0
AddVertex, -1.1, -1.175, 25
AddVertex, -0.75, -2.1, 25
AddVertex, -0.75, -2.1, 0
AddFace2, 3, 2, 1, 0
LoadTexture, Viaduct.png
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1

But if I use ObjectBender, I have to split them using 5m segment and becomes


CreateMeshBuilder,
AddVertex, -1.1, -1.175, 0
AddVertex, -1.1, -1.175, 5
AddVertex, -0.75, -2.1, 5
AddVertex, -0.75, -2.1, 0
AddFace2, 3, 2, 1, 0
LoadTexture, Viaduct.png
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1

Hence, with some adjustments pertaining to the bend, I have 5 times showing this image compared to the original one which is an unintended consequence.
Reply
#4
(25 August 2011, 02:58 PM)Samuel Lee Wrote:   Show/Hide

radius?

EDIT: i think its not possible unless everything is 5cm.
Mark4211
Hi there! I am a railway technology enthusiast.

North South Line for openBVE [NB: MSP - AMK]
Reply
#5
You mean u split the viaduct in to 5 parts? Then I u dun wan so many gaps, must well slip the image into 5 also... Each part 1 image
- SMB142J -
Founder, President & Chief Developer, SMB142J Studio Productions
Reply
#6
CreateMeshBuilder,
AddVertex, -1.1, -1.175, 0
AddVertex, -1.1, -1.175, 5
AddVertex, -0.75, -2.1, 5
AddVertex, -0.75, -2.1, 0
AddFace2, 3, 2, 1, 0
LoadTexture, Viaduct.png
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 0.2, 0
SetTextureCoordinates, 2, 0.2, 0.2
SetTextureCoordinates, 3, 0, 0.2
Modify to that manually for each of the 5m segment.

First 5m use the above.
Next 5m use:
SetTextureCoordinates, 0, 0.2, 0.2
SetTextureCoordinates, 1, 0.4, 0.2
SetTextureCoordinates, 2, 0.4, 0.4
SetTextureCoordinates, 3, 0.2, 0.4

and so on...

[EDIT] Wait, can you post an image of the viaduct image?
- Flip
/人◕ ‿‿ ◕人\
Reply
#7
(25 August 2011, 06:34 PM)Flip Wrote:   Show/Hide
Thanks. There you go the exact image:

[Image: viaduct.png]
Reply
#8
(25 August 2011, 07:18 PM)Samuel Lee Wrote:   Show/Hide

First 5m:
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 0.2, 0
SetTextureCoordinates, 2, 0.2, 1
SetTextureCoordinates, 3, 0, 1

Second 5m:
SetTextureCoordinates, 0, 0.2, 0
SetTextureCoordinates, 1, 0.4, 0
SetTextureCoordinates, 2, 0.4, 1
SetTextureCoordinates, 3, 0.2, 1

Third 5m:
SetTextureCoordinates, 0, 0.4, 0
SetTextureCoordinates, 1, 0.6, 0
SetTextureCoordinates, 2, 0.6, 1
SetTextureCoordinates, 3, 0.4, 1

Fourth 5m:
SetTextureCoordinates, 0, 0.6, 0
SetTextureCoordinates, 1, 0.8, 0
SetTextureCoordinates, 2, 0.8, 1
SetTextureCoordinates, 3, 0.6, 1

Last 5m:
SetTextureCoordinates, 0, 0.8, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0.8, 1
- Flip
/人◕ ‿‿ ◕人\
[-] The following 1 user Likes Flip's post:
  • Mark4211
Reply
#9
5 x 5m segments? Do this:

Code:
; ballast
CreateMeshBuilder
AddVertex,-1,-0.2,0
AddVertex,-1,-0.2,5
AddVertex,1,-0.2,5
AddVertex,1,-0.2,0
AddFace,0,1,2,3
LoadTexture,ballast.png
SetTextureCoordinates,0,0,0.0 ; {Y=0.2}
SetTextureCoordinates,1,0,0.2 ; {Y=0.2}
SetTextureCoordinates,2,1,0.2 ; {Y=0.2}
SetTextureCoordinates,3,1,0.0 ; {Y=0.2}

Edit the "master" 5m object, then regenerate the curved object.
Joey Foo
The web design/development guy.
"Have you tried the '404' page on SGTrains.com?"
joeyfoo.com @joeyfjj 

Useful links: Download openBVE / C751A
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)