Virtual 3D Cities
Public Member Functions | List of all members
Scene3D Class Reference

Public Member Functions

 Scene3D ()
 
void addBox (double cx, double cy, double cz, double xlen, double ylen, double zlen, double r, double g, double b, double roughness, double metalness, double rx, double ry, double rz)
 
void addBox (double cx, double cy, double cz, double xlen, double ylen, double zlen, double r, double g, double b, double roughness, double metalness)
 
void addCylinder (double cx, double cy, double cz, double radius, double height, double r, double g, double b, double roughness, double metalness, double rx, double ry, double rz, double sx, double sy, double sz)
 
void addCylinder (double cx, double cy, double cz, double radius, double height, double r, double g, double b, double roughness, double metalness)
 
void addCone (double cx, double cy, double cz, double radius, double height, double r, double g, double b, double roughness, double metalness, double rx, double ry, double rz, double sx, double sy, double sz)
 
void addCone (double cx, double cy, double cz, double radius, double height, double r, double g, double b, double roughness, double metalness)
 
void addEllipsoid (double cx, double cy, double cz, double radx, double rady, double radz, double r, double g, double b, double roughness, double metalness, double rx, double ry, double rz)
 
void addEllipsoid (double cx, double cy, double cz, double radx, double rady, double radz, double r, double g, double b, double roughness, double metalness)
 
void addSphere (double cx, double cy, double cz, double radius, double r, double g, double b, double roughness, double metalness)
 
void addMesh (String path, double cx, double cy, double cz, double rx, double ry, double rz, double sx, double sy, double sz, double r, double g, double b, double roughness, double metalness)
 
void addTexturedMesh (String path, String matpath, double cx, double cy, double cz, double rx, double ry, double rz, double sx, double sy, double sz, double shininess)
 
void addCamera (double x, double y, double z, double rot)
 
void addPointLight (double x, double y, double z, double r, double g, double b, double intensity)
 
void addDirectionalLight (double x, double y, double z, double r, double g, double b, double intensity)
 
void saveScene (String filename, String sceneName)
 

Constructor & Destructor Documentation

◆ Scene3D()

Scene3D.Scene3D ( )
inline

Member Function Documentation

◆ addBox() [1/2]

void Scene3D.addBox ( double  cx,
double  cy,
double  cz,
double  xlen,
double  ylen,
double  zlen,
double  r,
double  g,
double  b,
double  roughness,
double  metalness 
)
inline

Add an axis-aligned box to the scene

Parameters
cxX center of box
cyY center of box
czZ center of box
xlenLength of box along x-axis
ylenLength of box along y-axis
zlenLength of box along z-axis
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness

◆ addBox() [2/2]

void Scene3D.addBox ( double  cx,
double  cy,
double  cz,
double  xlen,
double  ylen,
double  zlen,
double  r,
double  g,
double  b,
double  roughness,
double  metalness,
double  rx,
double  ry,
double  rz 
)
inline

Add a box to the scene

Parameters
cxX center of box
cyY center of box
czZ center of box
xlenLength of box along x-axis
ylenLength of box along y-axis
zlenLength of box along z-axis
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness
rxRotation about x-axis, in degrees
ryRotation about y-axis, in degrees
rzRotation about z-axis, in degrees

◆ addCamera()

void Scene3D.addCamera ( double  x,
double  y,
double  z,
double  rot 
)
inline

Add a particular camera to the scene

Parameters
xX position of camera
yY position of camera
zZ position of camera
rotRotation in degrees about y-axis

◆ addCone() [1/2]

void Scene3D.addCone ( double  cx,
double  cy,
double  cz,
double  radius,
double  height,
double  r,
double  g,
double  b,
double  roughness,
double  metalness 
)
inline

Add an axis-aligned cone to the scene

Parameters
cxX center of cone
cyY center of cone
czZ center of cone
radiusRadius of the cone
heightHeight of the cone
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness

◆ addCone() [2/2]

void Scene3D.addCone ( double  cx,
double  cy,
double  cz,
double  radius,
double  height,
double  r,
double  g,
double  b,
double  roughness,
double  metalness,
double  rx,
double  ry,
double  rz,
double  sx,
double  sy,
double  sz 
)
inline

Add a cone to the scene

Parameters
cxX center of cone
cyY center of cone
czZ center of cone
radiusRadius of the cone
heightHeight of the cone
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness
rxRotation about x-axis, in degrees
ryRotation about y-axis, in degrees
rzRotation about z-axis, in degrees
sxScale about x-axis
syScale about y-axis
szScale about z-axis

◆ addCylinder() [1/2]

void Scene3D.addCylinder ( double  cx,
double  cy,
double  cz,
double  radius,
double  height,
double  r,
double  g,
double  b,
double  roughness,
double  metalness 
)
inline

Add an axis-aligned cylinder to the scene

Parameters
cxX center of cylinder
cyY center of cylinder
czZ center of cylinder
radiusRadius of the cylinder
heightHeight of the cylinder
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness

◆ addCylinder() [2/2]

