位置: 编程技术 - 正文

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

  • 购销合同印花税按70%
  • 小规模经营租赁开票税率
  • 计提工资是计提哪个月的
  • 普通发票税额没有打印全可以用么
  • 公司付给中间人居间费用如何纳税
  • 残保金滞纳金能超过本金吗
  • 借已交税金贷银行存款
  • 票面3个点什么意思
  • 合同每三个月付一次款
  • 申请增值税专用发票需要什么资料
  • 处置使用过的固定资产,税率按多少
  • 冲去年其他应付款做管理费用凭证
  • 公司对公银行账户可以注销吗
  • 长期股权投资成本法初始计量
  • 买房报销
  • 递延收益可以是负数吗
  • 税控专用发票和普通发票
  • 境外所得纳税
  • 缴纳的社保费可以退吗怎么退
  • 发票备注有法律效力吗
  • 净资产增长率为正数说明什么
  • 增值税价外费用不包括
  • 临时员工什么意思
  • 所得税不退税怎么写情况说明
  • 补交以前年度个税怎么做账
  • qctray.exe - qctray进程 是什么文件 作用是什么
  • 下列项目中属于免征增值税的有
  • 企业工商年报填错了怎么办
  • 小规模纳税人免征增值税的账务处理
  • 生产企业委外加工比例出口免抵退税
  • mac 如何u盘启动
  • 应付票据的核算方法有哪些
  • 所有者权益的确认主要依赖于什么
  • PHP:pg_unescape_bytea()的用法_PostgreSQL函数
  • 融资租赁与经营租赁的区别主要是
  • php怎么新建
  • 未签订销售合同
  • 应付现金股利通过
  • yolov5模型中git的作用
  • 科研项目财政拨款多少
  • 货款退回账务处理方法
  • 发票章需要注销吗
  • 长期股权投资的账务处理
  • 企业能否自行填开发票入账
  • 包含个人社保的保险
  • 保函被索赔支付什么意思
  • 工人意外伤害保险
  • 玉米 收购
  • 固定资产原值和净值在报表哪里看
  • 收据4联
  • mysql的存储过程怎么理解
  • 财务费用的内容包括哪些
  • 什么是财产行为税举例
  • 用材料抵扣货款通知怎样写
  • 进项转出再转入
  • 现金股利征收个人所得税吗
  • 支付的劳务派遣服务费计入什么科目
  • 职工食堂的费用可以在差额里扣除吗
  • 临建费用包含在哪里
  • 残疾人保障金怎么申报
  • mysql数据库基础与实践课后答案
  • windows server2008系统弹出今天必须修改密码该怎么处理?
  • xp系统安装软件重复
  • freebsd 配置ip
  • 步步简笔画
  • 如何ie8升级到10
  • linux arp -n
  • 在xp系统中设置u盘启动
  • win7系统桌面快捷键
  • 如何设置win10用户名
  • win7如何使用usb无线网卡
  • win7旗舰版系统激活密钥
  • 3dsMax插件开发环境配置
  • 手把手教怎么说
  • easyui 表单提交
  • jquery event
  • 怎么打印纳税申报单
  • 工会开票要求
  • 新车交了购置税后给什么凭证
  • 什么是集体约谈制
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设