前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >用 Wolfram 语言模拟东京奥运会开幕式的无人机地球表演

用 Wolfram 语言模拟东京奥运会开幕式的无人机地球表演

作者头像
WolframChina
发布2021-08-24 14:37:28
3760
发布2021-08-24 14:37:28
举报
文章被收录于专栏:WOLFRAMWOLFRAM

迟到的 2020 年夏季奥运会开幕式于 2021 年 7 月 23 日在东京奥林匹克体育场举行。1824 架无人机在体育场上空以 3D 方式呈现东京奥运会会徽和之后拥有各大洲的地球。我尝试使用 Mathematica 重新创建这些球体。

初始化

代码语言:javascript
复制
R=1; (* radius of inner circle of the emblem *)\[IndentingNewLine]pr=2; (* radius of outer circle of the emblem *)\[IndentingNewLine]r=0.03; (* radius of sphere as a drone *)\[IndentingNewLine]imgsize=240; (* image size *)\[IndentingNewLine]fr=12; (* frame rate *)\[IndentingNewLine]\[IndentingNewLine](* options of Graphics3D *) g3Dopt={Background->Black,ImageSize->imgsize,Boxed->True,BoxStyle->Black,PlotRange->pr{{-1,1},{-1,1},{-1,1}},SphericalRegion->True,\[IndentingNewLine]Lighting->{{"Point",White,{0,-2.5,0},{.5,1,0}},{"Point",Blue,{0,0,0}}},ViewPoint->{0,-10,0}};

2020 年东京奥运会会徽的要点

可以参考两年前我发表的东京2020奥运会和残奥会会徽:https://community.wolfram.com/groups/-/m/t/1758435

地球上的点

从 pts 到 earthpts 的路径

旋转地球

制作框架

从显示会徽开始制作框架,然后显示地球,旋转和关掉照明。

代码语言:javascript
复制
blackframe=Image@ConstantArray[0.,{imgsize,imgsize,3}];\[IndentingNewLine]frame3=Join[Table[blackframe,{fr/2}],(* black background *)\[IndentingNewLine]Table[Darker[frame1[[1]],(fr-i)/fr],{i,1,fr}],(* turning on the lights *)\[IndentingNewLine]Table[frame1[[1]],2fr],(* the emblem *)\[IndentingNewLine]frame1,(* converting from the emblem to the earth *)\[IndentingNewLine]Table[frame1[[-1]],fr],(* the earth *)\[IndentingNewLine]frame2,(* rotating the earth  *)\[IndentingNewLine]Table[Darker[frame2[[i]],i/(Length@frame2/2)],{i,2,Length@frame2/2}](* turning off the lights *)\[IndentingNewLine]];\[IndentingNewLine](* crop frames *)\[IndentingNewLine]frame4=ImageCrop[#,160]&/@frame3;

产生动画

使用带有添加背景的框架产生动画。


想尝试的同学,点击“阅读原文”上官网获取源代码吧。

在 Wolfram 演示项目官网还有很多由 Yasushi Miki 制作的类似的代码哦!(https://demonstrations.wolfram.com/author.html?author=Yasushi%20Miki)

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2021-08-10,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 WOLFRAM 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档