Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS375_Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ah3472
CS375_Project
Commits
b0f0a197
Commit
b0f0a197
authored
5 years ago
by
ah3472
Browse files
Options
Downloads
Patches
Plain Diff
html stuff
parent
1403267d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sample_stuff/webgl_test.html
+43
-0
43 additions, 0 deletions
sample_stuff/webgl_test.html
sample_stuff/webgl_test.js
+26
-0
26 additions, 0 deletions
sample_stuff/webgl_test.js
with
69 additions
and
0 deletions
sample_stuff/webgl_test.html
0 → 100644
+
43
−
0
View file @
b0f0a197
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
/>
<title>
Sample Project
</title>
</head>
<body>
<script
id=
"vertex-shader"
type=
"x-shader/x-vertex"
>
attribute
vec2
aVertexPosition
;
uniform
vec2
uScalingFactor
;
uniform
vec2
uRotationVector
;
void
main
()
{
vec2
rotatedPosition
=
vec2
(
aVertexPosition
.
x
*
u
.
RotationVector
.
y
+
aVertexPosition
.
y
*
uRotationVector
.
x
,
aVertexPosition
.
y
*
uRotationVector
.
y
-
aVertexPosition
.
x
*
uRotationVector
.
x
,
);
gl_Position
=
vec4
(
rotatedPosition
*
uScalingFactor
,
0
,
1
);
}
</script>
<script
id=
"fragment-shader"
type=
"x-shader/x-fragment"
>
#ifdef
GL_ES
precision
highp
float
;
#endif
uniform
vec4
uGlobalColor
;
void
main
()
{
gl_FragColor
=
uGlobalColor
;
}
</script>
<canvas
id=
"glCanvas"
width=
"640"
height=
"480"
></canvas>
<script
src=
"webgl_test.js"
>
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
sample_stuff/webgl_test.js
0 → 100644
+
26
−
0
View file @
b0f0a197
/*const vsSource = `
attribute vec4 aVertexPosition;
uniform mat4 uModelViewMatrix;
uniform mat4 uProjectionMatrix;
void main() {
gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;
}
`
function main() {
const canvas = document.querySelector("#glCanvas");
const gl = canvas.getContext("webgl");
if (gl === null) {
alert("Unable to initialize WebGL. Your browser or machine may not support it.");
return;
}
gl.clearColor(0, 0, 0, 1)
gl.clear(gl.COLOR_BUFFER_BIT);
}
window.onload = main;*/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment