help me understand the decal texturecoords please
by deepscratch · in Torque 3D Professional · 07/10/2009 (6:13 am) · 5 replies
the bullet decal has four images, I'm asuming that they are for four different environment types, like soft earth, wood, metal, and rock.
and in the bullet decals datablock, there is this:
now, which decal, of the four does that point to? (ok, I know which one)
and what would the other three's coords be?
thanks
and in the bullet decals datablock, there is this:
datablock DecalData(BulletDecalsAll)
{
Material = "DECAL_bulletdecals";
size = 0.1;
lifeSpan = "10000";
textureCoordCount = "4";
textureCoords[0] = "0.0 0.0 0.5 0.5";
textureCoords[1] = "0.5 0.0 0.5 0.5";
textureCoords[2] = "0.0 0.5 0.5 0.5";
textureCoords[3] = "0.5 0.5 0.5 0.5";
};now, which decal, of the four does that point to? (ok, I know which one)
and what would the other three's coords be?
thanks
About the author
email me at medan121@gmail.com
Recent Threads
#2
07/10/2009 (6:23 am)
thank you Jaimi.
#3
Texture Coordinates work off of percentages of the image size. The first two numbers mean the start location. The second two numbers mean to move across to the right and down from the start point. Texture coordinates start from the Top Left hand corner of the image.
0 0 .5 .5 would mean start in the top left hand corner and move out half of the image width and half its height. This puts you in the middle of the image when done.
.5 0 .5 .5 would mean start at the middle of the top and move right half the image and move down half the image putting you in the middle right.
0 .5 .5 .5 would mean start in the 0 position for X and half the image down on Y then move out half of the image width and half its height. this puts you at the bottom middle.
.5 .5 .5 .5 would mean to start at half the image width/height which would put you in the middle of the image and move out half of its width/height putting you in the bottom right hand corner of the image.
07/10/2009 (7:04 am)
I'm not sure if you are still asking for more information. I just wanted to explain it a little further.Texture Coordinates work off of percentages of the image size. The first two numbers mean the start location. The second two numbers mean to move across to the right and down from the start point. Texture coordinates start from the Top Left hand corner of the image.
textureCoordCount = "4"; textureCoords[0] = "0.0 0.0 0.5 0.5"; // Xstart Ystart XsizeLength YsizeLength textureCoords[1] = "0.5 0.0 0.5 0.5"; textureCoords[2] = "0.0 0.5 0.5 0.5"; textureCoords[3] = "0.5 0.5 0.5 0.5";
0 0 .5 .5 would mean start in the top left hand corner and move out half of the image width and half its height. This puts you in the middle of the image when done.
.5 0 .5 .5 would mean start at the middle of the top and move right half the image and move down half the image putting you in the middle right.
0 .5 .5 .5 would mean start in the 0 position for X and half the image down on Y then move out half of the image width and half its height. this puts you at the bottom middle.
.5 .5 .5 .5 would mean to start at half the image width/height which would put you in the middle of the image and move out half of its width/height putting you in the bottom right hand corner of the image.
#4
07/10/2009 (7:28 am)
excellent, nice description.
#5
In Beta3 it was simply locked to one texture out of the four, in Beta4 decals will randomly select one out of the array if a specific one to use isn't indicated.
07/10/2009 (10:09 am)
Quote:Don't we wish ;D
I'm asuming that they are for four different environment types, like soft earth, wood, metal, and rock.
In Beta3 it was simply locked to one texture out of the four, in Beta4 decals will randomly select one out of the array if a specific one to use isn't indicated.
Associate Jaimi McEntire
King of Flapjacks
textureCoords[0] points to the top left decal.
textureCoords[1] points to the top right decal.
textureCoords[2] points to the bottom left decal.
textureCoords[3] points to the bottom right decal.
UV coordinates are usually specified in percentages (ie, 0.5 means "half of the texture").