Modernize project
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
<meta charset="utf-8">
|
||||
<title>oktaeder example</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="bundle.css">
|
||||
<script type="module" src="bundle.js"></script>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script type="module" src="script.ts"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/// <reference types="../node_modules/@webgpu/types" />
|
||||
/// <reference path="types.d.ts" />
|
||||
|
||||
import { Color, Mesh, Node, PerspectiveCamera, PointLight, Quaternion, Scene, Submesh, Vector3 } from "../src/data/index";
|
||||
import { Renderer, degToRad } from "../src/oktaeder";
|
||||
import "./style.css";
|
||||
|
||||
new EventSource("/esbuild").addEventListener("change", () => location.reload());
|
||||
import uvmapUrl from "./uvmap.png";
|
||||
|
||||
const canvas = document.createElement("canvas");
|
||||
window.addEventListener("resize", onResize);
|
||||
@@ -66,7 +66,7 @@ const submesh: Submesh = { start: 0, length: 24 };
|
||||
|
||||
const mesh = new Mesh({ vertexBuffer, indexBuffer, submeshes: [submesh] });
|
||||
|
||||
const imageBitmap = await loadImageBitmap("/uvmap.png");
|
||||
const imageBitmap = await loadImageBitmap(uvmapUrl);
|
||||
|
||||
const texture = renderer.createTexture({
|
||||
format: "srgb",
|
||||
|
||||
4
example/types.d.ts
vendored
Normal file
4
example/types.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
declare module "*.png" {
|
||||
const url: string;
|
||||
export default url;
|
||||
}
|
||||
Reference in New Issue
Block a user