位置: 编程技术 - 正文

向量的倒影 公式推导(向量上面有个倒着的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入门教程(精))

  • 居民企业投资收益免征企业所得税
  • 固定资产的处理包括
  • 有形资产负债率和有形净值负债率
  • 已经验旧的发票可以作废吗
  • 预付款核销会计分录
  • 居民企业参股外国企业信息报告填写
  • 在登记账簿时,应在记账凭证上注明所记账簿的页数
  • 支付一年房租计入什么科目
  • 装修公司帮客户套现装修贷违法吗
  • 营改增后自建厂房抵扣
  • 税审报告谁签字
  • 旅行社代订机票可以入差旅费报销吗
  • 当进项大于销项需要做账务处理吗?
  • 公允价值变动增加在借方还是贷方
  • 简易办法计税销售额如何填写
  • 分公司会有股东吗
  • 工资税金算法
  • 预提成本的会计处理
  • 报销差旅费涉及的会计科目
  • 怎样打开电脑wifi连接
  • 为什么win7系统添加语言包
  • u盘文件全都变成快捷方式怎么办
  • Win7系统中如何快速查询文件内容
  • 财政拨款结余的明细科目
  • 社会保险费的征收程序
  • win10电脑声道怎么设置
  • 纳税调整需要调年度报表嘛
  • 是否亏损看什么
  • vue大屏组件库
  • PHP:pg_execute()的用法_PostgreSQL函数
  • React常见面试题
  • frameworkscheduled
  • vue ts
  • vue获取当前行
  • 固定资产处置科目有哪些
  • 金融资产或金融负债满足下列条件之一
  • 业务招待费的报销额度是多少
  • 人力资源外包服务企业
  • 契税计税依据是否包含耕地占用税
  • 建筑企业预缴的增值税怎么抵扣
  • sqlserver存储过程if语句
  • sh sqlplus
  • 其他综合收益和营业外收入的区别
  • 购进免税农产品发生非正常损失
  • 其他收益结转到什么科目
  • 销售边角废料属于什么
  • 快递费用是否可以开发票
  • 重分类调整分录是什么
  • 哪些行业不适用作业法
  • 企业网银的电子对账未签约需要本人去吗
  • 会议中发生的相关事件
  • 触发器的用法
  • xp磁盘管理打不开
  • 让64位的Windows Server 2008支持蓝牙的方法
  • windows vista 版本
  • win7系统对拷的方法
  • win7系统如何添加虚拟网卡
  • js实现下拉框联动
  • python语言中
  • unity3d游戏引擎支持几种平台发布?
  • opengl自学
  • node性能优化
  • jquery实现隔行变色的分享特效页面
  • react和nodejs
  • shell 读取文件中的每一行并存储到数组
  • 创建简单的Web网页实验总结ASP
  • javascript总结笔记
  • jquery中的基本选择器有哪些
  • Android自定义动画
  • android布局有哪些,它们的作用分别是?
  • 小规模增值税减免会计科目
  • 税务工商指的是什么
  • 研发费用加计扣除2022政策
  • 什么叫关联单位
  • 人工成本占企业利润比例
  • 技术进出口指什么技术
  • 河北省国家税务局电子税务局官网
  • 收到12366的短信
  • 下载安徽税务app并安装
  • 买车购置税去哪里交钱
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设