Get started with playcanvas CDN

MIT licensed

Open-source 3D engine/framework in JS by PlayCanvas, creates interactive 3D content with WebGL.

Tags:
  • 3D
  • 2D
  • VR
  • WebGL
  • WebGL2
  • game
  • engine
  • HTML5
  • browser
  • typings

Stable version

Copied!

How to start using playcanvas CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with playcanvas CDN - cdnhub.io</title>
    <style>
        body { margin: 0; }
        canvas { width: 100%; height: 100%; }
    </style>
</head>
<body>
    <script src="https://cdn.cdnhub.io/playcanvas/1.69.2/playcanvas.min.js"></script>
    <script>
        PCScene.create('myScene', function(engine) {
            var camera = new PCCamera();
            camera.position.z = 10;

            var boxGeometry = new PCGeometry.Box(1, 1, 1);
            var boxMaterial = new PCStandardMaterial();

            var box = new PCEntity(engine, boxGeometry, boxMaterial);
            box.position.x = 0;
            box.position.y = 0.5;

            engine.root.add(camera);
            engine.root.add(box);

            engine.run();
        });

        PCScene.start('myScene');
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions