• Stars
    star
    250
  • Rank 159,098 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

glTF 2.0 model viewer

PlayCanvas glTF Viewer

The PlayCanvas glTF scene viewer is blazingly fast and 100% compliant with the glTF 2.0 spec.

PlayCanvas Viewer

You can find a live version at:

https://playcanvas.com/model-viewer

Viewing Scenes

The viewer can load any glTF 2.0 scene. Embedded glTF and binary glTF (GLB) can be dragged directly into the 3D view. To load an unpacked glTF scene, drag its parent folder into the 3D view.

You can also drag and drop images into the 3D view to set a background. Options are:

  • Single file images are treated as equirectangular projections. Supported formats are PNG, JPG and HDR. Find high quality HDR images at HDRHaven.
  • Six images are treated as cube map faces. Naming should be one of the following 5 forms, where each face name below should be incorporated in the overall filename like name_posx.png for example:
Face 0 Face 1 Face 2 Face 3 Face 4 Face 5
posx negx posy negy posz negz
px nx py ny pz nz
right left up down front back
right left top bottom forward backward
0 1 2 3 4 5

Supported URL Parameters

Some URL query parameters are available to override certain aspects of the viewer:

Parameter Description Example
load/assetUrl Specify URL to a glTF scene to load ?load=URL
cameraPosition Override the initial camera position ?cameraPosition=0,0,20

How to build

Ensure you have Node.js installed (v10.0+). Then, from a command prompt, run:

npm install
npm run build

This will invoke Webpack and output the built viewer to the dist folder. To invoke Webpack with the --watch flag (which rebuilds the viewer on saving any source file), do:

npm run build:watch

The size of the build can be checked by running:

npm run build:analyze

How to build with local PlayCanvas engine

You can set the npm build scripts to use local versions of the playcanvas engine & playcanvas extras builds by setting the following environment variables when launching the npm build scripts:

ENGINE_PATH=./path/to/engine npm run build

How to run

Run:

npm run serve

Open a browser and navigate to http://localhost:5000.

More Repositories

1

engine

Fast and lightweight JavaScript game engine built on WebGL and glTF
JavaScript
9,091
star
2

pcui

UI component library for the web
TypeScript
613
star
3

awesome-playcanvas

A curated list of awesome PlayCanvas assets, resources, and more.
245
star
4

playcanvas-ar

Fast and Easy Augmented Reality for the Web πŸš€
JavaScript
209
star
5

pcui-graph

A PCUI extension for creating node-based graphs
JavaScript
110
star
6

editor

Issue tracker for the PlayCanvas Editor
106
star
7

playcanvas-gltf

glTF 2.0 support for the PlayCanvas Engine
JavaScript
98
star
8

playcanvas.github.io

Live examples of the PlayCanvas Engine
JavaScript
78
star
9

playcanvas-sync

Real-time synchronization of files between PlayCanvas and your local machine
JavaScript
73
star
10

developer.playcanvas.com

Developer resources website for PlayCanvas
JavaScript
65
star
11

playcanvas-tween

A tween library for PlayCanvas
JavaScript
55
star
12

webvr

**Deprecated**: WebVR support for PlayCanvas WebGL Game Engine. WebVR is now supported in the PlayCanvas engine directly, this project is now considered legacy and should not be used in new projects.
JavaScript
45
star
13

playcanvas-spine

Plugin component for PlayCanvas which enables support for Spine animations.
JavaScript
43
star
14

fonts

Scripts that allow you to render Bitmap fonts in PlayCanvas.
JavaScript
24
star
15

playcanvas-editor-ts-template

A simple TypeScript template for PlayCanvas that can also sync with your playcanvas.com project
TypeScript
21
star
16

playcanvas-rest-api-tools

A set of tools to use with the PlayCanvas REST API for common jobs such as downloading a build and archiving a project
JavaScript
21
star
17

playcanvas-p2.js

An integration of PlayCanvas with the 2D physics engine p2.js
JavaScript
20
star
18

walkthrough.js

walkthough.js allows you to create interactive walkthroughs on your website
JavaScript
20
star
19

sprites

Scripts that allow you to render Sprites in PlayCanvas
JavaScript
20
star
20

editor-api

The PlayCanvas Editor API
JavaScript
16
star
21

playcanvas-webpack

Demonstration of building a PlayCanvas app with Webpack
JavaScript
16
star
22

google-play-game-services

A PlayCanvas integration for Google Play Game Services
JavaScript
11
star
23

playcanvas-inspector

Chrome extension for inspecting published PlayCanvas apps
JavaScript
11
star
24

playcanvas-observer

Contains the Observer class and related functionality used across the PlayCanvas Editor, pcui etc.
JavaScript
7
star
25

canvas-mock

Mock for HTMLCanvasElement and related classes
JavaScript
6
star
26

playcanvas-texturepacker

Custom PlayCanvas exporter for TexturePacker
6
star
27

playcanvas-eslint-config

ESLint configuration used by PlayCanvas
JavaScript
5
star
28

sublime-completions

Sublime Text completions file for PlayCanvas
JavaScript
5
star
29

playcanvas-facebook

Plugin component for PlayCanvas which enables integration of the Facebook API.
JavaScript
5
star
30

api-reference

PlayCanvas API reference manual
JavaScript
5
star
31

texture-tool

Texture tool for graphics programmers
JavaScript
4
star
32

playcanvas-jsdoc-template

JSDoc 3 template for PlayCanvas
JavaScript
3
star
33

visual-tests

Generate screenshots and compare them across versions of the engine
JavaScript
3
star
34

playcanvas-csp

Node.js tool to download a build via REST API and add CSP rules
JavaScript
2
star
35

blog

The PlayCanvas blog site
HTML
1
star