Friday, September 25, 2015

Snowy Fence Posts

There are 4 number values for where the snow lies on your fence: SnowThickness(Post/Rail)ScaleFactor and SnowThickness(Post/Rail)VerticalOffset.

To find out what your numbers should be you are going to need to know the height and width of the tops of the posts and rails of your fence mesh, as well as of the mesh you're cloning. The width is as seen when viewing along the X axis. I used Blender for my measurements.

For these equations: x=the measurement of your mesh
                                       y=the measurement of EA's mesh
                                       z=EA's original value for this parameter
You need to use the height when calculating VerticalOffset and the width when calculating ScaleFactor.

Railing-
For the railing, there are two straight forward equations to get this number. (In my testing, these equations worked 100% of the time. Score!)

For the Railing: SnowThicknessRailScaleFactor= (x/y)*z
                               SnowThicknessRailVerticalOffset= (x-y)+z


Posts-
This is a load of fun. I had to play with these a lot, so take these numbers with a grain of salt. Test, Test and Test again.

For the Posts: SnowThicknessPostScaleFactor= (x/y)*[0.6]
                           SnowThicknessPostVerticalOffset=(x-y)-[0.09]

The 0.6 and 0.09 are totally, completely VARIABLE. It is the result of tinkering until I liked how it looked. The larger you make the ScaleFactor the more you'll have to lower the number in brackets for the VerticalOffset. It appears to be a proportional, not a direct, connection.

I used an OMSP with EA's magazines sculpture on it to help me measure in game while testing these values. For instance, it allowed me to see that I needed to take off an additional 5 centimeters (.05) on the snow post height.


Example-

Sunny's Mesh- Post Top Height- 2.57
                             Post Width- 0.21
                             Rail Top Height- 2.09
                             Rail Width- 0.059

EA's Mullet Fencing- Post Top Height- 1.08
                                          Post Width- 0.14
                                          Rail Top Height- 0.955
                                          Rail Width- 0.095

Original Input- SnowThicknessPostScaleFactor: 0.4
                               SnowThicknessRailScaleFactor: 0.6
                               SnowThicknessPostVerticalOffset: -0.04
                               SnowThicknessRailVerticalOffset: -0.08

New Input-
SnowThicknessPostScaleFactor=(0.21/0.14)*[0.6]= 0.9
SnowThicknessRailScaleFactor= (0.059/0.095)*0.6= 0.372
SnowThicknessPostVerticalOffset=(2.57-1.08)-[0.09]= 1.4
SnowThicknessRailVerticalOffset= (2.09-0.955)+-0.08= 1.115

 The Result:

The Waffle- (Feel Free to Skip this Bit)
I could find quite a few instances where EA's Vertical Offset was 0, or the Scale Factor was 1. However, each of the fences I tested this on had different rail and post thickness and height. So it appears EA made a guesstimate and set a value of 1 per fence later tweaking the results until they looked correct. This is why you need EA's original numbers.

I say the connection between the Post ScaleFactor and Vertical Offset is most likely proportional, not direct. This is because as I moved up in Scale, my Vertical Offset changed differently.

Post Waffle- Originally, I followed the same equations for Post ScaleFactor/VerticalOffset. This gave me original values of 0.6 ScaleFactor and 1.45 VerticalOffset. This result was a snowball buried in the post that would have fit on the top of the post cap, but not on the entire width (which is what I'd measured.)

The more I increased the Scale Factor, the more I had to decrease my Vertical Offset. At one point I thought it was an increase of .01 Vertical Offset per 0.1 increase to ScaleFactor. Once I had added .15 to the Scale Factor, it was more like no increase to Vertical Offset. By the time I had mine pinned down I had to decrease the VerticalOffset by 0.05/0.3 (or approximately 0.167) per 0.1 I'd increased the ScaleFactor. So, to me, it appears proportional. I could get all ticky and graph it and come up with the equation, but by this point I was kind of done and I'm not that good at math. Also, it's quite possible this is an asymptote which would make my brain essplode to attempt.

Post ScaleFactor MulletFence Waffle- Thanks to This Calculator once I knew my ScaleFactor I did have an equation I could use should I ever want to clone the Mullet Fencing again.
New PostScaleFactor=7.143x-0.6 .
This equation will most likely NOT WORK if you use any other fence to clone from (and I can see Lots of reasons you wouldn't want to clone from this fence.)
~Sunny

No comments:

Post a Comment