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

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

原文:

版权声明:本文为博主原创文章,未经博主允许不得转载。 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);

 

posted on
2018-08-30 11:16 阅读(
...) 评论(
...)

转载于:https://www.cnblogs.com/lonelyxmas/p/9559032.html

你可能感兴趣的文章
1076 Wifi密码 (15 分)
查看>>
noip模拟赛 党
查看>>
bzoj2038 [2009国家集训队]小Z的袜子(hose)
查看>>
Java反射机制及其Class类浅析
查看>>
Postman-----如何导入和导出
查看>>
移动设备显示尺寸大全 CSS3媒体查询
查看>>
图片等比例缩放及图片上下剧中
查看>>
【转载】Linux screen 命令详解
查看>>
background-clip,background-origin
查看>>
Android 高级UI设计笔记12:ImageSwitcher图片切换器
查看>>
【Linux】ping命令详解
查看>>
对团队成员公开感谢博客
查看>>
java学习第三天
查看>>
python目录
查看>>
django+uwsgi+nginx+sqlite3部署+screen
查看>>
Andriod小型管理系统(Activity,SQLite库操作,ListView操作)(源代码下载)
查看>>
在Server上得到数据组装成HTML后导出到Excel。两种方法。
查看>>
浅谈项目需求变更管理
查看>>
经典算法系列一-快速排序
查看>>
设置java web工程中默认访问首页的几种方式
查看>>