Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!DOCTYPE html>
    <meta charset="UTF-8" />
  <script src=""></script>
  <canvas id="CanvasArea"></canvas>




                window.addEventListener('DOMContentLoaded', init);
function init() {
  const renderer = new THREE.WebGLRenderer({
    canvas: document.querySelector('#CanvasArea')
  const width = 300;
  const height = 200;
  // サイズをセット
  renderer.setSize(width, height);
  // シーンを作成
  const scene = new THREE.Scene();
  // カメラを作成 (遠近法が適用されるカメラ)
  const camera = new THREE.PerspectiveCamera(45, width / height,1,2000);
  // カメラの位置をセット
  camera.position.y = 1000;
  camera.position.z = 1000;
  camera.position.x = 1000;
  // 原点を向くようにカメラを設定
  camera.lookAt(new THREE.Vector3(0, 0, 0));
  // 箱を作成
  const geometry = new THREE.BoxGeometry(500, 500, 500);
  const material = new THREE.MeshStandardMaterial({color: 0xF700FF});
  const box = new THREE.Mesh(geometry, material);
  // 平行光源を作成
  const light = new THREE.DirectionalLight(0xFFFFFF);
  light.intensity = 2; // 光の強さを2に設定
  light.position.set(1000, 1200, 1500); //光源の位置を設定
  // シーンに光源を追加
  // 地面を作成
  const plane2 = new THREE.GridHelper(1200);
  const plane = new THREE.AxesHelper(1200);
  // 描画
  renderer.render(scene, camera);