Jump to content

4x4 grid single texture set on 4x4 grid of seperate objects.


You are about to reply to a thread that has been inactive for 2811 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am having a total brain fart right now, this is turning out to be way more complicated for me than it rightfully should

 

I have a single 4x4 gridded texture, and a 4x4 grid of seperate objects.

 

Is there a website, script or what have you for easily calculating what i need the stretch/offset of the texture to be

on each object in order to make it fit the grid correctly?

 

http://i.imgur.com/hJ2YdHX.png

 

I cant figure this out for the life of me, and i know it should be simple to do.

Link to comment
Share on other sites

Because the texture is 4x4, it's probably not surprising that both the horizontal and vertical scales will be 0.25.

The fact that 4 is an even number means the middle of the texture is halfway between one of the 4 tiles, both vertically and horizontally, so alignment needs to offset by half a tile (0.125) in each direction, and then add or subtract one or more full tiles (0.25) in each direction to step across the texture.

So, the top row will be vertically offset by 0.375, the second by 0.125, the third row by -0.125, and the fourth by -0.375.

Similarly, the right-most column will be horizontally offset by 0375, second from the right by 0.125, etc.

(I have no idea if this is a source of confusion, but just in case: the origin of a texture is its lower left corner, but the numbers in this texture start in the upper left, so the "1" tile is at offsets -0.375, +0.375.)

  • Like 1
Link to comment
Share on other sites

Wow, thanks. I really really appreciate this it actually makes a ton of sense now i was just half asleep the other night and i think between that and the frustration i was having with the math behind it i was just sorta getting mad and thus making it even harder for me to figure it out.

 

I really appreciate this tho, you even went out of your way to solve it for me instead of telling me some arbritrary way of how to do it my self.

 

Much credit for you! thanks again.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2811 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...