Caofulei

路在脚下,心向远方

【WebGL】动态点

WebGL绘制鼠标点击位置

添加鼠标点击事件 绘制位置,pointsize为60 <!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>Document</title> <script src="glMatrix-0.9.6.min.js"></script> <script> class WebGLApp { constructor() { this.vertexString = ` attribute vec3 a_position; uniform mat4 proj; void main(void){ gl_Position = vec4(a_position, 1.0); gl_PointSize = 60.0; } `; this.fragmentString =

【WebGL】静态点

WebGL绘制静态点

资源glMatrix 官网: https://glmatrix.net/ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script src="glMatrix-0.9.6.min.js"> //加载封好的库 //https://glmatrix.net/ </script> <script> class WebGLApp { constructor() { this.vertexString = ` attribute vec4 pos; uniform mat4 proj; void main(void){ gl_Position = proj * pos; gl_PointSize = 60.0; } `; this.fragmentString = ` void main(void){