|
@@ -16,10 +16,32 @@
|
|
|
|
|
|
<div id="info">Simple procedurally-generated shapes</div>
|
|
<div id="info">Simple procedurally-generated shapes</div>
|
|
|
|
|
|
- <script src="../build/three.js"></script>
|
|
|
|
- <script src="js/libs/stats.min.js"></script>
|
|
|
|
-
|
|
|
|
- <script>
|
|
|
|
|
|
+ <script type="module">
|
|
|
|
+ import {
|
|
|
|
+ BufferGeometry,
|
|
|
|
+ Color,
|
|
|
|
+ DoubleSide,
|
|
|
|
+ ExtrudeBufferGeometry,
|
|
|
|
+ Group,
|
|
|
|
+ Line,
|
|
|
|
+ LineBasicMaterial,
|
|
|
|
+ Mesh,
|
|
|
|
+ MeshPhongMaterial,
|
|
|
|
+ Path,
|
|
|
|
+ PerspectiveCamera,
|
|
|
|
+ PointLight,
|
|
|
|
+ Points,
|
|
|
|
+ PointsMaterial,
|
|
|
|
+ RepeatWrapping,
|
|
|
|
+ Scene,
|
|
|
|
+ Shape,
|
|
|
|
+ ShapeBufferGeometry,
|
|
|
|
+ TextureLoader,
|
|
|
|
+ Vector2,
|
|
|
|
+ WebGLRenderer
|
|
|
|
+ } from "../build/three.module.js";
|
|
|
|
+
|
|
|
|
+ import Stats from './jsm/libs/stats.module.js';
|
|
|
|
|
|
var container, stats;
|
|
var container, stats;
|
|
|
|
|
|
@@ -43,26 +65,26 @@
|
|
container = document.createElement( 'div' );
|
|
container = document.createElement( 'div' );
|
|
document.body.appendChild( container );
|
|
document.body.appendChild( container );
|
|
|
|
|
|
- scene = new THREE.Scene();
|
|
|
|
- scene.background = new THREE.Color( 0xf0f0f0 );
|
|
|
|
|
|
+ scene = new Scene();
|
|
|
|
+ scene.background = new Color( 0xf0f0f0 );
|
|
|
|
|
|
- camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 1000 );
|
|
|
|
|
|
+ camera = new PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 1000 );
|
|
camera.position.set( 0, 150, 500 );
|
|
camera.position.set( 0, 150, 500 );
|
|
scene.add( camera );
|
|
scene.add( camera );
|
|
|
|
|
|
- var light = new THREE.PointLight( 0xffffff, 0.8 );
|
|
|
|
|
|
+ var light = new PointLight( 0xffffff, 0.8 );
|
|
camera.add( light );
|
|
camera.add( light );
|
|
|
|
|
|
- group = new THREE.Group();
|
|
|
|
|
|
+ group = new Group();
|
|
group.position.y = 50;
|
|
group.position.y = 50;
|
|
scene.add( group );
|
|
scene.add( group );
|
|
|
|
|
|
- var loader = new THREE.TextureLoader();
|
|
|
|
|
|
+ var loader = new TextureLoader();
|
|
var texture = loader.load( "textures/UV_Grid_Sm.jpg" );
|
|
var texture = loader.load( "textures/UV_Grid_Sm.jpg" );
|
|
|
|
|
|
// it's necessary to apply these settings in order to correctly display the texture on a shape geometry
|
|
// it's necessary to apply these settings in order to correctly display the texture on a shape geometry
|
|
|
|
|
|
- texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
|
|
|
|
|
|
+ texture.wrapS = texture.wrapT = RepeatWrapping;
|
|
texture.repeat.set( 0.008, 0.008 );
|
|
texture.repeat.set( 0.008, 0.008 );
|
|
|
|
|
|
function addShape( shape, extrudeSettings, color, x, y, z, rx, ry, rz, s ) {
|
|
function addShape( shape, extrudeSettings, color, x, y, z, rx, ry, rz, s ) {
|
|
@@ -70,9 +92,9 @@
|
|
// flat shape with texture
|
|
// flat shape with texture
|
|
// note: default UVs generated by ShapeBufferGeometry are simply the x- and y-coordinates of the vertices
|
|
// note: default UVs generated by ShapeBufferGeometry are simply the x- and y-coordinates of the vertices
|
|
|
|
|
|
- var geometry = new THREE.ShapeBufferGeometry( shape );
|
|
|
|
|
|
+ var geometry = new ShapeBufferGeometry( shape );
|
|
|
|
|
|
- var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial( { side: THREE.DoubleSide, map: texture } ) );
|
|
|
|
|
|
+ var mesh = new Mesh( geometry, new MeshPhongMaterial( { side: DoubleSide, map: texture } ) );
|
|
mesh.position.set( x, y, z - 175 );
|
|
mesh.position.set( x, y, z - 175 );
|
|
mesh.rotation.set( rx, ry, rz );
|
|
mesh.rotation.set( rx, ry, rz );
|
|
mesh.scale.set( s, s, s );
|
|
mesh.scale.set( s, s, s );
|
|
@@ -80,9 +102,9 @@
|
|
|
|
|
|
// flat shape
|
|
// flat shape
|
|
|
|
|
|
- var geometry = new THREE.ShapeBufferGeometry( shape );
|
|
|
|
|
|
+ var geometry = new ShapeBufferGeometry( shape );
|
|
|
|
|
|
- var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial( { color: color, side: THREE.DoubleSide } ) );
|
|
|
|
|
|
+ var mesh = new Mesh( geometry, new MeshPhongMaterial( { color: color, side: DoubleSide } ) );
|
|
mesh.position.set( x, y, z - 125 );
|
|
mesh.position.set( x, y, z - 125 );
|
|
mesh.rotation.set( rx, ry, rz );
|
|
mesh.rotation.set( rx, ry, rz );
|
|
mesh.scale.set( s, s, s );
|
|
mesh.scale.set( s, s, s );
|
|
@@ -90,9 +112,9 @@
|
|
|
|
|
|
// extruded shape
|
|
// extruded shape
|
|
|
|
|
|
- var geometry = new THREE.ExtrudeBufferGeometry( shape, extrudeSettings );
|
|
|
|
|
|
+ var geometry = new ExtrudeBufferGeometry( shape, extrudeSettings );
|
|
|
|
|
|
- var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial( { color: color } ) );
|
|
|
|
|
|
+ var mesh = new Mesh( geometry, new MeshPhongMaterial( { color: color } ) );
|
|
mesh.position.set( x, y, z - 75 );
|
|
mesh.position.set( x, y, z - 75 );
|
|
mesh.rotation.set( rx, ry, rz );
|
|
mesh.rotation.set( rx, ry, rz );
|
|
mesh.scale.set( s, s, s );
|
|
mesh.scale.set( s, s, s );
|
|
@@ -111,12 +133,12 @@
|
|
var points = shape.getPoints();
|
|
var points = shape.getPoints();
|
|
var spacedPoints = shape.getSpacedPoints( 50 );
|
|
var spacedPoints = shape.getSpacedPoints( 50 );
|
|
|
|
|
|
- var geometryPoints = new THREE.BufferGeometry().setFromPoints( points );
|
|
|
|
- var geometrySpacedPoints = new THREE.BufferGeometry().setFromPoints( spacedPoints );
|
|
|
|
|
|
+ var geometryPoints = new BufferGeometry().setFromPoints( points );
|
|
|
|
+ var geometrySpacedPoints = new BufferGeometry().setFromPoints( spacedPoints );
|
|
|
|
|
|
// solid line
|
|
// solid line
|
|
|
|
|
|
- var line = new THREE.Line( geometryPoints, new THREE.LineBasicMaterial( { color: color } ) );
|
|
|
|
|
|
+ var line = new Line( geometryPoints, new LineBasicMaterial( { color: color } ) );
|
|
line.position.set( x, y, z - 25 );
|
|
line.position.set( x, y, z - 25 );
|
|
line.rotation.set( rx, ry, rz );
|
|
line.rotation.set( rx, ry, rz );
|
|
line.scale.set( s, s, s );
|
|
line.scale.set( s, s, s );
|
|
@@ -124,7 +146,7 @@
|
|
|
|
|
|
// line from equidistance sampled points
|
|
// line from equidistance sampled points
|
|
|
|
|
|
- var line = new THREE.Line( geometrySpacedPoints, new THREE.LineBasicMaterial( { color: color } ) );
|
|
|
|
|
|
+ var line = new Line( geometrySpacedPoints, new LineBasicMaterial( { color: color } ) );
|
|
line.position.set( x, y, z + 25 );
|
|
line.position.set( x, y, z + 25 );
|
|
line.rotation.set( rx, ry, rz );
|
|
line.rotation.set( rx, ry, rz );
|
|
line.scale.set( s, s, s );
|
|
line.scale.set( s, s, s );
|
|
@@ -132,7 +154,7 @@
|
|
|
|
|
|
// vertices from real points
|
|
// vertices from real points
|
|
|
|
|
|
- var particles = new THREE.Points( geometryPoints, new THREE.PointsMaterial( { color: color, size: 4 } ) );
|
|
|
|
|
|
+ var particles = new Points( geometryPoints, new PointsMaterial( { color: color, size: 4 } ) );
|
|
particles.position.set( x, y, z + 75 );
|
|
particles.position.set( x, y, z + 75 );
|
|
particles.rotation.set( rx, ry, rz );
|
|
particles.rotation.set( rx, ry, rz );
|
|
particles.scale.set( s, s, s );
|
|
particles.scale.set( s, s, s );
|
|
@@ -140,7 +162,7 @@
|
|
|
|
|
|
// equidistance sampled points
|
|
// equidistance sampled points
|
|
|
|
|
|
- var particles = new THREE.Points( geometrySpacedPoints, new THREE.PointsMaterial( { color: color, size: 4 } ) );
|
|
|
|
|
|
+ var particles = new Points( geometrySpacedPoints, new PointsMaterial( { color: color, size: 4 } ) );
|
|
particles.position.set( x, y, z + 125 );
|
|
particles.position.set( x, y, z + 125 );
|
|
particles.rotation.set( rx, ry, rz );
|
|
particles.rotation.set( rx, ry, rz );
|
|
particles.scale.set( s, s, s );
|
|
particles.scale.set( s, s, s );
|
|
@@ -153,37 +175,37 @@
|
|
|
|
|
|
var californiaPts = [];
|
|
var californiaPts = [];
|
|
|
|
|
|
- californiaPts.push( new THREE.Vector2( 610, 320 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 450, 300 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 392, 392 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 266, 438 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 190, 570 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 190, 600 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 160, 620 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 160, 650 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 180, 640 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 165, 680 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 150, 670 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 90, 737 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 80, 795 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 50, 835 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 64, 870 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 60, 945 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 300, 945 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 300, 743 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 600, 473 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 626, 425 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 600, 370 ) );
|
|
|
|
- californiaPts.push( new THREE.Vector2( 610, 320 ) );
|
|
|
|
|
|
+ californiaPts.push( new Vector2( 610, 320 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 450, 300 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 392, 392 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 266, 438 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 190, 570 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 190, 600 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 160, 620 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 160, 650 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 180, 640 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 165, 680 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 150, 670 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 90, 737 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 80, 795 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 50, 835 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 64, 870 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 60, 945 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 300, 945 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 300, 743 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 600, 473 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 626, 425 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 600, 370 ) );
|
|
|
|
+ californiaPts.push( new Vector2( 610, 320 ) );
|
|
|
|
|
|
for ( var i = 0; i < californiaPts.length; i ++ ) californiaPts[ i ].multiplyScalar( 0.25 );
|
|
for ( var i = 0; i < californiaPts.length; i ++ ) californiaPts[ i ].multiplyScalar( 0.25 );
|
|
|
|
|
|
- var californiaShape = new THREE.Shape( californiaPts );
|
|
|
|
|
|
+ var californiaShape = new Shape( californiaPts );
|
|
|
|
|
|
|
|
|
|
// Triangle
|
|
// Triangle
|
|
|
|
|
|
- var triangleShape = new THREE.Shape();
|
|
|
|
|
|
+ var triangleShape = new Shape();
|
|
triangleShape.moveTo( 80, 20 );
|
|
triangleShape.moveTo( 80, 20 );
|
|
triangleShape.lineTo( 40, 80 );
|
|
triangleShape.lineTo( 40, 80 );
|
|
triangleShape.lineTo( 120, 80 );
|
|
triangleShape.lineTo( 120, 80 );
|
|
@@ -194,7 +216,7 @@
|
|
|
|
|
|
var x = 0, y = 0;
|
|
var x = 0, y = 0;
|
|
|
|
|
|
- var heartShape = new THREE.Shape(); // From http://blog.burlock.org/html5/130-paths
|
|
|
|
|
|
+ var heartShape = new Shape(); // From http://blog.burlock.org/html5/130-paths
|
|
|
|
|
|
heartShape.moveTo( x + 25, y + 25 );
|
|
heartShape.moveTo( x + 25, y + 25 );
|
|
heartShape.bezierCurveTo( x + 25, y + 25, x + 20, y, x, y );
|
|
heartShape.bezierCurveTo( x + 25, y + 25, x + 20, y, x, y );
|
|
@@ -209,7 +231,7 @@
|
|
|
|
|
|
var sqLength = 80;
|
|
var sqLength = 80;
|
|
|
|
|
|
- var squareShape = new THREE.Shape();
|
|
|
|
|
|
+ var squareShape = new Shape();
|
|
squareShape.moveTo( 0, 0 );
|
|
squareShape.moveTo( 0, 0 );
|
|
squareShape.lineTo( 0, sqLength );
|
|
squareShape.lineTo( 0, sqLength );
|
|
squareShape.lineTo( sqLength, sqLength );
|
|
squareShape.lineTo( sqLength, sqLength );
|
|
@@ -221,7 +243,7 @@
|
|
|
|
|
|
var rectLength = 120, rectWidth = 40;
|
|
var rectLength = 120, rectWidth = 40;
|
|
|
|
|
|
- var rectShape = new THREE.Shape();
|
|
|
|
|
|
+ var rectShape = new Shape();
|
|
rectShape.moveTo( 0, 0 );
|
|
rectShape.moveTo( 0, 0 );
|
|
rectShape.lineTo( 0, rectWidth );
|
|
rectShape.lineTo( 0, rectWidth );
|
|
rectShape.lineTo( rectLength, rectWidth );
|
|
rectShape.lineTo( rectLength, rectWidth );
|
|
@@ -231,7 +253,7 @@
|
|
|
|
|
|
// Rounded rectangle
|
|
// Rounded rectangle
|
|
|
|
|
|
- var roundedRectShape = new THREE.Shape();
|
|
|
|
|
|
+ var roundedRectShape = new Shape();
|
|
|
|
|
|
( function roundedRect( ctx, x, y, width, height, radius ) {
|
|
( function roundedRect( ctx, x, y, width, height, radius ) {
|
|
|
|
|
|
@@ -250,7 +272,7 @@
|
|
|
|
|
|
// Track
|
|
// Track
|
|
|
|
|
|
- var trackShape = new THREE.Shape();
|
|
|
|
|
|
+ var trackShape = new Shape();
|
|
|
|
|
|
trackShape.moveTo( 40, 40 );
|
|
trackShape.moveTo( 40, 40 );
|
|
trackShape.lineTo( 40, 160 );
|
|
trackShape.lineTo( 40, 160 );
|
|
@@ -262,7 +284,7 @@
|
|
// Circle
|
|
// Circle
|
|
|
|
|
|
var circleRadius = 40;
|
|
var circleRadius = 40;
|
|
- var circleShape = new THREE.Shape();
|
|
|
|
|
|
+ var circleShape = new Shape();
|
|
circleShape.moveTo( 0, circleRadius );
|
|
circleShape.moveTo( 0, circleRadius );
|
|
circleShape.quadraticCurveTo( circleRadius, circleRadius, circleRadius, 0 );
|
|
circleShape.quadraticCurveTo( circleRadius, circleRadius, circleRadius, 0 );
|
|
circleShape.quadraticCurveTo( circleRadius, - circleRadius, 0, - circleRadius );
|
|
circleShape.quadraticCurveTo( circleRadius, - circleRadius, 0, - circleRadius );
|
|
@@ -274,7 +296,7 @@
|
|
|
|
|
|
var x = y = 0;
|
|
var x = y = 0;
|
|
|
|
|
|
- var fishShape = new THREE.Shape();
|
|
|
|
|
|
+ var fishShape = new Shape();
|
|
|
|
|
|
fishShape.moveTo( x, y );
|
|
fishShape.moveTo( x, y );
|
|
fishShape.quadraticCurveTo( x + 50, y - 80, x + 90, y - 10 );
|
|
fishShape.quadraticCurveTo( x + 50, y - 80, x + 90, y - 10 );
|
|
@@ -286,11 +308,11 @@
|
|
|
|
|
|
// Arc circle
|
|
// Arc circle
|
|
|
|
|
|
- var arcShape = new THREE.Shape();
|
|
|
|
|
|
+ var arcShape = new Shape();
|
|
arcShape.moveTo( 50, 10 );
|
|
arcShape.moveTo( 50, 10 );
|
|
arcShape.absarc( 10, 10, 40, 0, Math.PI * 2, false );
|
|
arcShape.absarc( 10, 10, 40, 0, Math.PI * 2, false );
|
|
|
|
|
|
- var holePath = new THREE.Path();
|
|
|
|
|
|
+ var holePath = new Path();
|
|
holePath.moveTo( 20, 10 );
|
|
holePath.moveTo( 20, 10 );
|
|
holePath.absarc( 10, 10, 10, 0, Math.PI * 2, true );
|
|
holePath.absarc( 10, 10, 10, 0, Math.PI * 2, true );
|
|
arcShape.holes.push( holePath );
|
|
arcShape.holes.push( holePath );
|
|
@@ -298,22 +320,22 @@
|
|
|
|
|
|
// Smiley
|
|
// Smiley
|
|
|
|
|
|
- var smileyShape = new THREE.Shape();
|
|
|
|
|
|
+ var smileyShape = new Shape();
|
|
smileyShape.moveTo( 80, 40 );
|
|
smileyShape.moveTo( 80, 40 );
|
|
smileyShape.absarc( 40, 40, 40, 0, Math.PI * 2, false );
|
|
smileyShape.absarc( 40, 40, 40, 0, Math.PI * 2, false );
|
|
|
|
|
|
- var smileyEye1Path = new THREE.Path();
|
|
|
|
|
|
+ var smileyEye1Path = new Path();
|
|
smileyEye1Path.moveTo( 35, 20 );
|
|
smileyEye1Path.moveTo( 35, 20 );
|
|
smileyEye1Path.absellipse( 25, 20, 10, 10, 0, Math.PI * 2, true );
|
|
smileyEye1Path.absellipse( 25, 20, 10, 10, 0, Math.PI * 2, true );
|
|
|
|
|
|
smileyShape.holes.push( smileyEye1Path );
|
|
smileyShape.holes.push( smileyEye1Path );
|
|
|
|
|
|
- var smileyEye2Path = new THREE.Path();
|
|
|
|
|
|
+ var smileyEye2Path = new Path();
|
|
smileyEye2Path.moveTo( 65, 20 );
|
|
smileyEye2Path.moveTo( 65, 20 );
|
|
smileyEye2Path.absarc( 55, 20, 10, 0, Math.PI * 2, true );
|
|
smileyEye2Path.absarc( 55, 20, 10, 0, Math.PI * 2, true );
|
|
smileyShape.holes.push( smileyEye2Path );
|
|
smileyShape.holes.push( smileyEye2Path );
|
|
|
|
|
|
- var smileyMouthPath = new THREE.Path();
|
|
|
|
|
|
+ var smileyMouthPath = new Path();
|
|
smileyMouthPath.moveTo( 20, 40 );
|
|
smileyMouthPath.moveTo( 20, 40 );
|
|
smileyMouthPath.quadraticCurveTo( 40, 60, 60, 40 );
|
|
smileyMouthPath.quadraticCurveTo( 40, 60, 60, 40 );
|
|
smileyMouthPath.bezierCurveTo( 70, 45, 70, 50, 60, 60 );
|
|
smileyMouthPath.bezierCurveTo( 70, 45, 70, 50, 60, 60 );
|
|
@@ -326,12 +348,12 @@
|
|
// Spline shape
|
|
// Spline shape
|
|
|
|
|
|
var splinepts = [];
|
|
var splinepts = [];
|
|
- splinepts.push( new THREE.Vector2( 70, 20 ) );
|
|
|
|
- splinepts.push( new THREE.Vector2( 80, 90 ) );
|
|
|
|
- splinepts.push( new THREE.Vector2( - 30, 70 ) );
|
|
|
|
- splinepts.push( new THREE.Vector2( 0, 0 ) );
|
|
|
|
|
|
+ splinepts.push( new Vector2( 70, 20 ) );
|
|
|
|
+ splinepts.push( new Vector2( 80, 90 ) );
|
|
|
|
+ splinepts.push( new Vector2( - 30, 70 ) );
|
|
|
|
+ splinepts.push( new Vector2( 0, 0 ) );
|
|
|
|
|
|
- var splineShape = new THREE.Shape();
|
|
|
|
|
|
+ var splineShape = new Shape();
|
|
splineShape.moveTo( 0, 0 );
|
|
splineShape.moveTo( 0, 0 );
|
|
splineShape.splineThru( splinepts );
|
|
splineShape.splineThru( splinepts );
|
|
|
|
|
|
@@ -361,7 +383,7 @@
|
|
|
|
|
|
//
|
|
//
|
|
|
|
|
|
- renderer = new THREE.WebGLRenderer( { antialias: true } );
|
|
|
|
|
|
+ renderer = new WebGLRenderer( { antialias: true } );
|
|
renderer.setPixelRatio( window.devicePixelRatio );
|
|
renderer.setPixelRatio( window.devicePixelRatio );
|
|
renderer.setSize( window.innerWidth, window.innerHeight );
|
|
renderer.setSize( window.innerWidth, window.innerHeight );
|
|
container.appendChild( renderer.domElement );
|
|
container.appendChild( renderer.domElement );
|