WPF-3D动效-文字球形环绕
费劲写了一个动效,却要被砍掉,心碎....
private List<Point3D> GetBuckyBallPoints()
{
List<Point3D> ltPoints = new List<Point3D>();
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<Point3D> 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);
<Viewport3D x:Name="ViewportZm" IsHitTestVisible="True" RenderOptions.EdgeMode="Aliased" Margin="0,100,-0,50">
<Viewport3D.Camera>
<PerspectiveCamera x:Name="CameraZm" Position="0,0,10" LookDirection="0,0,-1">
<PerspectiveCamera.Transform>
<Transform3DGroup>
<TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="0" x:Name="CameraTranslateZm"/>
<RotateTransform3D x:Name="myRotateTransform3D">
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Angle="0" Axis="0 1 0" x:Name="CameraAngleZm"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>
</Transform3DGroup>
</PerspectiveCamera.Transform>
</PerspectiveCamera>
</Viewport3D.Camera>
<ModelVisual3D>
<ModelVisual3D.Content>
<Model3DGroup>
<AmbientLight Color="White"/>
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D x:Name="earthmodel">
<ModelVisual3D.Content>
<GeometryModel3D Geometry ="{Binding Source={StaticResource sphere},
Path=Geometry}">
<GeometryModel3D.Material>
<DiffuseMaterial Brush="{StaticResource KeyImgBrushModuleMenuBg}">
</DiffuseMaterial>
</GeometryModel3D.Material>
<GeometryModel3D.Transform>
<RotateTransform3D >
<RotateTransform3D.Rotation>
<AxisAngleRotation3D x:Name="YRotate" Angle="0"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>
</GeometryModel3D.Transform>
</GeometryModel3D>
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D x:Name="Mv3dLogoZm">
<ModelVisual3D.Transform>
<Transform3DGroup>
<TranslateTransform3D OffsetZ="0" OffsetX="0" OffsetY="0"/>
<ScaleTransform3D ScaleZ="0" ScaleY="0.7" ScaleX="0.7"/>
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Axis="0,1,0" Angle="360" x:Name="LogoAngleZm"/>
</RotateTransform3D.Rotation>
</RotateTransform3D>
</Transform3DGroup>
</ModelVisual3D.Transform>
<ModelVisual3D.Content>
<GeometryModel3D>
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions="-2.4,-2.7,0 2.4,-2.7,0 2.4,2.7,0 -2.4,2.7,0"
TriangleIndices="0,1,2 0,2,3" TextureCoordinates="0 1 1 1 1 0 0 0">
</MeshGeometry3D>
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<DiffuseMaterial Brush="{StaticResource KeyImgBrushLogo}">
</DiffuseMaterial>
</GeometryModel3D.Material>
</GeometryModel3D>
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D x:Name="Mv3dContentZm">
</ModelVisual3D>
</Viewport3D>
WPF-3D动效-文字球形环绕的更多相关文章
- Principle如何制作动效设计?简单易学的Principle动效设计教程
Principle for Mac是一款新开发的交互设计软件.相比 Pixate 更容易上手,界面类似 Sketch 等做图软件,思路有点像用 Keynote 做动画,更「可视化」一些. 如果您还没有 ...
- 巧用 background-clip 实现超强的文字动效
最近,有同学询问,如何使用 CSS 实现如下效果: 看起来是个很有意思的动效. 仔细思考一下,要想实现这类效果,其实用到的核心属性只有一个 -- background-clip: text. 有意思的 ...
- 拒绝枯燥,有意思的 Loading 页面动效设计
互联网时代,网络“提速”日益频繁,人们打开Web或软件的速度越来越快,一般页面缓冲和加载地过程也是几不可查.然而,在某些情况下,例如软件急需加载大量页面,首页急需加载大量内容,用户下载文件过大,甚至是 ...
- 巧用 -webkit-box-reflect 倒影实现各类动效
在很久之前的一篇文章,有讲到 -webkit-box-reflect 这个属性 -- 从倒影说起,谈谈 CSS 继承 inherit -webkit-box-reflect 是一个非常有意思的属性,它 ...
- Web动效研究与实践
随着CSS3和HTML5的发展,越来越多狂拽炫酷叼炸天的动效在网页设计上遍地开花,根据最新的浏览器市场份额报告,IE6的份额已经降到了5.21%,这简直是一个喜大普奔的消息,做动效可以完全不care低 ...
- android动效开篇
大神博客:http://blog.csdn.net/tianjian4592/article/details/44155147 在现在的Android App开发中,动效越来越受到产品和设计师同学的重 ...
- WPF 3D:简单的Point3D和Vector3D动画创造一个旋转的正方体
原文:WPF 3D:简单的Point3D和Vector3D动画创造一个旋转的正方体 运行结果: 事实上很简单,定义好一个正方体,处理好纹理.关于MeshGeometry3D的正确定义和纹理这里就不多讲 ...
- 基于clip-path的任意元素的碎片拼接动效(源自鑫空间)
一.实现原理. 效果本质上是CSS3动画,就是旋转transform:rotate和位移:transform:translate,只是旋转和位移的部件是三角碎片而已.三角是使用CSS3 clip-pa ...
- iOS开发之 Lottie -- 炫酷的动效
动效在软件开发中非常常见,炫酷的动画能提升应用的B格,然而由设计师的设计转化成程序猿GG的代码是个非常"痛苦"的过程.对于复杂动画,可能要花费很多时间去研究和实现.Lottie 的 ...
随机推荐
- ArcGIS Spatial Query
Creates a spatial query which performs a spatial search for features in the supplied feature class a ...
- UI组件之TextView及其子类(三)ToggleButton和Switch
ToggleButton.Switch.CheckBox和RadioButton都是继承自android.widget.CompoundButton,意思是可选择的,因此它们的使用方法都非常类似. C ...
- php实现构建乘积数组(算法:替换)(语法错误:分号和$符号)
php实现构建乘积数组(算法:替换)(语法错误:分号和$符号) 一.总结 1.算法:替换 2.语法错误:分号和$符号 二.php实现构建乘积数组 题目描述: 给定一个数组A[0,1,...,n-1], ...
- CentOS下安装和配置MySQL-JDK-Tomcat-Nginx(个人官网环境搭建手册)
今天,重新弄我的个人云主机的环境,准备运营自己用Java写的个人官网等网站. 服务器环境:阿里云CentOS 6.4位 包括以下脚本在内的绝大部分命令和脚本,都是我亲自执行过,靠谱的. 完整的&quo ...
- JQuery中Ajax详细参数使用案例
JQuery中Ajax详细参数使用案例 参考文档:http://www.jb51.net/shouce/jquery1.82/ 参考文档:http://jquery.cuishifeng.cn/jQu ...
- target属性值
有 4 个保留的目标名称用作特殊的文档重定向操作: _blank 浏览器总在一个新打开.未命名的窗体中加载目标文档. _self 这个目标的值对全部没有指定目标的 <a> 标签是默认目标, ...
- ps如何制作gif(窗口->动画)(导出:存储为Web和设备所用格式)
ps如何制作gif(窗口->动画)(导出:存储为Web和设备所用格式) 一.总结 1.点击窗口,选择动画 2.导出的时候:存储为Web和设备所用格式 二.ps如何制作gif 1.首先我们安装并打 ...
- Opencv中integral计算积分图
Paul Viola和Michael Jones在2001年首次将积分图应用在图像特征提取上,在他们的论文"Rapid Object Detection using a Boosted Ca ...
- 前端切图:调用百度地图API
原型图 图片发自简书App <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- [转至云风的博客]开发笔记 (2) :redis 数据库结构设计
接上回,按照我们一期项目的需求,昨天我简单设计了数据库里的数据格式.数据库采用的是 Redis ,我把它看成一个远端的数据结构保存设备.它提供基本的 Key-Value 储存功能,没有层级表.如果需要 ...