5 registered members (AndrewAMD, ozgur, Ayumi, 2 invisible),
690
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: pan/roll uv-map/texture via shader?
[Re: lostclimate]
#173597
12/18/07 20:41
12/18/07 20:41
|
Joined: Oct 2002
Posts: 8,939 planet.earth
ello
Senior Expert
|
Senior Expert
Joined: Oct 2002
Posts: 8,939
planet.earth
|
Code:
float4x4 rMat = { 1,a,0,0, b,1,0,0, 0,0,0,0, 0,0,0,0 }; Out.Tex = mul(inTex,rMat);
where a rotates quite obvious and b does something, too.. i still dont really know how matrixes work, but this should help you btw, the two "1" entries are tiling factors
www.earthcontrol.dequoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
|
|
|
Re: pan/roll uv-map/texture via shader?
[Re: ventilator]
#173602
12/19/07 07:54
12/19/07 07:54
|
Joined: Oct 2002
Posts: 8,939 planet.earth
ello
Senior Expert
|
Senior Expert
Joined: Oct 2002
Posts: 8,939
planet.earth
|
thank you very much! still one proble remains: Code:
float a = radians(45); float3x3 matRotate = { cos(a) , -sin(a) , 0, sin(a) , cos(a) , 0, 0 , 0 , 1 }; Out.tex = mul(In.tex,matRotate);
this works perfect, but if i youse entSkill41 instead of 45 and pass it from the entities action via my.skill41 = floatv(45); it does not work correct.. any idea whats wrong?
Last edited by ello; 12/19/07 08:58.
|
|
|
Re: pan/roll uv-map/texture via shader?
[Re: ventilator]
#173604
12/19/07 11:25
12/19/07 11:25
|
Joined: Oct 2002
Posts: 8,939 planet.earth
ello
Senior Expert
|
Senior Expert
Joined: Oct 2002
Posts: 8,939
planet.earth
|
this does not work, too. to bad i cant read out values as text in the shader ... there seems to be some conversion when passing the skill. because the texture gets rotated when passing sin(0) or (90) and so on, and you have to scale the values in the shader by 0.001 , and there are other strange things happening... hmm ok, got it nearly working: Code:
float s=entSkill41; float c=entSkill42; float3x3 matRotate = { c , -s , 0, s , c , 0, 0 , 0 , 1 }; In.tex += float2(-0.5,-0.5); Out.tex = mul(In.tex,0.001*matRotate);
where my.skill41 = sinv(my.pan); my.skill42 = cosv(my.pan); but still when the pan is 0 the rotaion matrix produces a slightly rotation, what could that be??
Last edited by ello; 12/19/07 11:34.
|
|
|
|