BVEStation Forums

BVE => BVE/OpenBVE Support => Topic started by: Pacific385 on January 28, 2012, 03:49:57 pm

Title: Texturing Cylinders
Post by: Pacific385 on January 28, 2012, 03:49:57 pm
Does anyone know how to texture a cylinder?
I've been using this coding:
[meshbuilder]
Cylinder 32,0.02,0.02,2
Color 224, 223, 219
Translate 0.00,2.10,-15.00
Title: Re: Texturing Cylinders
Post by: BStyles on January 28, 2012, 04:37:34 pm
Cylinders cannot be textured, since there are no faces to reference. You can texture one shade onto it but it cannot be specific or it will be mapped over the entire object (or not at all). Your best bet is to build them by hand.

BStyles
Title: Re: Texturing Cylinders
Post by: Pacific385 on January 28, 2012, 04:52:17 pm
Cylinders cannot be textured, since there are no faces to reference. You can texture one shade onto it but it cannot be specific or it will be mapped over the entire object (or not at all). Your best bet is to build them by hand.

BStyles
Thanks
Title: Re: Texturing Cylinders
Post by: TJay1724 on January 28, 2012, 08:44:57 pm
Actually you CAN texture a cylinder. I've done so myself and there is a tutorial on how to texture cylinders and cubes.

This is the coding:

CreateMeshbuilder,

Cylinder, 16, 0.5, 0.5, 3.2
Translate, 0.0, 2.6, 0.05

LoadTexture,20th End Wall.bmp
SetTextureCoordinates, 0, 0  , 0
SetTextureCoordinates, 1, 0  , 1
SetTextureCoordinates, 2, 0.8, 0
SetTextureCoordinates, 3, 0.8, 1
SetTextureCoordinates, 4, 1.6, 0
SetTextureCoordinates, 5, 1.6, 1
SetTextureCoordinates, 6, 2.4, 0
SetTextureCoordinates, 7, 2.4, 1
SetTextureCoordinates, 8, 3.2, 0
SetTextureCoordinates, 9, 3.2, 1
SetTextureCoordinates, 10, 4  , 0
SetTextureCoordinates, 11, 4  , 1
SetTextureCoordinates, 12, 4.8, 0
SetTextureCoordinates, 13, 4.8, 1
SetTextureCoordinates, 14, 5.6, 0
SetTextureCoordinates, 15, 5.6, 1
SetTextureCoordinates, 16, 6.4, 0
SetTextureCoordinates, 17, 6.4, 1
SetTextureCoordinates, 18, 5.6, 0
SetTextureCoordinates, 19, 5.6, 1
SetTextureCoordinates, 20, 4.8, 0
SetTextureCoordinates, 21, 4.8, 1
SetTextureCoordinates, 22, 4  , 0
SetTextureCoordinates, 23, 4  , 1
SetTextureCoordinates, 24, 3.2, 0
SetTextureCoordinates, 25, 3.2, 1
SetTextureCoordinates, 26, 2.4, 0
SetTextureCoordinates, 27, 2.4, 1
SetTextureCoordinates, 28, 1.6, 0
SetTextureCoordinates, 29, 1.6, 1
SetTextureCoordinates, 30, 0.8, 0
SetTextureCoordinates, 31, 0.8, 1

And a screen showing the textured cylinder


(http://img96.imageshack.us/img96/2063/texturedcylinder.jpg)
Title: Re: Texturing Cylinders
Post by: Pacific385 on January 28, 2012, 09:22:15 pm
It worked, thanks. One thing though, is it possible to have the image repeat only once?
Title: Re: Texturing Cylinders
Post by: TJay1724 on January 28, 2012, 10:40:07 pm
It should be. Just play around with the coordinates.
Title: Re: Texturing Cylinders
Post by: Pacific385 on January 29, 2012, 11:34:45 am
It should be. Just play around with the coordinates.
You have to keep the numbers in proportion (ex. 6.4 becomes 1, 5.6 becomes .875, 4.8 becomes .75 and so on) Take the original number and divide it by 6.4 (or the greatest number there)