Namespace: Mesh


A higher level wrapper for buffers designed to make management of 3d solid objects easier.



(static) fromJSON(data, nameopt, optionsopt)

Utility to load meshes from JSON files in the format as exported from the Unity exporter.

<p>Parses the J3D JSON mesh data format and creates an instance SQR.Buffer out of it.</p>

<p>This is the best way to work with 3d models, since SQR doesn't have native support for OBJ files or Collada 
(though it's perfectly possible to create an OBJ or Collada importer if you need to).</p>
Name Type Attributes Description
data Object | string

the mesh data or an object containing a named list of meshes (which is how meshes get exported from unity by default - the names are the uuids of the object)

name string <optional>

the name of the mesh in the list. If data is a list of meshes and name is omitted, the function will pick the first mesh on the list. If data is the mesh data itself, this argument will be ignored.

options Object <optional>

advanced options for mesh construction