BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Objects - using the texture

4 posters

Go down

Objects - using the texture Empty Objects - using the texture

Post by liquid_ Fri Sep 14, 2012 12:02 pm

Could someone explain to me how to deal with texture and its coordinates? I'm trying to make an object (.csv file). I want to fill a rectangular surface (say 3m X 3m, coord.: (0,0,0), (-3,0,0), (-3,0,3), (0,0,3)) with a texture 32b X 32b in size in file texture.bmp. How to use SetTextureCoordinates in this case?

liquid_

Posts : 26
Join date : 2012-05-15

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by Quork Fri Sep 14, 2012 1:42 pm

SetTextureCoordinates 0,31,31
SetTextureCoordinates 1,0,31
SetTextureCoordinates 2,0,0
SetTextureCoordinates 3,0,31
Quork
Quork

Posts : 1434
Join date : 2012-05-05
Age : 32
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by Dexter Fri Sep 14, 2012 2:51 pm

You are totally wrong, Quork!

Liquid, if you are starting the AddFace with TOP LEFT corner, it goes like this:

SetTextureCoordinates 0,0,0
SetTextureCoordinates 1,1,0
SetTextureCoordinates 2,1,1
SetTextureCoordinates 3,0,1

Let me explain
1st parameter refers to the actual vertex (their indexes start at 0) -> SetTextureCoordinates 0
2nd parameter refers to height of the texture, which is taken from top to bottom of the picture. In the upper left corner of the object you need upper left of the texture. Hence SetTextureCoordinates 0,0
3rd parameter refers to width of the texture, which is taken from left to right. So, in the upper left corner of the object you need upper left of the texture. Hence SetTextureCoordinates 0,0,0

Should you need more detailed explanation, do no hesitate to ask.


Last edited by Derryck on Fri Sep 14, 2012 6:02 pm; edited 3 times in total
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by Quork Fri Sep 14, 2012 3:08 pm

Uh yes, sorry. Mixed it up with another format (not BVE). That's what happens when you answer a seemingly simple question while thinking about elsething...
Quork
Quork

Posts : 1434
Join date : 2012-05-05
Age : 32
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by liquid_ Fri Sep 14, 2012 3:54 pm

Thanks, that worked. As I suppose, if I give numbers greater than 1 ( say 4) as coordinates X and Y this will mean texture will be stretched so that it'll fit 4 times in each of the dimentions of the polygon. Am I right?

liquid_

Posts : 26
Join date : 2012-05-15

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by Dexter Fri Sep 14, 2012 5:12 pm

Exactly.:-)
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by Dexter Fri Sep 14, 2012 5:14 pm

Quork wrote:Uh yes, sorry. Mixed it up with another format (not BVE). That's what happens when you answer a seemingly simple question while thinking about elsething...

Very Happy Yea I know, it happens.:-) Sorry fot the caps, I was not screaming, I just need to have it switched on at work. Smile
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by graymac Fri Sep 14, 2012 5:34 pm

http://celtictrainsim.com/publs.html

eejits guide might help.
graymac
graymac

Posts : 2134
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by liquid_ Fri Sep 14, 2012 7:28 pm

This guide looks pretty useful. Thanks.

liquid_

Posts : 26
Join date : 2012-05-15

Back to top Go down

Objects - using the texture Empty Re: Objects - using the texture

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum