cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <canvas id="omega" width="800px" height="600px"/>

            
          
!
            
              /**
 * OMEGA 3D Framework - http://lab.rackdoll.nl/js/omega/
 * v.0.0.1.6 Alpha - Sexy lights Demo.
 * author: Rackdoll.
 */
document.getElementsByTagName("body")[0].onload = timeout();
var images, scene, cam, light1, light2, light3, torus, renderer, chain;

function timeout() {
  setTimeout(function() {
    init();
  }, 1000);
}

function init() {
  //adjust on window
  Omega3D.Recalibrate();

  //scene
  scene = new Omega3D.Scene();
  scene.setColor( 0, 0, 0);

  //camera.
  cam = new Omega3D.cameras.Camera();
  cam.LookAt(0, 0, 0, [0, -1, -3]);

  //lights
  light1 = new Omega3D.Light(Omega3D.POINT_LIGHT);
  light1.SetSpecular(1.0, 1.0, 1.0);
  light1.SetDiffuse(1.0, 0.0, 0.0);
  light1.SetAmbient(0, 0, 0);
  light1.SetPosition(1, -1, -1);
  scene.addLight(light1);

  light2 = new Omega3D.Light(Omega3D.POINT_LIGHT);
  light2.SetSpecular(1.0, 1.0, 1.0);
  light2.SetDiffuse(0, 1.0, 0.0);
  light2.SetPosition(-1, -1, -1);
  scene.addLight(light2);

  light3 = new Omega3D.Light(Omega3D.DIRECTIONAL_LIGHT);
  light3.SetDirection(-1, 0, 0);
  light3.SetSpecular(1.0, 1.0, 1.0);
  light3.SetDiffuse(0.0, 0.0, 1.0);
  scene.addLight(light3);

  //object
  torus = new Omega3D.Object3D(new Omega3D.Mesh(new Omega3D.Geometry.TorusGeometry(0.75, 0.35, 60, 60)),
    new Omega3D.BasicMaterial([], scene, [1, 1, 1]));

  //add object to scene.
  scene.addChild(torus);

  //create render chain.
  renderer = new Omega3D.WebGLRenderer;
  chain = new Omega3D.RenderChain();
  chain.AddRenderPass(new RenderPass(renderer, scene, cam));
  renderer.SetRenderChain(chain);

  //start render.
  render();
}

//RENDER.
function render() {
  requestAnimationFrame(render);

  //rotate torus.
  torus.Rotate(0.01, 0.02, 0.03);

  //render step.
  renderer.render();
}
            
          
!
999px
Loading ..................

Console