当前位置:网站首页>On the normalization of camera rotation interpolation
On the normalization of camera rotation interpolation
2022-06-12 06:05:00 【VR technology Xiaoguang】
When making a rotating camera , We often encounter interpolation from the current angle to a specific angle , But there will be an angle greater than 360 The situation of , Therefore, it is necessary to find the nearest interpolation angle for interpolation .
Therefore, it is necessary to normalize the angle value and target value before interpolation . All in one -180 To 180 Between , Then interpolate .
Go straight to the code :
AngleNormalize(angle, rangecenter=0){
angle = (angle % 6.28);
if(angle<-3.14+rangecenter)
angle += 6.28;
else if(angle>3.14+rangecenter)
angle -= 6.28;
return angle;
}
After being processed by this function, the angles will return to the same interval , The interpolation animation will not rotate several times .
边栏推荐
- Leetcode sword finger offer II 033 Modified phrase
- Divide a folder image into training set and test set
- Brief summary of software project architecture
- A month's worth of DDD will help you master it
- User login 【 I 】
- (UE4 4.27) add globalshder to the plug-in
- (UE4 4.27) UE4 adds a customized meshpass to realize the edge illumination of the mobile terminal
- 数据库实验一:数据定义实验指导
- Es6-es11 learning
- Why doesn't the database use binary tree, red black tree, B tree and hash table? Instead, a b+ tree is used
猜你喜欢

Redis队列

前台展示LED数字(计算器上数字类型)

sqlite交叉編譯動態庫

摄像头拍摄运动物体,产生运动模糊/拖影的原因分析

2D human pose estimation for pose estimation - pifpaf:composite fields for human pose estimation

Execute sh script to prompt "[[: not found" solution. The difference between Bash and sh

(UE4 4.27) customize primitivecomponent

TCP and UDP introduction

BlockingQueue interface introduction

Login authentication filter
随机推荐
三年磨一剑:蚂蚁金服的研发效能洞察实践
Types, functions and applications of intelligent sensors
Leetcode dynamic programming
User login (medium)
TCP and UDP introduction
Cross compile libev
sqlite交叉編譯動態庫
IDEA常用配置
将一个文件夹图片分成训练集和测试集
BRDF of directx11 advanced tutorial PBR (2)
Nrf52832 custom services and features
Idea common configuration
Solution to the problem of the 80th fortnight competition of leetcode
Mysql笔记
Jackson - how to convert the array string with only one map object to list < map >
Why doesn't the database use binary tree, red black tree, B tree and hash table? Instead, a b+ tree is used
C # converts the hexadecimal code form of text to text (ASCII)
Leetcode-646. Longest number pair chain
User login 【 I 】
(UE4 4.27) customize globalshader