位置: 编程技术 - 正文

向量的倒影 公式推导(向量上面有个倒着的v)

编辑:rootadmin

推荐整理分享向量的倒影 公式推导(向量上面有个倒着的v),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:向量反过来坐标怎么变,向量的倒影 公式是什么,向量的倒影 公式怎么算,向量的倒影 公式怎么算,向量的倒置,向量的倒影 公式怎么求,向量的倒影 公式怎么算,向量的倒影公式,内容如对您有帮助,希望把文章链接给更多的朋友!

这几天在处理3D倒影的时候,遇到了如何生成倒影的问题,经过一番查找,找到了一篇关于如何生成倒影的文章,讲解得比较详细,转载下来,供大家学习参考。

向量的倒影 公式推导(向量上面有个倒着的v)

Reflecting a Vector Jan ,

This is a mainly math tutorial, but don't worry, they won't all be math. It might not be immediately and directly useful, but having an understanding of 3D Math is something that is near essential to many types of modern game programming, and also something not likely to go out of date when new technology comes out. The scenario I'll use for this example is that the player has thrown a grenade, and you want it to bounce off any object that it hits. It should be pretty easy to just look up a formula, but let's try working it out ourselves. First I'll define what we know already:V - Velocity VectorN - The Normal Vector of the plane the grenade has struck.What we need to figure out is:R - The new vector after reflecting velocity in N.Here's a diagram showing these vectors. It's a 2D diagram with Vector N aligned to an axis to make it easier to understand what I'm doing( and easier for me to draw.) However we want to solve the general problem for any 3D vectors.Remember that the dot product, which returns a scalar value, can be used in projecting a vector onto another axis. (I should point out that the vector N here is a unit vector.) To project V onto N, the formula is (V dot N)*N.I worked this out on paper using relationships. In the diagram to the left I centered all the vectors on the origin, except the green ones, because those I'm adding together to try to get R.The actual formula for reflecting a vector then is:R = 2*(V dot N)*N - V

Now this isn't just reflecting the velocity, it's a bounce, so we actually want -R. We need to negate the formula, giving us:

Vnew = -2*(V dot N)*N &#; VYou can look the bounce formula this way: (V dot N)*N is the movement towards the plane along the plane normal, subtract it once and V is parallel with the plane, twice and it has bounced off the plane.

Also, when an object bounces some of its speed is lost (how much depends on the object itself and what it hits.) We'll call this value b where b=0.0 means no bounce, and b=1.0 means no loss of speed. So for the final formula, this is what he have:

Vnew = b * ( -2*(V dot N)*N &#; V )

OpenGL入门一 说起编程作图,大概还有很多人想起TC的#includegraphics.h吧?但是各位是否想过,那些画面绚丽的PC游戏是如何编写出来的?就靠TC那可怜的*分辨率、1

OpenGL入门二 本次课程所要讲的是绘制简单的几何图形,在实际绘制之前,让我们先熟悉一些概念。一、点、直线和多边形我们知道数学(具体的说,是几何学)中

OpenGL编程逐步深入(九)插值处理 注:文中VS代指顶点着色器,FS代指片段着色器。准备知识这个教程和大家展示3d管道中非常重要的部分,即Interpolation(插值)。光栅化程序执行的插值

标签: 向量上面有个倒着的v

本文链接地址:https://www.jiuchutong.com/biancheng/369586.html 转载请保留说明!

上一篇:OpenGL--阴影(opengl阴影平移)

下一篇:OpenGL入门一(opengl入门教程(精))

  • 破产企业发放工资要不要纳税?
  • 纳税怎么算
  • 银行利息支出税前扣除标准
  • 财务要做哪些表
  • 未分配利润期末减期初等于什么
  • 养老机构提供的养老服务免增值税吗
  • 利税总额计算公式表
  • 公司无公务用车
  • 反倾销税由谁缴纳
  • 企业所得税季报填报说明
  • 外币报表折算差额为负数代表
  • 个税申报系统的备份保留几份数据
  • 只有发票没有银行客户专用回单是啥意思
  • 小规模购进商品只收到记账联专票
  • 应收账款借贷方向表示什么意思
  • 刷卡机怎么收费的吗
  • 赠送积分怎么确认收入
  • 无发票材料可以入材料账吗
  • 取得基建借款分录
  • os x 10.10 yosemite自动纠正怎么关?os x yosemite自动纠正功能关闭教程
  • slee401.exe - slee401是什么进程 有什么用
  • 银行承兑汇票贴现怎么算
  • 常用的几种布局格式
  • 购买软件多大金额算违法
  • wordpress neve
  • 增资会计
  • okhttp源码
  • 金蝶年底结账流程
  • 个人所得税既有工资薪金又有劳务报酬房屋租金
  • 法人治理结构是指明确
  • 营业执照是如何年审的
  • SQLServer 2008 :error 40出现连接错误的解决方法
  • access数据库用户名和密码
  • Ubuntu上安装jdk
  • 专项应付款转资本公积需要缴纳所得税
  • 库存股会计处理流程
  • 收入结转到本年利润的会计分录
  • 支付货代运费账务处理
  • 发票线上申领线下配送
  • 营业外收入的主要核算内容
  • 差旅费借贷记账法的会计分录
  • 简易征收可以开具3专票吗
  • 固定资产公司
  • win2008安装sql2005
  • mysql的随机函数
  • win10语言栏没有
  • centos mtr
  • 安装最新的powershell,了解新功能和改进
  • win7怎么用耳机听歌
  • ubuntu添加环境变量后黑屏
  • 手动防止Ping攻击方法(无需防火墙)
  • .hpp是什么文件
  • cpqdfwag.exe是什么进程 能结束吗 cpqdfwag进程查询
  • win8 cmd在哪
  • application error message 漏洞验证
  • mac怎么快速上手
  • 家字取名男孩名字
  • win8激活windows
  • 移动宽带解绑怎么办理
  • win7的环境变量如何还原
  • win7无线wifi
  • opengl坐标系原点
  • chrome浏览记录保存多久
  • javascript中函数
  • shell脚本基础教学
  • PyCharm在win10的64位系统安装实例
  • 详解使用Visual Studio Code对Node.js进行断点调试
  • python 操作微信
  • 星球大战与高达的关系
  • 抽奖小程序模板
  • js计算字体宽度
  • unity3d游戏开发笔记本推荐
  • 新浪微博手机客户端下载
  • 怎么用python画图具体步骤
  • First Class: UI of Android
  • 沈阳国税局局长是谁
  • 湖南省地方税务局
  • 国家税务总局办公室电话
  • 国家税务总局176号公告
  • 中国古代的税收制度的演变
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设