位置: 编程技术 - 正文

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

  • 小企业出租设备分录
  • 医院会计制度准则
  • 查补的税款怎样做账
  • 报销数字证书续费作财务凭证怎么做?
  • 收到高新企业补助款分录
  • 主营业务收入具体是什么
  • 减免税款记账营业外收入什么科目?
  • 检测费属于什么税目
  • 上年计提奖金今年怎么算
  • 未认缴出资的股东退股
  • 屋面维修按定额预算明细表
  • 代扣工资申请怎么写
  • 当月工资额什么意思
  • 非独立核算的分公司怎么做账
  • 城建税按实际缴纳增值税
  • 增值税附表三怎么填 举例说明
  • 机打发票领回怎么录入
  • 企业股权设计咨询这个行业怎么样
  • 税务改革方向
  • 个人转让无形资产增值税税率
  • 建筑业劳务分包怎样算税
  • 计入成本的费用包括
  • 借贷在会计中的增和减
  • 企业资产损失会计处理
  • 工程用的叉车计提折旧记到什么科目?
  • 盈余公积转增实收资本要交税吗
  • 职工教育经费不提可以吗
  • 鸿蒙智能充电模式怎么用
  • 上个月的流量这个月可以用吗
  • 预征率3%
  • 企业缴纳社保包含哪些内容
  • 企业接到银行收账通知
  • php删除数组中的某个值
  • php参数过滤封装类
  • 比较常见的病有哪些
  • PHP:Memcached::cas()的用法_Memcached类
  • 人际关系定义是什么
  • 退货会计应该怎么做账
  • 若依框架搭建
  • php 访问数据库
  • php获取ipv6地址
  • 微信小店api
  • 520要来了要吵架的赶紧
  • 微信红包的随机性
  • 信用卡收款怎么查询
  • 工会经费是公司交还是个人交
  • 营改增后增加了什么征税项目
  • 企业自建办公楼需要开发资质吗
  • SQLite之Autoincrement关键字(自动递增)
  • 企业会计准则每股收益
  • 固定补贴是否属于社保
  • 兼职劳务费个税计算器
  • 月报表该怎么做表格
  • 企业小汽车折旧年限
  • 利息收入红字如何入账
  • 价外费用中的返利是什么
  • 长期股权投资转让会计处理
  • 建筑公司收到的工程服务发票怎么做账
  • 研发支出的会计处理原则
  • 单据 凭证
  • 预收租金会计分录科目
  • SQLserver导入Excel文件到表
  • 值得收藏的一元硬币
  • win10如何设置快捷键
  • macos怎么使用
  • win10系统更新后无法开机
  • 苹果Mac系统怎么切换输入法
  • win10应用商店更新比蜗牛还慢
  • bootstrap框架怎么用
  • 全面了解自我,接纳和包容自我
  • shader教程
  • android ichart ColumnStacked2D图表无法显示解决方案
  • js实现商品分类
  • javascript含义
  • flappy bird攻略
  • 企业自产自销农产品免税政策有哪些
  • 东莞税务申报日期
  • 请问一般纳税人的业务协调税率是多少
  • 留抵税额退税政策2022
  • 北京市工会会员卡免费公园有哪些
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设