I have been trying to make a rotating fan texture, and used the example code posted on the 'Dynamic Materials with Proxies' guide on nodraw.net to do so. However when I test it I find it is rotating around a point to the side, not the center.
Unless I am mistaken, it's fair to assume that $center is the parameter I need to edit which I have tried doing already. The setting on the guide has it at [-0.5 -0.5] and I have tried changing these values to the following vaules:
Here is my .vmt as it currently stands:
Unless I am mistaken, it's fair to assume that $center is the parameter I need to edit which I have tried doing already. The setting on the guide has it at [-0.5 -0.5] and I have tried changing these values to the following vaules:
- [-0.5 -0.5]
- [0 0]
- [1 1]
- [-1 -1]
- [160 160] (because the brush it is applied to is 320x320)
- [-160 -160]
- [256 256] (because the texture is 512x512)
- -256 -256]
Here is my .vmt as it currently stands:
Code:
"LightmappedGeneric"
{
"$basetexture" "custom/fan_spinning"
"$surfaceprop" "metal"
"$translucent" "1"
"$envmap" "env_cubemap"
"$angle" 0.0
"$translate" "[0.0 0.0]"
"$center" "[-1 -1]"
"Proxies"
{
"LinearRamp"
{
"rate" 5
"initialValue" 0.0
"resultVar" "$angle"
}
"TextureTransform"
{
"translateVar" "$translate" // we don't need this, but it's not optional
"rotateVar" "$angle"
"centerVar" "$center"
"resultVar" "$basetexturetransform"
}
}
}
Last edited: