Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Computer Graphics with WebGL / Project / Project.html
diff options
context:
space:
mode:
Commit46ee648fff31004221d307d0af9cabc0c4250a4c (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-08-27 12:01:37 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-08-27 12:01:37 +0300
Files5c2041dec852318c1ba7ddb16f43abbeb942b53d /Year 2/Computer Graphics with WebGL/Project/Project.html
uni-projects-46ee648fff31004221d307d0af9cabc0c4250a4c.tar
uni-projects-46ee648fff31004221d307d0af9cabc0c4250a4c.tar.gz
uni-projects-46ee648fff31004221d307d0af9cabc0c4250a4c.zip
Parent87e9c9fa25b21bec3a658dcebc6c765a511d838e (diff)
[WGL/P] Minor formatting and naming changes
1 files changed, 5 insertions, 13 deletions
-rw-r--r--Year 2/Computer Graphics with WebGL/Project/Project.html18
diff --git a/Year 2/Computer Graphics with WebGL/Project/Project.html b/Year 2/Computer Graphics with WebGL/Project/Project.html
index 4c88553..6133dba 100644
--- a/Year 2/Computer Graphics with WebGL/Project/Project.html
+++ b/Year 2/Computer Graphics with WebGL/Project/Project.html
@@ -70,7 +70,7 @@ h2 {
function start()
{
- canvas = document.getElementById("picasso");
+ canvas = document.getElementById('picasso');
canvas.addEventListener('webglcontextlost',function(event){event.preventDefault();},false);
canvas.addEventListener('webglcontextrestored',function(){init();},false);
@@ -83,7 +83,7 @@ h2 {
function init()
{
- gl = getContext("picasso");
+ gl = getContext('picasso');
glprog = getProgram(vShader,fShader);
getVariables();
@@ -104,7 +104,7 @@ h2 {
skybox = new Skybox(10000, [0,0,0], undefined);
stars = [
- new Star([1100,0,1000], 10),
+ new Star([1200,0,1000], 10),
// new Star([1000,0,900], 30),
// new Star([950,0,1100], 40),
];
@@ -132,24 +132,16 @@ h2 {
{
gl.clear(gl.COLOR_BUFFER_BIT+gl.DEPTH_BUFFER_BIT);
- lookUpdate();
+ updateCamera();
gl.uniform3fv(uEye, pos);
stars[0].moveTo(vecSum(stars[0].sphere.center, [-0.5,0,0]));
+
skybox.draw();
stars.forEach((s) => s.draw());
requestAnimationFrame(drawFrame);
}
- document.addEventListener('keypress', (e) => {
- if (e.key == 'u') {
- console.log(w);
- console.log(w*gl.canvas.height / gl.canvas.width);
- console.log(forward.toCartesian());
- console.log(left.toCartesian());
- console.log(up.toCartesian());
- }
- });
</script>
</head>