Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.


Save Automatically?

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <!DOCTYPE html>
    <title>Hello, WebVR! - A-Frame</title>
    <meta name="description" content="Hello, WebVR! - A-Frame">
    <script src=""></script>

        <!-- 3Dモデルデータ -->
        <a-asset-item id="woman-obj" src=""></a-asset-item>
        <!-- マテリアルデータ -->
        <a-asset-item id="woman-mtl" src=""></a-asset-item>
      <a-camera look-controls-enabled="false">
      <!-- 3Dモデル -->
      <a-entity id="womanObj" obj-model="obj: #woman-obj; mtl: #woman-mtl" scale="0.01 0.01 0.01" position="0 0.75 -1.2" rotation="0 0 0"></a-entity>  
          position="-1 1 2">
      <a-sky color="#00ffff"></a-sky>
              * {
  margin: 0;
  padding: 0;
  border: 0;

body {
  background: #fdf;
  font: 30px sans-serif;
              // forked from siouxcitizen's "A-Frame Practice 14 Texture on Sphere"
//Three.js r72 でOBJファイル形式3Dモデルを表示その2(WebGL使用)

var sceneEl;

var obj3DModel;

var isMouseDown = false;

function init() {

    sceneEl = document.querySelector("a-scene");
    obj3DModel = sceneEl.querySelector("#womanObj"); 
    // マウス、タッチ処理を呼び出すイベントリスナーをセット
    document.addEventListener("mousedown", onMouseDown);
    document.addEventListener("touchstart", onMouseDown);
    document.addEventListener("mouseup", onMouseUp);
    document.addEventListener("touchend", onMouseUp);
    document.addEventListener("mousemove", onMouseMove);
    document.addEventListener("touchmove", onMouseMove);


function render() {

// マウスを押したとき
function onMouseDown(event) {
    isMouseDown = true;

// マウスを動かした時
function onMouseMove(event) {
    if (isMouseDown) {
        // 3DモデルをX軸とY軸方向に回転させます       
        if ( obj3DModel )            
		    obj3DModel.setAttribute("rotation", (getMouseY(event)/10)+" "+(getMouseX(event)/10)+" 0");

// マウスを離したとき
function onMouseUp(event) {
    isMouseDown = false;

function getMouseX(event) {
    if (event.type.indexOf("touch") == -1)
        return event.clientX;
        return event.touches[0].clientX;

function getMouseY(event) {
    if (event.type.indexOf("touch") == -1)
        return event.clientY;
        return event.touches[0].clientY;

window.onload = function() {