How to adjust your (animated) pantograph height
如何调整你的(动画的)导电弓架高度
Rationale - routes with overhead wires can be set at different heights (probably not too relevant to UK routes), so different locos look odd if the pantograph is too high (e.g. the Acela is 7.2M the Japan wire height is just over 5M). Unfortunately, the MSTS models are unable (and will never be able) to detect this to set the pantograph height accordingly.
基本原理——有架空线的线路可以设置不同高度的架空线(可能跟UK线路不是太有关),因此不同的机车如果导电弓架太高的话看上去会很古怪(比如:Acela机车是7.2米而日本的则是大约5米)。不幸的是,MSTS模型不能够(永远也不能够)检测线路电线的高度来相应地设置导电弓架的高度。
Adjusting the height is not a simple matter of scaling (though you could do this but the loco would look a bit odd) - the angles of the pantograph animation need to be changed.
调整高度不是一件像缩放比例这样简单的事情(虽然你能够这样做但是这样机车会看上去有点古怪)——导电弓架动画的角度需要改变。
Using the Acela as an example, this has two parts (to both pantos):
用Acela机车做个例子,这有两部分(对两个导电弓架):
the lower arm moves up by about 45 degrees and
下臂向上移动大约45度
the upper arm moves 85 degrees (about twice the angle) relative to the lower arm.
上臂相对于下臂移动85度(大约两倍的角度)。
The relevant part of the .S file that controls this is :
S文件中控制这部分相应的内容是:
(I have removed the linear key parts and a few brackets for clarity - not relevant)
(为了清楚我移除了线性关键部分和一些括号——无关)
anim_node PANTOGRAPHBOTTOM1 (
controllers ( 2
tcb_rot ( 3
tcb_key ( 0 -0.00436731 0 0 0.99999 0 0 0 0 0 )
tcb_key ( 1 -0.386715 0 0 0.922199 0 0 0 0 0 )
tcb_key ( 2 -0.386715 0 0 0.922199 0 0 0 0 0 )
anim_node PANTOGRAPHTOP1 (
controllers ( 2
tcb_rot ( 3
tcb_key ( 0 0.0479783 0 0 0.998848 0 0 0 0 0 )
tcb_key ( 1 0.678801 0 0 0.734322 0 0 0 0 0 )
tcb_key ( 2 0.678801 0 0 0.734322 0 0 0 0 0 )
The second to fifth parameters of the tcb_key (this applys to slerp_key too) are a "quaternion" definition (3D matrix maths - fun stuff) but because the rotation is a simple one, about the x-axis only, it basically boils down to the fact that the second parameter is the negative sine of half of the rotation angle and the 5th parameter is the cosine of half of the rotation angle.
tcb_key(这也应用于slerp_key)的第二到第五个参数是一个四元数定义(三维矩阵数学——有趣的填充)但是因为旋转是简单的,只关于X轴,事实基本上等于是第二个参数是一半旋转角度的正弦的负数,第五个参数是一半旋转角度的余弦。
Looking at the Acela we can see that the key frames 1 and 2 (first parameter) are the same (modelling oddity?) 45/85 bottom/top animation angles and the first key frame (0) is almost 0 angle for top and bottom.
观察Acela机车的这部分我们能看见的是关键桢1和2(第一个参数)是一样的(模型制作得很古怪?)45/85、低部/顶部、动画角度和顶部低部的第一个关键桢(0)几乎都是0度。
So now we can scale the animation - ignore key frame 0, this should be close to zero, if not use the difference to scale the angle.
因此现在我们能够按比例修改动画——忽略关键桢0,如果不使用差额按比例修改角度,这应该接近0。
To change the animation to 35/70 degrees bottom/top, take out your casio calculators, last used for O-level exams:
改变动画到35/70度低部/顶部,拿出你的Casio计算器,持续用O标准使用:
Sin(35/2)=0.3007, Cos(35/2)=0.95372 etc...
Sin(35/2)=0.3007, Cos(35/2)=0.95372 等等...
anim_node PANTOGRAPHBOTTOM1 (
controllers ( 2
tcb_rot ( 3
tcb_key ( 0 -0.00436731 0 0 0.99999 0 0 0 0 0 )
tcb_key ( 1 -0.3007 0 0 0.95372 0 0 0 0 0 )
tcb_key ( 2 -0.3007 0 0 0.95372 0 0 0 0 0 )
anim_node PANTOGRAPHTOP1 (
controllers ( 2
tcb_rot ( 3
tcb_key ( 0 0.0479783 0 0 0.998848 0 0 0 0 0 )
tcb_key ( 1 0.57358 0 0 0.81915 0 0 0 0 0 )
tcb_key ( 2 0.57358 0 0 0.81915 0 0 0 0 0 )
Now the height achieved depends on how long the pantograph arms are, so it may take a bit of trial and error to get the correct values for your wire height.
现在获得的高度取决于导电弓架臂的长度,因此可能需要一点反复尝试来获得正确的电线高度的数值。
Now the warnings...
现在注意…
Make sure you backup your files first!
确保你事先备份了你的文件!
Some animations may have more steps - you may need to experiment further.
一些动画可能有更多的步骤——你可能需要更进一步的试验。
Also, this is still not 100% tested, though early tests looked promising.
同样,虽然早先的测试看上去很有希望,但这还没有100%通过测试。
|