Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,232 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple texture scaling #30050
07/08/04 05:46
07/08/04 05:46
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline OP
Expert
Marco_Grubert  Offline OP
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
There were no responses in the German thread so let's try it in English:
I am trying to scale/tile an entity's skin during runtime. The following code is what I thought should work, but despite not creating any errors it does not affect the scale at all :
Code:

function mtl_scale_init;
material mtl_scale
{
event=mtl_scale_init; // init function
effect="
texture entSkin1; // first entity skin
matrix matmtl; // default texture matrix

// default technique
technique scaleTex
{
pass P0
{
// bind skin to tex1 and modulate with color
Texture[0] = <entSkin1>;
//use texture matrix
TexCoordIndex[0]=0;
TextureTransform[0]=<matmtl>;
TextureTransformFlags[0] = Count2; //2d texture
AddressU[0]=wrap;
AddressV[0]=wrap;
ColorArg1[0] = Diffuse; //just a lit texture
ColorOp[0] = Modulate2x;
ColorArg2[0] = Texture;
}
}
";
}

// init function sets scaling
function mtl_scale_init
{
mtl_scale.matrix11=float(8); // *8 in u,v direction
mtl_scale.matrix22=float(8);
}


When replacing
Code:
TextureTransform[0]=<matmtl>;


with the resulting matrix though it works as expected:
Code:
TextureTransform[0]=
{8,0,0,0,0,8,0,0,
0,0,0,0,0,0,0,0 };


Why ?

Re: Simple texture scaling [Re: Marco_Grubert] #30051
07/08/04 06:34
07/08/04 06:34
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
Change your "matmtl" to "matMtl". Seems it is case-sensitive.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Simple texture scaling [Re: qwerty823] #30052
07/13/04 08:37
07/13/04 08:37
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline OP
Expert
Marco_Grubert  Offline OP
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
How odd.
Thanks for the help !


Moderated by  Blink, Hummel, Superku 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1