void Scene3D.addCylinder ( double  cx,
double  cy,
double  cz,
double  radius,
double  height,
double  r,
double  g,
double  b,
double  roughness,
double  metalness,
double  rx,
double  ry,
double  rz,
double  sx,
double  sy,
double  sz 
)
inline

Add a cylinder to the scene

Parameters
cxX center of cylinder
cyY center of cylinder
czZ center of cylinder
radiusRadius of the cylinder
heightHeight of the cylinder
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness
rxRotation about x-axis, in degrees
ryRotation about y-axis, in degrees
rzRotation about z-axis, in degrees
sxScale about x-axis
syScale about y-axis
szScale about z-axis

◆ addDirectionalLight()

void Scene3D.addDirectionalLight ( double  x,
double  y,
double  z,
double  r,
double  g,
double  b,
double  intensity 
)
inline

Add a directional light to the scene at a particular (x, y, z) position, pointing with parallel rays towards the origin (0, 0, 0) and with a particular (r, g, b) color

Parameters
xX position of light
yY position of light
zZ position of light
rRed component of light in [0, 255]
gGreen component of light in [0, 255]
bBlue component of light in [0, 255]
intensityThe intensity of the light, in [0, 1]

◆ addEllipsoid() [1/2]

void Scene3D.addEllipsoid ( double  cx,
double  cy,
double  cz,
double  radx,
double  rady,
double  radz,
double  r,
double  g,
double  b,
double  roughness,
double  metalness 
)
inline

Add an axis-aligned ellipsoid to the scene

Parameters
cxX center of ellipsoid
cyY center of ellipsoid
czZ center of ellipsoid
radxSemi-axis x radius
radySemi-axis y radius
radzSemi-axis z radius
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness

◆ addEllipsoid() [2/2]

void Scene3D.addEllipsoid ( double  cx,
double  cy,
double  cz,
double  radx,
double  rady,
double  radz,
double  r,
double  g,
double  b,
double  roughness,
double  metalness,
double  rx,
double  ry,
double  rz 
)
inline

Add an ellipsoid to the scene

Parameters
cxX center of ellipsoid
cyY center of ellipsoid
czZ center of ellipsoid
radxSemi-axis x radius
radySemi-axis y radius
radzSemi-axis z radius
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness
rxRotation about x-axis, in degrees
ryRotation about y-axis, in degrees
rzRotation about z-axis, in degrees

◆ addMesh()

void Scene3D.addMesh ( String  path,
double  cx,
double  cy,
double  cz,
double  rx,
double  ry,
double  rz,
double  sx,
double  sy,
double  sz,
double  r,
double  g,
double  b,
double  roughness,
double  metalness 
)
inline

Add a mesh to the scene

Parameters
pathFile path to special mesh, relative to this directory
cxOffset in x
cyOffset in y
czOffset in z
rxRotation around x-axis
ryRotation around y-axis
rzRotation around z-axis
sxScale along x-axis
syScale along y-axis
szScale along z-axis
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness

◆ addPointLight()

void Scene3D.addPointLight ( double  x,
double  y,
double  z,
double  r,
double  g,
double  b,
double  intensity 
)
inline

Add a point light to the scene at a particular (x, y, z) position and with a particular (r, g, b) color

Parameters
xX position of light
yY position of light
zZ position of light
rRed component of light in [0, 255]
gGreen component of light in [0, 255]
bBlue component of light in [0, 255]
intensityThe intensity of the light, in [0, 1]

◆ addSphere()

void Scene3D.addSphere ( double  cx,
double  cy,
double  cz,
double  radius,
double  r,
double  g,
double  b,
double  roughness,
double  metalness 
)
inline

Add a sphere to the scene

Parameters
cxX center of the sphere
cyY center of the sphere
czZ center of the sphere
radiusRadius of the sphere
rRed component in [0, 255]
gGreen component in [0, 255]
bBlue component in [0, 255]
roughnessHow rough the material appears. 0.0 means a smooth mirror reflection, 1.0 means fully diffuse. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.roughness
metalnessHow much the material is like a metal. Non-metallic materials such as wood or stone use 0.0, metallic use 1.0, with nothing (usually) in between. https://threejs.org/docs/#api/en/materials/MeshStandardMaterial.metalness

◆ addTexturedMesh()

void Scene3D.addTexturedMesh ( String  path,
String  matpath,
double  cx,
double  cy,
double  cz,
double  rx,
double  ry,
double  rz,
double  sx,
double  sy,
double  sz,
double  shininess 
)
inline

Add a textured mesh to the scene

Parameters
pathFile path to mesh, relative to this directory
matpathFile path to material, relative to this directory
cxOffset in x
cyOffset in y
czOffset in z
rxRotation around x-axis
ryRotation around y-axis
rzRotation around z-axis
sxScale along x-axis
syScale along y-axis
szScale along z-axis
shininessA number in [0, 255] describing how shiny the mesh is

◆ saveScene()

void Scene3D.saveScene ( String  filename,
String  sceneName 
)
inline

Save this scene to a file

Parameters
filenamePath to which to save file (should end with .json)
sceneNameTitle of the scene to display in the viewer

The documentation for this class was generated from the following file: