Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r82/three.min.js"></script>
</body>
</html>
 
let scene = new THREE.Scene()
let sceneWidth = window.innerWidth
let sceneHeight = window.innerHeight
let camera = this.camera = new THREE.PerspectiveCamera(
      75, sceneWidth / sceneHeight, 0.1, 1000
    )
let renderer = this.renderer = window.WebGLRenderingContext ?
                new THREE.WebGLRenderer() : new THREE.CanvasRenderer()
renderer.setSize(sceneWidth, sceneHeight)
renderer.setClearColor(new THREE.Color('rgb(100, 100, 100)'))
let spotLight = new THREE.SpotLight(0xffffff)
spotLight.position.set( 100, 1000, 200 );
scene.add(spotLight)
let material = new THREE.MeshLambertMaterial({
  color: 0xFF0000
})
let cube = new THREE.Mesh(
    new THREE.CubeGeometry(3, 3, 3), material
  )
scene.add(cube)
camera.position.x = 5
camera.position.y = 5
camera.position.z = 5
camera.lookAt(scene.position)
document.body.appendChild(renderer.domElement)
renderer.render(scene, camera)
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers