Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (56 sloc) 1.95 KB
<!doctype html>
<script src="../../build/output/playcanvas-latest.js"></script>
<link href="../style.css" rel="stylesheet" />
<!-- The canvas element -->
<canvas id="application-canvas"></canvas>
<!-- The script -->
var canvas = document.getElementById("application-canvas");
// Create the app and start the update loop
var app = new pc.Application(canvas);
// Set the canvas to fill the window and automatically change resolution to be the same as the canvas size
app.scene.ambientLight = new pc.Color(0.2, 0.2, 0.2);
var entity, light, camera;
// Load a model file and create a Entity with a model component
var url = "../assets/statue/Statue_1.json";
app.assets.loadFromUrl(url, "model", function (err, asset) {
entity = new pc.Entity();
entity.addComponent("model", {
type: "asset",
asset: asset,
castShadows: true
// Create an Entity with a camera component
var camera = new pc.Entity();
camera.addComponent("camera", {
clearColor: new pc.Color(0.4, 0.45, 0.5)
camera.translate(0, 7, 24);
// Create an Entity with a point light component
var light = new pc.Entity();
light.addComponent("light", {
type: "point",
color: new pc.Color(1, 1, 1),
range: 100,
castShadows: true
light.translate(5, 0, 15);
app.on("update", function (dt) {
if (entity) {
You can’t perform that action at this time.