当前位置:网站首页>Getting started with webgl (1)
Getting started with webgl (1)
2022-07-07 15:38:00 【Vegetable chicken on the road】
1. What is? webGL?
webgl Is to draw and render graphics on Web pages (3D graphics ), And allow users to interact with it ;
2. Why do I learn webGL?
Optimize performance in game development , It's in web You can develop and directly view the effect , Easy to translate into game development to understand .
3. The simplest webGL Program ( Clear plot area )
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>03 Draw and transform </title>
</head>
<body onload="main()">
<canvas id = "webgl",width = "400" , height="400"></canvas>
<script src="libs/webgl-utils.js"></script>
<script src="libs/webgl-debug.js"></script>
<script src="libs/cuon-utils.js"></script>
<script src = "RotateTriangle.js"></script>
</body>
</html>
<RotateTriangle.js>
function main() {
// obtain <canvas> Elements
var canvas = document.getElementById('webgl');
// obtain WebGL Rendering context
var gl = getWebGLContext(canvas);
if (!gl) {
console.log('Failed to get the rendering context for WebGL');
return;
}
// Specify empty <canvas> The color of the
gl.clearColor(0.0, 0.0, 0.0, 1.0);
// Empty <canvas>
gl.clear(gl.COLOR_BUFFER_BIT);
}
Library address referenced above :https://gitee.com/JingEra/web-gl-common-library, Please download by yourself .
Of course, if you don't want to use the encapsulated library, you can write it yourself , Let me also put a reference project below . Address :https://gitee.com/JingEra/web-gl-common-library/tree/master/03
I am because some method calls of the encapsulated library are more convenient in the process of reading and learning .
4. understand
There seems to be nothing to explain , Mainly :
边栏推荐
- Keil5 does not support online simulation of STM32 F0 series
- [target detection] yolov5 Runtong voc2007 data set
- [server data recovery] a case of RAID data recovery of a brand StorageWorks server
- [original] all management without assessment is nonsense!
- Unity's ASE realizes cartoon flame
- [Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
- [data mining] visual pattern mining: hog feature + cosine similarity /k-means clustering
- Yunxiaoduo software internal test distribution test platform description document
- [Lanzhou University] information sharing of postgraduate entrance examination and re examination
- 【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
猜你喜欢
![[make a boat diary] [shapr3d STL format to gcode]](/img/aa/6113c51ca82b00c0adc42fbf3f2b4b.png)
[make a boat diary] [shapr3d STL format to gcode]

Unity's ASE realizes cartoon flame

Guangzhou Development Zone enables geographical indication products to help rural revitalization
![[quick start of Digital IC Verification] 24. AHB sramc of SystemVerilog project practice (4) (AHB continues to deepen)](/img/cf/45775b712f60869186a25d3657ee1b.png)
[quick start of Digital IC Verification] 24. AHB sramc of SystemVerilog project practice (4) (AHB continues to deepen)

Unity之ASE实现卡通火焰
Window环境下配置Mongodb数据库

使用cpolar建立一个商业网站(2)

2. Heap sort "hard to understand sort"
Configure mongodb database in window environment
![[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)](/img/3f/40475f9f6e0fcd3f58c93164f65674.png)
[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
随机推荐
What are the safest securities trading apps
How to build your own super signature system (yunxiaoduo)?
Runnable是否可以中断
Actually changed from 408 to self proposition! 211 North China Electric Power University (Beijing)
2. Heap sort "hard to understand sort"
微信小程序 01
[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code
Ctfshow, information collection: web1
【數據挖掘】視覺模式挖掘:Hog特征+餘弦相似度/k-means聚類
Basic knowledge sorting of mongodb database
leetcode 241. Different ways to add parentheses design priority for operational expressions (medium)
CTFshow,信息搜集:web2
[机缘参悟-40]:方向、规则、选择、努力、公平、认知、能力、行动,读3GPP 6G白皮书的五层感悟
[quick start of Digital IC Verification] 23. AHB sramc of SystemVerilog project practice (3) (basic points of AHB protocol)
Super signature principle (fully automated super signature) [Yun Xiaoduo]
What are PV and UV? pv、uv
【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)
MongoD管理数据库的方法介绍