我想用 x3dom 可视化交叉带分拣机。交叉带式分拣机具有带有 90° 圆弧的环形形式。对于我使用的交叉带:
< Rectangle2D size='0.6 0.6'/>
分拣机有 58 个交叉带,对于每个交叉带,我想通过 javascript 动态更改材料的颜色。交叉带应该像实际一样沿着分拣机移动。因此我使用标签:
<timeSensor DEF='timeKOSorter' cycleInterval='60' loop='true'></timeSensor>
例如对于交叉带 0:
< PositionInterpolator DEF='POSKO01_0' key='0 0.344 0.355 0.366 0.377 0.389 0.4 0.411 0.433 0.444 0.455 0.466 0.478 0.489 0.5 0.844 0.855 0.866 0.877 0.889 0.9 0.911 0.933 0.944 0.955 0.966 0.978 0.989 1.0 ' keyValue='8.0 0 0.0 -8.0 0 0.0 -8.518 0 0.068 -9.0 0 0.268 -9.414 0 0.586 -9.732 0 1.0 -9.932 0 1.482 -10.0 0 2.0 -10.0 0 3.0 -9.932 0 3.518 -9.732 0 4.0 -9.414 0 4.414 -9.0 0 4.732 -8.518 0 4.932 -8.0 0 5.0 8.0 0 5.0 8.518 0 4.932 9.0 0 4.732 9.414 0 4.414 9.732 0 4.0 9.932 0 3.518 10.0 0 3.0 10.0 0 2.0 9.932 0 1.482 9.732 0 1.0 9.414 0 0.586 9.0 0 0.268 8.518 0 0.068 8.0 0 0.0 '>< /PositionInterpolator>
<Route fromNode='timeKOSorter' fromField='fraction_changed' toNode='POSKO01_0' toField='set_fraction'></Route>
< Route fromNode='POSKO01_0' fromField ='value_changed' toNode='crossKO01_0' toField='translation'>< /Route> < OrientationInterpolator DEF='oriKOSorterKO01_0' key='0 0.344 0.355 0.366 0.377 0.389 0.4 0.411 0.475850.4464 0.4464 0.4 0.489 0.5 0.844 0.855 0.866 0.877 0.889 0.9 0.911 0.933 0.944 0.955 0.966 0.978 0.989 1.0 ' keyValue='0 1 0 0.0 0 1 0 0.0 0 1 0 0.262 0 1 0 0.524 0 1 0 0.785 0 1 0 1.047 0 1 0 1.309 0 1 0 1.571 0 1 0 1 1.571 0 1 0 1.833 0 1 0 2.094 0 1 0 1 0 2.356 0 1 0 1 0 2.618 0 1 0 2.88 0 1 0 1 0 1 0 3.142 0 1 0 1 0 3.142 0 3 3.403 0 3 3.403 0 0 0 3 3.665 0 3 3.665 0 0 3 3.927 0 3.927 0 3 3.927 0 4 4.189 0 4.189 0 4.189 0 1 0 4.451 0 1 0 4.712 0 1 0 4.712 0 1 0 4.974 0 1 0 5.236 0 1 0 5.498 0 1 0 5.76 0 1 0 6.021 0 1 0 0.0 '>< /OrientationInterpolator>
< Route fromNode='timeKOSorter' fromField='fraction_changed' toNode='oriKOSorterKO01_0' toField='set_fraction'>< /Route> < Route fromNode='oriKOSorterKO01_0' fromField ='value_changed' toNode='crossKO01_0' toField='rotation'> </路线>
我现在的问题是,如果我用每 58 个交叉带为 2 个分拣机设置动画,则会花费大量 CPU 时间。在我的电脑上,它使用超过 40% 的 CPU 功率。有谁知道如何获得更好的性能?