Visualizing wave interference using FireMonkey(很美)
Visualizing wave interference using FireMonkeyBy: Anders Ohlsson Abstract: This article discusses how you can generate your own dynamic 3-dimensional mesh for visualizing wave interference using Delphi XE2 and FireMonkey. Prerequisites!This article builds on my previous article "Visualizing mathematical functions by generating custom meshes using FireMonkey". The wave functionThe wave function we'll use in this article is: f(x,y) = A*sin(1/L*r-v*t) where:
In Delphi it simply becomes:
Note: It should be noted that this function simply gives us the state of equilibrium. We're completely ignoring starting scenarios and the fact that waves die out over time and distance. The screen shot below shows one wave: Hide image
Generating the meshIn order to generate the mesh, we borrow the code from my previous article, and modify it slightly to give it a time parameter:
Animating the meshThe above code generates a "snap shot" of the wave interaction between 4 waves at any time t. Animating the wave is simply a matter of using a timer to increment time and re-generating the mesh over and over again:
The waves are represented by this record:
In the demo project that accompanies this article, I have declared 4 starting waves like so:
Note that all 4 waves have the same properties, except that their origins are spread across the coordinate system. Specifically they're located in (-20,-20), (+20,-20), (+20,+20) and (-20,+20). Demo applicationYou can find my demo application in CodeCentral. http://edn.embarcadero.com/article/42012 |
Visualizing wave interference using FireMonkey(很美)的更多相关文章
- css3很美的蟠桃动画
查看效果:http://hovertree.com/texiao/css3/26/ 源码下载:http://hovertree.com/h/bjaf/ndhxgfkn.htm 效果图如下: 代码如下: ...
- x01.os.15: 看上去很美
张碧晨在韩国学的不是技巧,而是基本功:气息!声音由气息托着,似真声而不是真声,似假声又不是假声,所以才能在动听的地方唱得更动听.编程也是一样,基本功很重要:内存!所谓的黑客高手,攻击的一大手段,便是利 ...
- StoryBoard--看上去很美
StoryBoard--看上去很美 介绍 StoryBoard 是苹果在 2011 年的 WWDC Session 309<Introducing Interface Builder Story ...
- 看上去很美 国内CDN现状与美国对比
CDN的理想与现实 多年以前,当<Kingdom of Heaven>这部史诗电影发行的时候,中国的影迷使用电驴和BT来寻找种子,而那个时候,高清也才刚刚进入电影领域,我的同事不惜用自家的 ...
- oracle 11G direct path read 很美也很伤人
direct path read在11g中,全表扫描可能使用direct path read方式,绕过buffer cache,这样的全表扫描就是物理读了. 在10g中,都是通过gc buffer来读 ...
- 听起来很美,用起来很累!停车类APP软肋在哪
据数据显示,全国现有汽车已达1亿7千万辆,停车位缺于6800万个.而在北京,汽车保有量和车位的配比大约是1:0.5,而国际上一般是1:1.2,结构严重失衡.正所谓哪里有需求,哪里就有市场.停车位的走俏 ...
- Visualizing mathematical functions by generating custom meshes using FireMonkey(很美)
Abstract: This article discusses how you can generate your own 3-dimensional mesh for visualizing ma ...
- MacBook USB Type-C接口很美?其实是缩水的!
苹果终于推出了12寸的全新MacBook,拥有2304×1440的高分辨率.蝶式结构全尺寸键盘.新的触摸板.14nm Core M处理器和无风扇设计,以及新的USB 3.1 Type-C接口.可以预料 ...
- 微信小程序看上去很美
目前不少关于 微信小程序 的文章主要集中在两各方面:一是开发技术细节:二是怎么靠此赚钱. -- “微信小程序”所处的环境 -- 2016年初,美国号召全民学编程,包括监狱服刑人员.同样,在中国要想掌握 ...
随机推荐
- Atitit.提升软件Web应用程序 app性能的方法原理 h5 js java c# php python android .net
Atitit.提升软件Web应用程序 app性能的方法原理 h5 js java c# php python android .net 1. 提升单例有能力的1 2. 减少工作数量2 2.1. 减少距 ...
- JPA(二):EntityManager
上述我们知道什么是JPA了,接下来这篇文章就主要为大家介绍JPA的一个重要内容:EntityManager.不论什么对实体的操作都是通过它来完毕的. 先来说说什么是EntityManager.顾名思义 ...
- QT .pro文件 LIBS用法详解
在程序中需要使用到团队其它成员开发的静态库和动态库,起初是知道使用LIBS变量在在.pro文件中指定需要包含的库,但是实际使用的时候却遇到很大麻烦,但其实确实是因为自己看官方文档不太用心造成的. 下面 ...
- linux学习笔记6--命令mv
mv命令是move的缩写,可以用来移动文件或者将文件改名(move (rename) files),是Linux系统下常用的命令,经常用来备份文件或者目录. mv命令用来对文件或目录重新命名,或者将文 ...
- JackJson的一些方法
package cn.edu.hbcf.common.jackjson; import java.io.IOException; import java.text.SimpleDateFormat; ...
- Hadoop 安装指南
一.安装JDK 1.用户可以在Oracle JDK的官网下载相应版本的JDK,本例以JDK 1.6为例,官网地址为http://www.oracle.com/tech-network/java/jav ...
- vim 设置
TL;DR: $ git clone https://github.com/sontek/dotfiles.git $ cd dotfiles $ ./install.sh vim Download ...
- cocos2d-x 输入框CCEditBox的使用
特别说明: 这个版本的CCEditBox,设计有缺陷,背景图片的位置与输入区域的位置不同步,需要自己修改原来的代码,自己加上输入区域的坐标偏移量. void CCEditBox::setPositio ...
- C# mvc中动态压缩文件发送给前端
前言 帮朋友解决一个C#中发送压缩文件的的问题,因为感觉解释起来更麻烦,就直接用几分钟时间写了个小Demo.本着"走过路过"不错过的原则,也给记录一下. 1.前端代码 非常简单的一 ...
- php中的 file_get_contents(‘php://input’)
今天用CI框架整合微信发现了一个没见过的 file_get_contents('php://input'); 这个家伙是干嘛用的,然后自己直接写了验证的代码.好吧 废话不多说直接看下面的代码. < ...