@antv/g-webgpu
import { World } from '@antv/g-webgpu';
const canvas = document.getElementById('application');
const world = new World(canvas);
const camera = world.createCamera({
aspect: Math.abs(canvas.width / canvas.height),
angle: 72,
far: 100,
near: 1,
});
world.getCamera(camera).setPosition(0, 5, 5);
const scene = world.createScene({ camera });
const boxGeometry = world.createBoxGeometry({
halfExtents: vec3.fromValues(1, 1, 1),
});
const material = world.createBasicMaterial();
const mesh = world.createMesh({
geometry: boxGeometry,
material,
});
world.add(scene, mesh);