|
The settings.js file allows control over the environment in
which the model should be shown.
You can control these via URL query strings. For example.
webpage.htm?showAxis=true&showNormals=true
The settings which can be modified are:
- backgroundColor = R,G,B - allows modifying the background color
by settings an array; important: It has to be 3 numerical values in
the range of [0,1] for each of the color components (red, green,
blue) separated by a comma (',')
- enableTransparency = true/false - default enabled, but allows
disabling transparency, but will only result in different rendering
if the content actually has transparency
- wireframe = true/false - allows rendering a pseudo-wireframe
which can help illustrate the triangles of which the content is
made (Note: it is technically not a correct wireframe, as all it
does is just render the triangles as line sets instead of triangles
- a technically correct wireframe is more easily implemented using
geometry shaders, which are not supported in WebGL 1)
- backfaceCulling = true/false - allows disabling rendering of
the "backside" of triangles, so in case of a PDF page, if the
camera is viewing it's backside it will simple draw nothing
- enableDepthSorting = true/false - allows en/disabling depth
sorting, which is only really relevant in "true 3D" content, but
won't show a visible difference on a 3D-rendered PDF page
- orthoView = true/false - by default the content is rendered in
a perspective projection (edges of the same length will be rendered
at a different size depending on their distance to the viewer), but
with this settings it can be rendered in an orthogonal projection,
which results in edges of the same length being rendered the same
size regardless of the distance to the viewer (which can result in
a distorted look)
- defaultPerspectiveFOV = <angle in degrees> - allows
setting the field of view angle for the scene, default is a 45
degree cone (will not affect orthogonal projections)
- nearClip = <distance in units> - allows setting the
distance of the near clipping plane of the view frustum (objects
closer to the camera than this value will result in being
clipped)
- farClip = <distance in units> - allows setting the
distance of the face clipping plane of the view frustum (objects
further than that will not be drawn)
- defaultViewDistance = <distance in units> - allows
settings the default distance of the viewer (camera) from the
subject
- showAxis = true/false - allows showing the main axis in the
rendered world, centered at the origin; x-Axis is red, y-Axis is
green, and z-Axis is blue with the positive axis being a brighter
hue than the negative axis
- axisScale = <value> - allows changing the size of the
axis that is being rendered, default is 300
- showGrid = true/false - allows rendering a grid in the world,
centered around the origin and lying in the XZ-plane
- gridScale = <value> - allows changing the size of the
grid that is being rendered, default is 1000
- gridColor = R,G,B - allows modifying the color of the grid,
like in background color by comma-separated red, green and blue
values, each in the range of [0,1]
- showNormals = true/false - allows rendering "normals" (vectors
perpendicular the to triangles they belong to), which can help
visualizing and understanding the lighting effects more
- normalColor = R,G,B - allows modifying the color of the
normals, by comma-separated red, green and blue values, each in the
range of [0,1]
- normalScale = <value> - allows modifying the size of the
rendered normals, default is 100
- enableLight = true/false - allows switching the light source
on/off; if off the object will be drawn full-bright using it's
normal object colors, if the light is enabled, it will use a single
infinite-distance directional light source (similar to the sun) to
light the scene, and the brightness of the objects depends on their
direction relative to the light source
- enableAmbient = true/false - allows en/disabling an ambient
light source (so that for example the side which is pointing away
from the light source won't just appear black but will be lit a bit
as well)
- enableSpecular = true/false - allows en/disabling specular
highlights on the objects; depending on the position of the viewer
relative to the object and light source, a specular reflection
might make parts of the object brighter
- lightPosition = X,Y,Z - allows setting the position of the
light; the directional light will then "shine" in the direction
from this position towards the origin, therefore the actual
distance from the object does not matter, only the direction
- lightAmbient = R,G,B - allows setting the brightness and color
of the ambient light (if enabled)
- lightDiffuse = R,G,B - allows setting the brightness and color
of the main light source (diffuse light)
- lightSpecular = R,G,B - allows setting the brightness and color
of the specular reflection (to simulate how different materials
might reflect light differently); to provide a consistent lighting
model, the ambient, diffuse and specular colors should have the
same hue (but can have different brightness)
- allowDynamicView = true/false - allows en/disabling of view
modifications; if false the result will be the same as rendering a
static page
- allowMouseWheelZoom = true/false - if true, the view can be
zoomed in/out using the mouse wheel
- mouseWheelIncrement = <value> - allows setting the amount
of zoom applied by the mouse wheel with each movement, default is
50
- moveKey = "<keyname>" - the key modifier to use to allow
translating (moving) the object (while left-clicking and dragging
the mouse), default "Shift"
- zoomKey = "<keyname>" - the key modifier to use to allow
zooming in/out (while left-clicking and dragging the mouse),
default "" (disabled)
- resetKey = "<keyname>" - the key modifier to use to reset
the view to original direction, and return the object to it's
original position, default "Home"
- modelRotateKey = "<keyname>" - the key modifier to use to
allow rotating the object (rather than the camera) while
left-clicking and dragging the mouse, default "Control"
- allowQWEASDRotation = true/false - whether to enable the keys
Q, W, E, A, S, D for rotating the object in 90 degree increments
around the x, y or z-Axis (A,D = +-90 deg on x-Axis, W,S = +-90deg
on y-Axis and Q,E = +-90deg on z-Axis); mostly used for debugging
purposes, default disabled
|
|
|