shx-3d-render
parent
d8c928a87f
commit
5926dc5427
|
@ -112,15 +112,17 @@
|
|||
console.log('threejs loaded');
|
||||
|
||||
import("{{ 'three.module.min.js' | asset_url }}").then(THREE => {
|
||||
// Your Three.js code goes here
|
||||
const scene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
||||
|
||||
const renderer = new THREE.WebGLRenderer();
|
||||
|
||||
// calc width and height
|
||||
const width = container.offsetWidth;
|
||||
const height = width;
|
||||
|
||||
// Your Three.js code goes here
|
||||
const scene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000);
|
||||
|
||||
const renderer = new THREE.WebGLRenderer();
|
||||
|
||||
|
||||
|
||||
renderer.setSize(width, height);
|
||||
renderer.setAnimationLoop(animate);
|
||||
|
|
Loading…
Reference in New Issue