当前位置:网站首页>OpenGL common functions
OpenGL common functions
2022-07-07 15:39:00 【Vegetable chicken on the road】
Clamp function
Clamp The function can limit randomly varying values to a given interval [min, max] Inside :
template<class T>
T Clamp(T x, T min, T max)
{
if (x > max)
return max;
if (x < min)
return min;
return x;
}
mod function
mod A function is a complement function , The format for : mod(nExp1,nExp2), That is, the remainder of two numerical expressions after division
mix function
mix(x, y, a): x, y Linear aliasing , x(1-a) + y*a; a by 0 The result is x, a by 1 The result is y
smoothstep(start, end, parameter) function
Will return a 0 To 1 Value , This value represents the proportional distance between the minimum and maximum values of the parameter .smoothstep Function will be used to gradually but non linearly increase attributes over a period of time .
step(edge,x) function
step By way of x Compare with edges to generate step function .
For elements that return values i, If x[i]<edge[i], Then return to 0.0, Otherwise return to 1.0.
pow() function
pow(x, y) return x Of y The next power , namely xy
fract() function
fract(x): Take the decimal part
dot() function
dot(x, y): Dot product , Multiply the components separately after Add up ;
Given two n Dimension vector a=(a1,a2,…,an) and b=(b1,b2,…,bn), Find the dot product a·b=a1b1+a2b2+…+anbn.
sqrt() function
sqrt(x): x Root of
边栏推荐
- 2. Heap sort "hard to understand sort"
- [original] all management without assessment is nonsense!
- Pit avoidance: description of null values in in and not in SQL
- HW初级流量监控,到底该怎么做
- Ctfshow, information collection: Web3
- Do not use memset to clear floating-point numbers
- 居然从408改考自命题!211华北电力大学(北京)
- 微信小程序 01
- Ctfshow, information collection: web6
- MySQL bit类型解析
猜你喜欢
【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)
如何在opensea批量发布NFT(Rinkeby测试网)
TypeScript 发布 4.8 beta 版本
【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
What is data leakage
[quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)
Super signature principle (fully automated super signature) [Yun Xiaoduo]
【OBS】RTMPSockBuf_Fill, remote host closed connection.
Implementation of crawling web pages and saving them to MySQL using the scrapy framework
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
随机推荐
Ctfshow, information collection: web9
Ctfshow, information collection: web12
【数字IC验证快速入门】25、SystemVerilog项目实践之AHB-SRAMC(5)(AHB 重点回顾,要点提炼)
[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)
Jacobo code coverage
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
Do you know the relationship between the most important indicators of two strong wind control and the quality of the customer base
Ctfshow, information collection: web7
[Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
使用Scrapy框架爬取网页并保存到Mysql的实现
How to deploy the super signature distribution platform system?
Create lib Library in keil and use lib Library
避坑:Sql中 in 和not in中有null值的情况说明
【Markdown语法高级】让你的博客更精彩(四:设置字体样式以及颜色对照表)
[understanding of opportunity -40]: direction, rules, choice, effort, fairness, cognition, ability, action, read the five layers of perception of 3GPP 6G white paper
Ctfshow, information collection: web10
Stm32f103c8t6 PWM drive steering gear (sg90)
【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
MySQL bit类型解析
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)