Forget all that module noise
This commit is contained in:
parent
16271a79b5
commit
c83ea2e7c3
@ -1,14 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="module" src="panorama-viewer.js"></script>
|
||||
<script type="module">
|
||||
import { render } from "./panorama-viewer.js";
|
||||
window.addEventListener("load", () => {
|
||||
let viewer = document.getElementById("viewer");
|
||||
render(viewer);
|
||||
});
|
||||
</script>
|
||||
<script src="./panorama-viewer.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Panorama Viewer</h1>
|
||||
|
@ -1,6 +1,12 @@
|
||||
"use strict";
|
||||
(() => {
|
||||
window.addEventListener("load", () => {
|
||||
let viewer = document.getElementById("viewer");
|
||||
render(viewer);
|
||||
});
|
||||
|
||||
export const render = (canvas) => {
|
||||
let gl = canvas.getContext("webgl");
|
||||
const render = (canvas) => {
|
||||
let gl = canvas.getContext("webgl2");
|
||||
|
||||
const vShaderSrc = `
|
||||
attribute vec3 position;
|
||||
@ -53,4 +59,5 @@ export const render = (canvas) => {
|
||||
gl.enableVertexAttribArray(positionLocation);
|
||||
gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 4*3, 0);
|
||||
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
||||
}
|
||||
};
|
||||
})();
|
Loading…
Reference in New Issue
Block a user