博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WPF-3D动效-文字球形环绕
阅读量:6078 次
发布时间:2019-06-20

本文共 7039 字,大约阅读时间需要 23 分钟。

原文:

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013224722/article/details/81784443

费劲写了一个动效,却要被砍掉,心碎....


private List
GetBuckyBallPoints() { List
ltPoints = new List
(); ltPoints.Add(new Point3D(.850651, 0, 2.327438)); ltPoints.Add(new Point3D(.262866, .809017, 2.327438)); ltPoints.Add(new Point3D(-.688191, .5, 2.327438)); ltPoints.Add(new Point3D(-.688191, -.5, 2.327438)); ltPoints.Add(new Point3D(.262866, -.809017, 2.327438)); ltPoints.Add(new Point3D(1.701301, 0, 1.801708)); ltPoints.Add(new Point3D(.52573, 1.618035, 1.801708)); ltPoints.Add(new Point3D(.52573, -1.618035, 1.801708)); ltPoints.Add(new Point3D(-1.376383, -.999999, 1.801708)); ltPoints.Add(new Point3D(-1.376383, .999999, 1.801708)); ltPoints.Add(new Point3D(1.964166, .809017, 1.275977)); ltPoints.Add(new Point3D(1.376381, 1.618035, 1.275977)); ltPoints.Add(new Point3D(-.162461, 2.118035, 1.275977)); ltPoints.Add(new Point3D(-1.113517, 1.809017, 1.275977)); ltPoints.Add(new Point3D(-2.064574, .5, 1.275977)); ltPoints.Add(new Point3D(-2.064574, -.5, 1.275977)); ltPoints.Add(new Point3D(-1.113517, -1.809017, 1.275977)); ltPoints.Add(new Point3D(-.162461, -2.118035, 1.275977)); ltPoints.Add(new Point3D(1.376381, -1.618035, 1.275977)); ltPoints.Add(new Point3D(1.964166, -.809017, 1.275977)); ltPoints.Add(new Point3D(2.389492, .5, .425326)); ltPoints.Add(new Point3D(1.213921, 2.118035, .425326)); ltPoints.Add(new Point3D(.262865, 2.427051, .425326)); ltPoints.Add(new Point3D(-1.639248, 1.809017, .425326)); ltPoints.Add(new Point3D(-2.227033, .999999, .425326)); ltPoints.Add(new Point3D(-2.227033, -.999999, .425326)); ltPoints.Add(new Point3D(-1.639248, -1.809017, .425326)); ltPoints.Add(new Point3D(.262865, -2.427051, .425326)); ltPoints.Add(new Point3D(1.213921, -2.118035, .425326)); ltPoints.Add(new Point3D(2.389492, -.5, .425326)); ltPoints.Add(new Point3D(2.227033, .999999, -.425326)); ltPoints.Add(new Point3D(1.639248, 1.809017, -.425326)); ltPoints.Add(new Point3D(-.262865, 2.427051, -.425326)); ltPoints.Add(new Point3D(-1.213921, 2.118035, -.425326)); ltPoints.Add(new Point3D(-2.389492, .5, -.425326)); ltPoints.Add(new Point3D(-2.389492, -.5, -.425326)); ltPoints.Add(new Point3D(-1.213921, -2.118035, -.425326)); ltPoints.Add(new Point3D(-.262865, -2.427051, -.425326)); ltPoints.Add(new Point3D(1.639248, -1.809017, -.425326)); ltPoints.Add(new Point3D(2.227033, -.999999, -.425326)); ltPoints.Add(new Point3D(2.064574, .5, -1.275977)); ltPoints.Add(new Point3D(1.113517, 1.809017, -1.275977)); ltPoints.Add(new Point3D(.162461, 2.118035, -1.275977)); ltPoints.Add(new Point3D(-1.376381, 1.618035, -1.275977)); ltPoints.Add(new Point3D(-1.964166, .809017, -1.275977)); ltPoints.Add(new Point3D(-1.964166, -.809017, -1.275977)); ltPoints.Add(new Point3D(-1.376381, -1.618035, -1.275977)); ltPoints.Add(new Point3D(.162461, -2.118035, -1.275977)); ltPoints.Add(new Point3D(1.113517, -1.809017, -1.275977)); ltPoints.Add(new Point3D(2.064574, -.5, -1.275977)); ltPoints.Add(new Point3D(1.376383, .999999, -1.801708)); ltPoints.Add(new Point3D(-.52573, 1.618035, -1.801708)); ltPoints.Add(new Point3D(-1.701301, 0, -1.801708)); ltPoints.Add(new Point3D(-.52573, -1.618035, -1.801708)); ltPoints.Add(new Point3D(1.376383, -.999999, -1.801708)); ltPoints.Add(new Point3D(.688191, .5, -2.327438)); ltPoints.Add(new Point3D(-.262866, .809017, -2.327438)); ltPoints.Add(new Point3D(-.850651, 0, -2.327438)); ltPoints.Add(new Point3D(-.262866, -.809017, -2.327438)); ltPoints.Add(new Point3D(.688191, -.5, -2.327438)); return ltPoints; } private void CreateNationItems() { List
ltPoints = this.GetBuckyBallPoints(); Vector3D oVectorCenter = new Vector3D(0, 0, 2); for (int i = 0; i < ltPoints.Count; i++) { Point3D oPoint = ltPoints[i]; // 滚动碎片 InteractiveCustom3DPlane o3DPlane = new InteractiveCustom3DPlane(0.96, 0.3, 0, 0); o3DPlane.OffsetX = 0; o3DPlane.OffsetY = 0; o3DPlane.OffsetZ = 2; o3DPlane.RotateXCenterZ = -2; o3DPlane.RotateYCenterZ = -2; double dAngleX = Vector3D.AngleBetween(oVectorCenter, new Vector3D(0, oPoint.Y, oPoint.Z)); double dAngleY = Vector3D.AngleBetween(oVectorCenter, new Vector3D(oPoint.X, 0, oPoint.Z)); if (oPoint.Y < 0) dAngleX = -dAngleX; if (oPoint.X < 0) dAngleY = -dAngleY; if (Math.Abs(dAngleX) > 90) { o3DPlane.OffsetZ = -2; o3DPlane.RotateXCenterZ = 2; o3DPlane.RotateYCenterZ = 2; o3DPlane.ScaleX = -1; dAngleX = 180 - dAngleX; dAngleY = 180 + dAngleY; } o3DPlane.AngleX = dAngleX; o3DPlane.AngleY = dAngleY; int nIndex = i; if (nIndex >= DataService.DataModels.Nations.Count) nIndex = Utilitys.GetRandomSeed().Next(0, 55); // 民族名称 string sNationName = DataService.DataModels.Nations[nIndex].Name; Border oBoder = new Border() { Width = 48, Height = 15 }; oBoder.Background = new SolidColorBrush(Colors.Transparent); TextBlock oTbk = new TextBlock(); oTbk.Text = sNationName; oTbk.Foreground = Brushes.White; oTbk.VerticalAlignment = VerticalAlignment.Center; oTbk.HorizontalAlignment = HorizontalAlignment.Center; oBoder.Child = oTbk; o3DPlane.Visual = oBoder; this.ViewportZm.Children.Add(o3DPlane); } }
DoubleAnimation oAnim = new DoubleAnimation(0, -360, TimeSpan.FromSeconds(6));            oAnim.RepeatBehavior = RepeatBehavior.Forever;            this.CameraAngleZm.BeginAnimation(AxisAngleRotation3D.AngleProperty, oAnim);            DoubleAnimation oAnimLogo = new DoubleAnimation(0, -360, TimeSpan.FromSeconds(6));            oAnimLogo.RepeatBehavior = RepeatBehavior.Forever;            this.LogoAngleZm.BeginAnimation(AxisAngleRotation3D.AngleProperty, oAnimLogo);

 

你可能感兴趣的文章
SIP入门(二):建立SIPserver
查看>>
Servlet3.0的异步
查看>>
WebService连接postgresql( 失败尝试)
查看>>
从头认识java-13.11 对照数组与泛型容器,观察类型擦除给泛型容器带来什么问题?...
查看>>
Python-MacOSX下SIP引起的pip权限问题解决方案(非取消SIP机制)
查看>>
从MFQ方法到需求分析
查看>>
android.view.WindowManager$BadTokenException: Unable to add window
查看>>
HDU5012:Dice(bfs模板)
查看>>
iphone openssh
查看>>
Linux下MEncoder的编译
查看>>
Javascript中闭包(Closure)的探索(一)-基本概念
查看>>
spark高级排序彻底解秘
查看>>
ylbtech-LanguageSamples-PartialTypes(部分类型)
查看>>
福建省促进大数据发展:变分散式管理为统筹集中式管理
查看>>
开发环境、生产环境、测试环境的基本理解和区别
查看>>
tomcat多应用之间如何共享jar
查看>>
Flex前后台交互,service层调用后台服务的简单封装
查看>>
MySQL入门12-数据类型
查看>>
Windows Azure 保留已存在的虚拟网络外网IP(云服务)
查看>>
修改字符集
查看>>