; FEVF - FERROVIA ELETTRICA VALLE DI FIEMME
; by Roberto Benini - robertobenini@libero.it
; (C) 2005
; in caso di utilizzo citare fonte


; debiti: la struttura base del carro e la texture   
; provengono da CM470.b3d di
; FGC - Ferrovia Genova-Casella
; by Sergio Usai - sergiousai@tin.it
; & Luigi Cartello - cartello.luigi@tiscali.it

;lunghezza 10.76 metri
; altezza cassone 2 metri
; altezza utile 1 metro dal piano di carico
; altezza piano di carico 1 metro

CreateMeshBuilder ; Fiancata SX carro
AddVertex, -1.3, 2, 5
AddVertex, -1.3, 2, -5
AddVertex, -1.3, 0.30, -5
AddVertex, -1.3, 0.30, 5
AddFace2, 0,1,2,3
GenerateNormals
LoadTexture, fianco_scoperto.bmp
SetDecalTransparentColor, 0,0,0
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1

CreateMeshBuilder ; Fiancata DX carro
AddVertex, 1.3, 2, 5
AddVertex, 1.3, 2, -5
AddVertex, 1.3, 0.3, -5
AddVertex, 1.3, 0.3, 5
AddFace2, 3,2,1,0
GenerateNormals
LoadTexture, fianco_scoperto.bmp
SetDecalTransparentColor, 0,0,0
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1


CreateMeshBuilder  ; Frontale carro (AVANTI)
AddVertex, -1.3, 2.2, -4.87;z=zeta pił arretrato +13 cm
AddVertex, 1.3, 2.2, -4.87;z=zeta pił arretato +13 cm

AddVertex, 1.3, 0.6, -4.87;z=zeta pił arretrato +13 cm

AddVertex, -1.3, 0.6, -4.87;z=zeta pił arretrato +13 cm

AddFace2, 0,1,2,3
GenerateNormals
LoadTexture, Fronte3.bmp
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1
SetDecalTransparentColor, 0,0,0

CreateMeshBuilder  ; Frontale carro (DIETRO)
AddVertex, -1.3, 2.2, 4.87;z=zeta pił arretrato +13 cm
AddVertex, 1.3, 2.2, 4.87;z=zeta pił arretato +13 cm

AddVertex, 1.3, 0.6, 4.87;z=zeta pił arretrato +13 cm

AddVertex, -1.3, 0.6,4.87;z=zeta pił arretrato +13 cm

AddFace2, 3,2,1,0
GenerateNormals
LoadTexture, Fronte3.bmp
SetTextureCoordinates, 0, 0, 0
SetTextureCoordinates, 1, 1, 0
SetTextureCoordinates, 2, 1, 1
SetTextureCoordinates, 3, 0, 1
SetDecalTransparentColor, 0,0,0






CreateMeshBuilder ; Predella
Cube, 0.08, 0.02, 1.0
SetColor, 97,97,97
translate, -1.39, 0.66, 0; z= a metą del vagone

; === pavimento del carro ====
CreateMeshBuilder
Cube, 1.28, 0.1, 4.8
SetColor, 60,50,40
translate, 0, 0.9, 0

; ------------ Carrelli ----------------------
CreateMeshBuilder
AddVertex, 0, 0.8 , 1.6
AddVertex, 0, 0.8 ,-1.6
AddVertex, 0,-0.1 ,-1.6
AddVertex, 0,-0.12 , 1.6
AddFace2,0,1,2,3
GenerateNormals
LoadTexture,bogie.bmp
SetTextureCoordinates,0,1,0
SetTextureCoordinates,1,0,0
SetTextureCoordinates,2,0,1
SetTextureCoordinates,3,1,1
SetDecalTransparentColor,0,0,0
Translate,0.7,0.08,-2.6

