Class: Scene

Raphael3d. Scene

represent scene implementation

new Scene(paper, params)

Scene implementation
This:
Parameters:
Name Type Argument Description
paper Raphael.Paper <optional>
params Object <optional>
Properties
Name Type Argument Description
vertices Array.<Raphael3d.Vertex> <optional>
array of standalone vertices
edges Array.<Raphael3d.Edge> <optional>
array of standalone edges
faces Array.<Raphael3d.Face> <optional>
array of standalone faces
surfaces Array.<Raphael3d.Surface> <optional>
array of surfaces
projection Raphael3d.Matrix4x4 <optional>
projection matrix (how is the camera view projected, usually Raphael3d.Matrix4x4#PerspectiveMatrixZ)
camera Raphael3d.Camera <optional>
lcs Raphael3d.Matrix4x4 <optional>
local coordinate system (in Paper dimensions, how the view is transformed on the screen, usually translates the view to fit Raphael.fn.Viewer)
material Raphael3d.Material <optional>
Properties:
Name Type Description
vertices Array.<Raphael3d.Vertex> array of standalone vertices
array Array.<Raphael3d.Edge> of standalone edges
array Array.<Raphael3d.Face> of standalone faces
array Array.<Raphael3d.Surface> of standalone surfaces
projection Raphael3d.Matrix4x4 projection matrix (how is the camera view projected, usually Raphael3d.Matrix4x4#PerspectiveMatrixZ)
camera Raphael3d.Camera
lcs Raphael3d.Matrix4x4 local coordinate system (in Paper dimensions, how the view is transformed on the screen, usually translates the view to fit Raphael.fn.Viewer)
material Raphael3d.Material
aabb Raphael3d.AABB axis aligned bounding box of the scene
path Raphael.el path of the scene, for ordering and visibility reasons
renderList Array
visMethod number visibility computing method. 0 (defeult) = painters algorithm, only centers of AABBs are used to solve visibility (fastest, but usually not sufficient). 1 = using inFrontOf methods. From tests seems robust enough
matrix Raphael3d.Matrix4x4 final projection matrix, changed with update() method
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2309

Methods

<static> create(paper, params) → {Raphael3d.Scene}

Creates new Scene object. See Raphael3d.Scene for arguments
Parameters:
Name Type Argument Description
paper Raphael.Paper
params Object <optional>
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2331
Returns:
new Scene object
Type
Raphael3d.Scene

addEdge(edge) → {Raphael3d.Scene}

Adds one edge to receiver
Parameters:
Name Type Description
edge Raphael3d.Edge new edge
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2521
Returns:
receiver
Type
Raphael3d.Scene

addEdges(var_args) → {Raphael3d.Scene}

Adds one or several edges to receiver
Parameters:
Name Type Description
var_args Raphael3d.Edge | Array.<Raphael3d.Edge> (array or argument list of) new edge(s)
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2534
Returns:
receiver
Type
Raphael3d.Scene

addFace(face) → {Raphael3d.Scene}

Adds one face to receiver
Parameters:
Name Type Description
face Raphael3d.Face new face
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2554
Returns:
receiver
Type
Raphael3d.Scene

addFaces(var_args) → {Raphael3d.Scene}

Adds one or several faces to receiver
Parameters:
Name Type Description
var_args Raphael3d.Face | Array.<Raphael3d.Face> (array or argument list of) new face(s)
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2567
Returns:
receiver
Type
Raphael3d.Scene

addSurface(surface) → {Raphael3d.Scene}

Adds one surface to receiver
Parameters:
Name Type Description
surface Raphael3d.Surface new surface
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2587
Returns:
receiver
Type
Raphael3d.Scene

addSurfaces(var_args) → {Raphael3d.Scene}

Adds one or several surfaces to receiver
Parameters:
Name Type Description
var_args Raphael3d.Surface | Array.<Raphael3d.Surface> (array or argument list of) new surface(s)
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2597
Returns:
receiver
Type
Raphael3d.Scene

addVertex(vertex) → {Raphael3d.Scene}

Adds one vertex to receiver
Parameters:
Name Type Description
vertex Raphael3d.Vertex new vertex
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2492
Returns:
receiver
Type
Raphael3d.Scene

addVertices(var_args) → {Raphael3d.Scene}

Adds one or several vertices to receiver
Parameters:
Name Type Description
var_args Raphael3d.Vertex | Array.<Raphael3d.Vertex> (array or argument list of) new vertice(s)
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2501
Returns:
receiver
Type
Raphael3d.Scene

render(skipBackFace) → {Raphael3d.Scene}

Renders receiver (order geometric entities raphael paths according to precomputed visibility and and render them)
Parameters:
Name Type Description
skipBackFace boolean parameter passed to render of geometric eontities
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2372
Returns:
receiver
Type
Raphael3d.Scene

setCenter(center) → {Raphael3d.Scene}

Sets new center as camera focal point
Parameters:
Name Type Argument Description
center Raphael3d.Vector3 <optional>
new center (if ommited, center of AABB is used instead)
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2480
Returns:
receiver
Type
Raphael3d.Scene

setMaterial(material) → {Raphael3d.Scene}

Sets new material to receiver
Parameters:
Name Type Description
material Raphael3d.Material
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2617
Returns:
receiver
Type
Raphael3d.Scene

solveVisibility(method, maxiter)

Computes visibility and order entities into renderList
Parameters:
Name Type Argument Description
method number <optional>
of solution, see Raphael3d.Scene
maxiter number <optional>
maximum number of iterations
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2415

update() → {Raphael3d.Scene}

Updates receiver (updates camera, project and updates all geometric entities, computes visibility). The final projection matrix is composed of (in order) this.camera.matrix, this.projction, this.lcs .
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2338
Returns:
receiver
Type
Raphael3d.Scene

updateAABB()

Updates AABB (axis aligned bounding box) of receiver
Source:
  • /var/www/html/software/raphael3d/raphael3d.src.js, line 2624