当前位置: 首页 > news >正文

网站扫码怎么做的象山县建设管理局网站

网站扫码怎么做的,象山县建设管理局网站,长春火车站最新防疫要求,深圳建网站公司qml实现的水波纹特效 1.横向波纹效果2.另一种效果(纵向波纹) 一直以来使用c qt如果要实现一些高级特效比如水波纹效果都难度比较大,但是使用qt quick难度就会小很多。这里借鉴一些网友的思路简单实现一下水波纹效果。主要思路就是波浪的形成是…

qml实现的水波纹特效

  • 1.横向波纹效果
  • 2.另一种效果(纵向波纹)

一直以来使用c++ qt如果要实现一些高级特效比如水波纹效果都难度比较大,但是使用qt quick难度就会小很多。这里借鉴一些网友的思路简单实现一下水波纹效果。主要思路就是波浪的形成是基于sin曲线,以此来影响纹理坐标的颜色,然后加上时间动画不断改变曲线的坐标,从而达到一个波动效果。

1.横向波纹效果

Window {visible: truewidth: 800height: 600title: "Water Ripple Effect"Image {id: sourceImgwidth: 800height: 600source: "qrc:/12.png"}ShaderEffectSource {id: shaderSourcesourceItem: sourceImglive: true}ShaderEffect {id: waterEffectanchors.fill: parentproperty variant sourceTexture: shaderSourceproperty real frequency: 10property real amplitude: 0.04property real time: 0.0NumberAnimation on time {from: 0.0to: Math.PI*2duration: 1000loops: Animation.Infinite}fragmentShader: "varying highp vec2 qt_TexCoord0;uniform sampler2D sourceTexture;uniform highp float frequency;uniform highp float amplitude;uniform highp float time;void main() {highp vec2 pulse = sin(time - frequency * qt_TexCoord0);highp vec2 coord = qt_TexCoord0 + amplitude * vec2(pulse.x, -pulse.x);gl_FragColor = texture2D(sourceTexture, coord);}"}
}

效果如下-波涛汹涌:
在这里插入图片描述

2.另一种效果(纵向波纹)

Window {visible: truewidth: 800height: 600title: "Water Ripple Effect"Image {id: sourceImgwidth: 800height: 600source: "qrc:/12.png"}ShaderEffectSource {id: shaderSourcesourceItem: sourceImglive: true}ShaderEffect {id: waterEffectanchors.fill: parentproperty variant sourceTexture: shaderSourceproperty real frequency: 10property real amplitude: 0.08property real time: 0.0NumberAnimation on time {from: 0.0to: Math.PI * 2duration: 1000loops: Animation.Infinite}fragmentShader: "varying highp vec2 qt_TexCoord0;uniform sampler2D sourceTexture;uniform highp float frequency;uniform highp float amplitude;uniform highp float time;void main() {highp vec2 uv = qt_TexCoord0;highp float wave = sin(uv.y * frequency + time) * amplitude;uv.x += wave;gl_FragColor = texture2D(sourceTexture, uv);}"}
}

效果-树的摇曳:
在这里插入图片描述

修改下频率和振幅效果:

property real frequency: 60
property real amplitude: 0.02

在这里插入图片描述
这样看起来是不是有点波光粼粼的感觉了。挺有趣的~!0…0
代码链接奉上感兴趣的可以研究玩玩:
波纹效果代码地址

作者:费码程序猿
欢迎技术交流:QQ:255895056
转载请注明出处,如有不当欢迎指正

http://www.yayakq.cn/news/942001/

相关文章:

  • 湖南网站排名小程序开发平台花多少钱
  • 淘宝网官方网站免费下载保险公司网站策划
  • 微软做网站的软件个人网站制作基本步骤
  • 网页好看的网站设计安卓的应用开发
  • 花都 网站建设国家电网电子商务平台
  • 东莞凤岗网站制作海南最新情况最新消息今天
  • python做网站效率理发店会员管理软件免费
  • 门户网站系统开发建设网上商城网站名称
  • 网站速度对seo的影响网页设计实验报告模板
  • 网站开发简称网站集约化建设
  • 湖北建网站公司福清市建设工程交易网站好像
  • 校园网站建设结论湖南省水利水电建设工程学校网站
  • 在word上怎么做网站链接成都公司展厅
  • 建设一个网站大概需要多久招聘网站做销售
  • 可以做360度全景图的网站大气的网站设计
  • 建设网站费用评估网站 文件夹 上传
  • 响应式网站背景兰考县红庙关东村做网站的
  • 公司网站版面怎么设计威海百度seo
  • 网站建设公司海南建设网站一般流程
  • 如何评价一个网站做的是否好南阳旅游网站建设
  • 做网站的图片大小是多少工业控制软件开发
  • 网站的思维导图怎么做网页设计100种技巧
  • 国外做健康的网站视频网站是如何做的
  • 厦门网站制作全程服务站长工具关键词
  • 海南建设银行官方网站岳阳建设企业网站
  • 网站被墙怎么办成都 做网站
  • 使用帝国做软件下载网站源码写作教学网站
  • 郑州哪家专业做淘宝网站个人申请开网店怎么注册
  • 怎样把已经有的网站做推广做网站fjfzwl
  • 官方网站车联网是谁做王烨在地府是什么身份