CreateMeshBuilder
AddVertex, 0, 0.8 , 1.6
AddVertex, 0, 0.8 ,-1.6
AddVertex, 0,-0.1 ,-1.6
AddVertex, 0,-0.12 , 1.6
AddFace2,0,1,2,3
GenerateNormals
LoadTexture,bogie.bmp
SetTextureCoordinates,0,1,0
SetTextureCoordinates,1,0,0
SetTextureCoordinates,2,0,1
SetTextureCoordinates,3,1,1
SetDecalTransparentColor,0,0,0
Translate,-0.7,0.12,-2.6

CreateMeshBuilder
AddVertex, 0, 0.8 , 1.6
AddVertex, 0, 0.8 ,-1.6
AddVertex, 0,-0.1 ,-1.6
AddVertex, 0,-0.1 , 1.6
AddFace2,0,1,2,3
GenerateNormals
LoadTexture,bogie.bmp
SetTextureCoordinates,0,1,0
SetTextureCoordinates,1,0,0
SetTextureCoordinates,2,0,1
SetTextureCoordinates,3,1,1
SetDecalTransparentColor,0,0,0
Translate,0.7,0.12,2.6

CreateMeshBuilder
AddVertex, 0, 0.8 , 1.6
AddVertex, 0, 0.8 ,-1.6
AddVertex, 0,-0.1 ,-1.6
AddVertex, 0,-0.1 , 1.6
AddFace2,0,1,2,3
GenerateNormals
LoadTexture,bogie.bmp
SetTextureCoordinates,0,1,0
SetTextureCoordinates,1,0,0
SetTextureCoordinates,2,0,1
SetTextureCoordinates,3,1,1
SetDecalTransparentColor,0,0,0
Translate,-0.7,0.12,2.6

; Route carrello anteriore
; ------------------
CreateMeshBuilder ; Ruota ant sin (3.25 + 0.75 = +4)
cylinder,10, 0.35, 0.38,0.1 
SetColor,24,24,24
rotate,0,0,1,90
translate,-0.55, 0.36, 3.5
CreateMeshBuilder ; Assale ant
cylinder,3, 0.08, 0.08 ,1.1 
SetColor,24,24,24
rotate,0,0,1,-90
translate, 0, 0.36, 3.5
CreateMeshBuilder ; Ruota ant des (3.25 + 0.75 = +4)
cylinder,10, 0.35, 0.38,0.1 
SetColor,24,24,24
rotate,0,0,1,-90
translate, 0.55, 0.36, 3.5

CreateMeshBuilder ; Ruota post sin (3.25 - 0.75 = +2.5)
cylinder,10, 0.35, 0.38,0.1 
SetColor,24,24,24
rotate,0,0,1,90
translate,-0.55, 0.36, 1.70
CreateMeshBuilder ; Assale post
cylinder,3, 0.08, 0.08 ,1.1 
SetColor,24,24,24
rotate,0,0,1,-90
translate, 0, 0.36, 1.70
CreateMeshBuilder ; Ruota post des (3.25 - 0.75 = +2.5)
cylinder,10, 0.35, 0.38,0.1 
SetColor,24,24,24
rotate,0,0,1,-90
translate, 0.55, 0.36, 1.70

; Ruote carrello posteriore
; ------------------
CreateMeshBuilder ; Ruota ant sin (-3.25 + 0.75 = -2.5)
cylinder,10, 0.35, 0.38,0.1 
SetColor,24,24,24
rotate,0,0,1,90
translate,-0.55, 0.36, -1.70
CreateMeshBuilder ; Assale ant
cylinder,3, 0.08, 0.08 ,1.1 
SetColor,24,24,24
rotate,0,0,1,-90
translate, 0, 0.36, -1.70
CreateMeshBuilder ; Ruota ant des (-3.25 + 0.75 = -2.5)
cylinder,10, 0.35, 0.38,0.1 
SetColor,24,24,24
rotate,0,0,1,-90
translate, 0.55, 0.36, -1.70
CreateMeshBuilder ; Ruota post sin (-3.25 - 0.75 = -4)
cylinder,10, 0.35, 0.38,0.1 
SetColor,24,24,24
rotate,0,0,1,90
translate,-0.55, 0.36, -3.5
CreateMeshBuilder ; Assale post
cylinder,3, 0.08, 0.08 ,1.1 
SetColor,24,24,24
rotate,0,0,1,-90
translate, 0, 0.36, -3.5
CreateMeshBuilder ; Ruota post des (-3.25 - 0.75 = -4)
cylinder,10, 0.35, 0.38,0.1 
SetColor,24,24,24
rotate,0,0,1,-90
translate, 0.55, 0.36, -3.5

