Scene3D Simple Scene Viewer
Public Member Functions | List of all members
Scene3D Class Reference

Public Member Functions

string getTransformationHierarchy (double tx, double ty, double tz, double rx, double ry, double rz, double sx, double sy, double sz, string shape)
 
void addBox (double cx, double cy, double cz, double xlen, double ylen, double zlen, double r, double g, double b, 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)
 
void addCylinder (double cx, double cy, double cz, double radius, double height, double r, double g, double b, 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)
 
void addCone (double cx, double cy, double cz, double radius, double height, double r, double g, double b, 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)
 
void addEllipsoid (double cx, double cy, double cz, double radx, double rady, double radz, double r, double g, double b, 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)
 
void addSphere (double cx, double cy, double cz, double radius, double r, double g, double b)
 
void addSpecialMesh (string meshName, double cx, double cy, double cz, double rx, double ry, double rz, double sx, double sy, double sz, double r, double g, double b)
 
void addCamera (double x, double y, double z, double rot)
 
void addLight (double x, double y, double z, double r, double g, double b)
 
void saveScene (string filename, string sceneName)
 

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 
)
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]

◆ 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  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]
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 
)
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]

◆ addCone() [2/2]

void Scene3D::addCone ( double  cx,
double  cy,
double  cz,
double  radius,
double  height,
double  r,
double  g,
double  b,
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]
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 
)
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]

◆ addCylinder() [2/2]

void Scene3D::addCylinder ( double  cx,
double  cy,
double  cz,
double  radius,
double  height,
double  r,
double  g,
double  b,
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]
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

◆ addEllipsoid() [1/2]

void Scene3D::addEllipsoid ( double  cx,
double  cy,
double  cz,
double  radx,
double  rady,
double  radz,
double  r,
double  g,
double  b 
)
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]

◆ 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  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]
rxRotation about x-axis, in degrees
ryRotation about y-axis, in degrees
rzRotation about z-axis, in degrees

◆ addLight()

void Scene3D::addLight ( double  x,
double  y,
double  z,
double  r,
double  g,
double  b 
)
inline

Add a 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]

◆ addSpecialMesh()

void Scene3D::addSpecialMesh ( string  meshName,
double  cx,
double  cy,
double  cz,
double  rx,
double  ry,
double  rz,
double  sx,
double  sy,
double  sz,
double  r,
double  g,
double  b 
)
inline

Add a special mesh to the scene

Parameters
meshNameName of the special mesh
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]

◆ addSphere()

void Scene3D::addSphere ( double  cx,
double  cy,
double  cz,
double  radius,
double  r,
double  g,
double  b 
)
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]

◆ getTransformationHierarchy()

string Scene3D::getTransformationHierarchy ( double  tx,
double  ty,
double  tz,
double  rx,
double  ry,
double  rz,
double  sx,
double  sy,
double  sz,
string  shape 
)
inline

Return a hierarchy of JSON for doing a translation, then a sequence of 3 rotations

Parameters
txTranslation in x
tyTranslation in y
tzTranslation in z
rxRotation about x
ryRotation about y
rzRotation about z
shapestring with JSON for the shape

◆ 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: