当前位置:网站首页>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
边栏推荐
- Oracle控制文件丢失恢复归档模式方法
- What is data leakage
- Monthly observation of internet medical field in May 2022
- 什麼是數據泄露
- "Baidu Cup" CTF competition 2017 February, web:include
- Guangzhou Development Zone enables geographical indication products to help rural revitalization
- 居然从408改考自命题!211华北电力大学(北京)
- The rebound problem of using Scrollview in cocos Creator
- 写一篇万字长文《CAS自旋锁》送杰伦的新专辑登顶热榜
- 2. Basic knowledge of golang
猜你喜欢
![[quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)](/img/d3/cab8a1cba3c8d8107ce4a95f328d36.png)
[quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)

众昂矿业:萤石继续引领新能源市场增长

什么是数据泄露

Unity's ASE achieves full screen sand blowing effect

Ctfshow, information collection: web9

Use cpolar to build a business website (2)

【深度学习】语义分割实验:Unet网络/MSRC2数据集
Implementation of crawling web pages and saving them to MySQL using the scrapy framework

【數據挖掘】視覺模式挖掘:Hog特征+餘弦相似度/k-means聚類

Niuke real problem programming - day20
随机推荐
如何在opensea批量发布NFT(Rinkeby测试网)
Ctfshow, information collection: web1
【数字IC验证快速入门】19、SystemVerilog学习之基本语法6(线程内部通信...内含实践练习)
Oracle控制文件丢失恢复归档模式方法
居然从408改考自命题!211华北电力大学(北京)
Oracle control file loss recovery archive mode method
There is a cow, which gives birth to a heifer at the beginning of each year. Each heifer has a heifer at the beginning of each year since the fourth year. Please program how many cows are there in the
有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?
【數字IC驗證快速入門】26、SystemVerilog項目實踐之AHB-SRAMC(6)(APB協議基本要點)
Bye, Dachang! I'm going to the factory today
Qu'est - ce qu'une violation de données
Briefly describe the working principle of kept
全日制研究生和非全日制研究生的区别!
Database exception resolution caused by large table delete data deletion
最安全的证券交易app都有哪些
Summer safety is very important! Emergency safety education enters kindergarten
Change win10 Screensaver
Integer learning
Use cpolar to build a business website (2)
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