CreateMeshBuilder ; Respingenti
cylinder,4, 0.12, 0.08 ,0.5 
SetColor,24,24,24
rotate,1,0,0,-90
translate, 0, 0.8, 5.10

CreateMeshBuilder
Cube,0.3,0.15,0.02
SetColor,24,24,24
translate, 0, 0.8, 5.35

CreateMeshBuilder ; Respingenti
cylinder,4, 0.08, 0.12 ,0.5 
SetColor,24,24,24
rotate,1,0,0,-90
translate, 0, 0.8, -5.10

CreateMeshBuilder
Cube,0.3,0.15,0.02
SetColor,24,24,24
translate, 0, 0.8, -5.35



; FEVF - FERROVIA ELETTRICA VALLE DI FIEMME
; by Roberto Benini - robertobenini@libero.it
; (C) 06/12/2005
; in caso di utilizzo citare fonte




; - - - - - struttura portante 10 76 m
;putrella doppio T longitudinale dx
CreateMeshBuilder; verticale
Cube,0.01,0.10,4.85
SetColor,57,57,66,;75,74,84,;41,41,49
translate, 0.67, 0.670, 0

CreateMeshBuilder;longitudinale sx
Cube,0.01,0.10,4.85
SetColor,57,57,66,;75,74,84,;41,41,49
translate, -0.67, 0.670, 0
CreateMeshBuilder;trasversale anteriore
Cube,0.03,0.175,.65
SetColor,57,57,66,;75,74,84,;41,41,49
Rotate,0,1,0,90
translate, 0, 0.65, 4.80
CreateMeshBuilder;trasversale posteriore
Cube,0.03,0.175,.65
SetColor,57,57,66,;75,74,84,;41,41,49
Rotate,0,1,0,90
translate, 0, 0.65, -4.80

; ganci
CreateMeshBuilder ; anteriore 
AddVertex, 0  , 0.70 ,-0.15
AddVertex, 0  , 0.70, 0.15
AddVertex, 0  , 0.10 ,0.15
AddVertex, 0  , 0.10 ,-0.15
AddFace2,0,1,2,3
GenerateNormals
LoadTexture, gancio.bmp
SetTextureCoordinates,0,0,0
SetTextureCoordinates,1,1,0
SetTextureCoordinates,2,1,1
SetTextureCoordinates,3,0,1
SetDecalTransparentColor,0,0,0
Translate,0,0.00,4.97

CreateMeshBuilder ; posteriore 
AddVertex, 0  , 0.70 ,-0.15
AddVertex, 0  , 0.70, 0.15
AddVertex, 0  , 0.10 ,0.15
AddVertex, 0  , 0.10 ,-0.15
AddFace2,0,1,2,3
GenerateNormals
LoadTexture, gancio.bmp
SetTextureCoordinates,0,0,0
SetTextureCoordinates,1,1,0
SetTextureCoordinates,2,1,1
SetTextureCoordinates,3,0,1
SetDecalTransparentColor,0,0,0
Rotate,0,1,0,180
Translate,0,0.00,-4.97


; - - - - - -  meccanismi sottopianale
CreateMeshBuilder; cassa dx
Cube,0.50,0.15,0.55
SetColor,41,41,49
translate, 0.64, 0.45, 0

CreateMeshBuilder; cassa sx
Cube,0.50,0.15,0.55
SetColor,41,41,49
translate, -0.64, 0.45, 0




; - - - - - - struttura laterale dx
CreateMeshBuilder; anteriore
Cube,0.02,0.02,1.27
SetColor,41,41,49
translate, -1.15, 0.08, 2.5
Rotate,1,0,0,-10
CreateMeshBuilder; centrale
Cube,0.02,0.02,1.25
SetColor,41,41,49
translate, -1.15, 0.30, 0
CreateMeshBuilder; posteriore
Cube,0.02,0.02,1.25
SetColor,41,41,49
translate, -1.15, 0.08, -2.5
Rotate,1,0,0,10
CreateMeshBuilder; verticale
Cube,0.02,0.25,.02
SetColor,41,41,49
translate, -1.15, 0.57, 1.27
CreateMeshBuilder; verticale
Cube,0.02,0.25,.02
SetColor,41,41,49
translate, -1.15, 0.57, -1.25


; - - - - - - struttura laterale sx
CreateMeshBuilder; anteriore
Cube,0.02,0.02,1.27
SetColor,41,41,49
translate, 1.15, 0.08, 2.5
Rotate,1,0,0,-10
CreateMeshBuilder; centrale
Cube,0.02,0.02,1.25
SetColor,41,41,49
translate, 1.15, 0.30, 0
CreateMeshBuilder; posteriore
Cube,0.02,0.02,1.25
SetColor,41,41,49
translate, 1.15, 0.08, -2.5
Rotate,1,0,0,10
CreateMeshBuilder; verticale
Cube,0.02,0.25,.02
SetColor,41,41,49
translate, 1.15, 0.57, 1.27
CreateMeshBuilder; verticale
Cube,0.02,0.25,.02
SetColor,41,41,49
translate, 1.15, 0.57, -1.25



; FEVF - FERROVIA ELETTRICA VALLE DI FIEMME
; by Roberto Benini - robertobenini@libero.it
; (C) 06/12/2005
; in caso di utilizzo citare fonte

; - - - - - -  MANICOTTO ANTERIORE 


CreateMeshBuilder ; tubo verticale
cylinder,8, 0.03, 0.03 ,1 
SetColor,40,40,40
translate, 0.5, 1.37,4.88

; 5 PEZZI DA 20x6 cm
CreateMeshBuilder ; 1 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,30
translate, 0.485, 1.08,4.93

CreateMeshBuilder ; 2 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,22.5
translate, 0.485, 1.255,5.02

CreateMeshBuilder ; 3 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,0
translate, 0.485, 1.43,5.055

CreateMeshBuilder ; 4 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,-22.5
translate, 0.485, 1.605,5.02

CreateMeshBuilder ; 5 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,-30
translate, 0.485, 1.775,4.93

; - - - - - -  MANICOTTO posteriore 


CreateMeshBuilder ; tubo verticale
cylinder,8, 0.03, 0.03 ,1 
SetColor,40,40,40
translate, 0.5, 1.37,4.88
rotate,0,1,0,180

; 5 PEZZI DA 20x6 cm
CreateMeshBuilder ; 1 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,30
translate, 0.485, 1.08,4.93
rotate,0,1,0,180

CreateMeshBuilder ; 2 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,22.5
translate, 0.485, 1.255,5.02
rotate,0,1,0,180

CreateMeshBuilder ; 3 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,0
translate, 0.485, 1.43,5.055
rotate,0,1,0,180

CreateMeshBuilder ; 4 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,-22.5
translate, 0.485, 1.605,5.02
rotate,0,1,0,180

CreateMeshBuilder ; 5 
cylinder,8, 0.03, 0.03 ,0.20 
SetColor,40,40,40
rotate,1,0,0,-30
translate, 0.485, 1.775,4.93
rotate,0,1,0,180




