Worked Examples
Understand three-dimensional model graphics — Visualization & Graphing
Understand three-dimensional model graphics — Visualization & Graphing Cross-application area: Visualization & Graphing Status: Initial scientific graphics guidance; platform-specific features not verified. Why this visualization
1. Overview
Three-dimensional (3D) scientific graphics represent spatial
geometry, physical fields, model outputs, or numerical
relationships within a coordinate system.
Unlike decorative 3D illustrations, scientific visualizations
must preserve the interpretation of their underlying
numerical data. Geometry, scale, perspective, interpolation,
lighting, and color mapping can materially influence the
conclusions drawn from a figure.
A scientifically defensible visualization should allow
researchers to distinguish:
- Observed measurements from modeled or simulated values.
- Physical geometry from graphical transformations.
- Interpolation from actual measurement resolution.
- Numerical uncertainty from apparent visual precision.
- Exploratory rendering from validated scientific evidence.
The central principle is that a 3D graphic is a representation
of scientific data, not an independent verification of that data.
2. Scientific Applications
Three-dimensional model graphics support several distinct
research activities.
| Visualization | Typical Application | Primary Validation Concern |
|---|---|---|
| 3D surface | Terrain, response surfaces, spatial model outputs | Axis scaling and interpolation |
| 3D scatter | Multivariate observations and spatial sampling | Overplotting and measurement uncertainty |
| Volumetric rendering | Concentration fields, subsurface modeling, tomography | Opacity transfer functions and sampling resolution |
| Mesh visualization | Finite-element models, structural simulations | Mesh quality and geometric fidelity |
| Vector field | Fluid movement, atmospheric transport, groundwater flow | Vector magnitude, orientation, and coordinate basis |
| Time-dependent 3D | Dynamic physical and environmental simulations | Temporal consistency and model state |
Select the representation according to the scientific
question. Three-dimensional rendering is not automatically
more informative than a two-dimensional chart, cross-section,
or numerical table.
3. Mathematical Foundations
3.1 Coordinate Systems
A point in three-dimensional Cartesian space is represented
by the vector:
p = [x, y, z]^T
The coordinates may represent position, independent
variables, or transformed measurements. They must not
be treated as interchangeable without an explicit
coordinate-system definition.
For spatial datasets, record coordinate reference systems,
axis order, datum, units, and any projection or
coordinate transformations.
3.2 Scalar Fields
A scalar field assigns a numerical quantity to each point
in a spatial domain:
f : R^3 -> R
f(x, y, z) = scalar value
Examples include temperature, pressure, pollutant
concentration, or simulated material properties.
A 3D surface is often defined as a height field:
z = f(x, y)
A height-field surface represents only geometries that
can be expressed as a single-valued function of
the two horizontal coordinates. Overhangs and more
complex shapes require alternative representations
such as polygonal meshes or implicit surfaces.
3.3 Vector Fields
A vector field associates direction and magnitude
with each spatial location:
F(x, y, z) = [u(x,y,z), v(x,y,z), w(x,y,z)]
The Euclidean magnitude is:
|F| = sqrt(u^2 + v^2 + w^2)
This expression assumes that vector components are expressed
in compatible units within an orthonormal Cartesian basis.
Geographic coordinates and curvilinear coordinate systems
may require metric-aware transformations.
3.4 Geometric Transformations
Translation, rotation, and scaling can be represented
using homogeneous coordinates:
p' = M p
p = [x, y, z, 1]^T
M = T R S
Here, T is translation, R is rotation, and S is scaling.
The multiplication order assumes column vectors and
right-to-left application of transformations.
Nonuniform scaling changes apparent geometric proportions.
Consequently, graphical transformations must be separated
from scientifically meaningful physical transformations.
3.5 Perspective Projection
Under a simplified pinhole-camera model, a point in
camera coordinates is projected onto a two-dimensional
image plane:
u = fx * (Xc / Zc) + cx
v = fy * (Yc / Zc) + cy
The variables fx and fy represent focal lengths in pixel
units, while cx and cy represent the principal point.
This convention assumes positive camera depth Zc and
a compatible image-axis orientation.
Perspective projection makes distant objects appear
smaller. Orthographic projection removes this
perspective-size effect and is often preferable
for geometric comparisons.
Neither projection guarantees scientifically accurate
axis proportions without appropriate scene scaling.
4. Axis Ratios and Geometric Integrity
Incorrect axis scaling is one of the most common sources
of misleading 3D scientific graphics.
Suppose a surface represents a horizontal distance
of 1,000 meters and a vertical elevation range
of 20 meters. Displaying all three axes with
equal visual lengths can exaggerate the relative
prominence of vertical changes.
For a physical-domain extent:
Lx = xmax - xmin
Ly = ymax - ymin
Lz = zmax - zmin
A geometrically faithful physical-space representation
requires consistent length-to-display scaling across
the axes, after conversion to compatible units.
An intentionally exaggerated vertical dimension
should be explicitly disclosed.
Vertical exaggeration = displayed vertical scale
/ displayed horizontal scale
When horizontal and vertical distances are both
expressed in meters, a vertical exaggeration
factor of 5 makes vertical distances appear
five times larger relative to horizontal distances
than they would under equal physical scaling.
Axis settings, exaggeration factors, projection type,
and camera parameters should be included in the
visualization metadata.
5. Example: Reproducible 3D Surface Using Python
The following example creates a synthetic two-dimensional
Gaussian surface and renders it using Plotly.
The data are mathematical test values, not measured
environmental observations.
5.1 Install Dependencies
python -m pip install numpy plotly
For reproducible production research, use a controlled
dependency environment with pinned versions and a
recorded Python interpreter version.
5.2 Generate and Render the Surface
import numpy as np
import plotly.graph_objects as go
# Synthetic coordinate grid
x = np.linspace(-4.0, 4.0, 101)
y = np.linspace(-4.0, 4.0, 101)
X, Y = np.meshgrid(x, y)
# Gaussian height field
sigma = 1.2
amplitude = 10.0
Z = amplitude * np.exp(
-(X**2 + Y**2) / (2.0 * sigma**2)
)
# Basic numerical validation
assert X.shape == Y.shape == Z.shape
assert np.isfinite(Z).all()
assert np.all(Z >= 0.0)
assert np.max(Z) <= amplitude + 1e-12
fig = go.Figure(
data=[
go.Surface(
x=X,
y=Y,
z=Z,
colorscale="Viridis",
colorbar={
"title": {"text": "Height (synthetic units)"}
}
)
]
)
fig.update_layout(
title="Synthetic Gaussian Surface",
scene={
"xaxis_title": "X (synthetic units)",
"yaxis_title": "Y (synthetic units)",
"zaxis_title": "Height (synthetic units)",
"aspectmode": "data",
"camera": {
"projection": {"type": "orthographic"}
}
}
)
fig.write_html(
"synthetic_gaussian_surface.html",
include_plotlyjs=True
)
fig.show()
Reproduction check: The sample grid includes the origin, so the computed maximum should equal the analytical amplitude. The numerical peak also should occur at (0, 0). Confirm both before treating the HTML rendering as a faithful display.
peak = np.unravel_index(np.argmax(Z), Z.shape)
assert np.isclose(Z[peak], amplitude, rtol=0, atol=1e-12)
assert np.isclose(X[peak], 0.0)
assert np.isclose(Y[peak], 0.0)
assert np.isclose(Z[peak], amplitude)
5.3 Mathematical Interpretation
The modeled surface follows:
z(x,y) = A * exp(-(x^2 + y^2) / (2 * sigma^2))
where A controls peak amplitude and sigma controls
the spatial spread.
The surface reaches its analytical maximum at
x = 0 and y = 0:
z(0,0) = A
Because the example uses 101 grid points along
each axis over a symmetric interval, the origin
is included in the sampled grid. The numerical
maximum should therefore equal the specified
amplitude within floating-point precision.
The Gaussian surface is smooth by construction.
This smoothness is not evidence that real measurements
possess the same spatial continuity.
6. Example: Triangulated Surface with PyVista
For scientific mesh inspection, finite-element results,
and complex spatial geometries, polygonal mesh rendering
may be more suitable than a conventional surface plot.
PyVista provides a Python interface to VTK, a widely
used scientific visualization toolkit.
python -m pip install numpy pyvista
import numpy as np
import pyvista as pv
x = np.linspace(-3.0, 3.0, 60)
y = np.linspace(-3.0, 3.0, 60)
X, Y = np.meshgrid(x, y, indexing="ij")
Z = np.sin(X) * np.cos(Y)
# Create structured mesh
mesh = pv.StructuredGrid(X, Y, Z)
# Attach synthetic scalar values
mesh["height"] = Z.ravel(order="F")
# Validate geometry and scalar data
assert mesh.n_points == X.size
assert np.isfinite(mesh.points).all()
assert np.isfinite(mesh["height"]).all()
plotter = pv.Plotter(off_screen=True)
plotter.add_mesh(
mesh,
scalars="height",
cmap="viridis",
show_edges=False,
scalar_bar_args={
"title": "Height (synthetic units)"
}
)
plotter.add_axes()
plotter.show_grid()
plotter.view_isometric()
plotter.screenshot(
"synthetic_mesh.png"
)
plotter.close()
This example constructs a structured surface mesh
from synthetic numerical coordinates. The scalar
assignment uses Fortran-order flattening to match
the mesh point ordering.
In a research environment, mesh validation should
also assess cell connectivity, degenerate elements,
numerical discontinuities, and whether the mesh
resolution is appropriate for the scientific model.
Headless rendering may require appropriate VTK
rendering support or an off-screen display backend
on the execution host.
7. Interpolation, Smoothing, and Model Fidelity
Scientific visualization frequently requires values
between observed or simulated sample locations.
These values are estimated through interpolation
rather than directly measured.
7.1 Trilinear Interpolation
For a scalar field defined at the eight corners
of a rectangular cell, trilinear interpolation
estimates the value at normalized local coordinates
a, b, and c within the interval [0,1].
f(a,b,c) =
sum(i=0..1)
sum(j=0..1)
sum(k=0..1)
f_ijk * wi(a) * wj(b) * wk(c)
w0(t) = 1 - t
w1(t) = t
Trilinear interpolation is exact at the cell vertices
and interpolates linearly along each coordinate
direction. It does not reconstruct unresolved
fine-scale physical processes.
7.2 Smoothing
Gaussian smoothing can be expressed as convolution:
f_smooth(x) = (G_sigma * f)(x)
where G_sigma is a Gaussian kernel and sigma is the
smoothing scale.
Smoothing may suppress high-frequency variation,
including measurement noise, but it may also
remove genuine spatial features or alter extrema.
Record smoothing parameters, interpolation methods,
boundary conditions, and the original unsmoothed data.
7.3 Missing Values
Missing observations must not be silently converted
into zeros or interpolated without justification.
A valid visualization workflow should distinguish
between missing measurements, physically meaningful
zero values, and values outside the modeled domain.
7.4 Interpolation Acceptance
For validation fixtures, compare interpolated values at known vertices and interior points with an independently calculated reference. Record whether values outside the convex hull or model domain are masked, extrapolated, or rejected. Interpolation accuracy is distinct from accuracy of the original observations or physical model.
8. Representing Scientific Uncertainty
Three-dimensional graphics can communicate an
unjustified sense of precision when the underlying
observations or model parameters are uncertain.
For a modeled quantity:
z = f(x, y, theta)
where theta is a vector of uncertain parameters,
first-order uncertainty propagation may be
approximated using:
Var(z) ≈ J * Sigma * J^T
Here, J is the Jacobian of f with respect to the
uncertain input vector, and Sigma is the covariance
matrix of those inputs. This is a local linear
approximation and may be inadequate for strongly
nonlinear models or large uncertainties.
Depending on the research question, uncertainty
may be communicated through:
- Separate surfaces showing upper and lower bounds
- Spatial uncertainty maps or cross-sections
- Ensemble model visualizations
- Confidence or credible interval annotations
- Linked numerical summaries
- Probability distributions for selected locations
Where uncertainty cannot be reliably estimated,
state that limitation instead of substituting
a visually precise surface.
9. Color Mapping, Lighting, and Occlusion
9.1 Color Scales
Choose color mappings based on the mathematical
meaning of the variable.
-
Sequential: Appropriate for ordered,
nonnegative or monotonically increasing quantities. -
Diverging: Appropriate for values
centered around a meaningful reference, such as
zero anomaly or model residual. -
Cyclic: Appropriate for periodic
quantities such as angular direction. -
Categorical: Appropriate for distinct
classes rather than continuous measurements.
Color normalization, clipping thresholds, and
nonlinear mappings must be disclosed. When comparing
multiple models, use consistent scale limits where
the variables and units are comparable.
9.2 Lighting
Surface lighting can help reveal shape, but it can also
introduce visual structure that is unrelated to
measured scalar variation.
A simplified diffuse-lighting model is:
I_diffuse = kd * max(0, n · l)
where kd is a diffuse reflectance coefficient,
n is the unit surface normal, and l is the
unit direction toward the light.
Lighting changes how a surface appears without
changing its underlying data. For quantitative
interpretation, retain a labeled color scale
and provide access to numerical values.
9.3 Occlusion
3D perspective can conceal points, surfaces,
and internal structures. Use cross-sections,
alternative camera angles, transparent rendering,
or linked two-dimensional views where necessary.
10. Time-Dependent Three-Dimensional Models
A dynamic scientific model may depend on both
spatial position and time:
f = f(x, y, z, t)
A sequence of 3D renderings can represent the
evolution of a scalar or vector field through time.
For temporal comparisons, preserve consistent:
- Coordinate reference systems and spatial extents
- Color-scale normalization
- Camera position and projection
- Units and variable definitions
- Time-step labels and temporal reference systems
- Interpolation and missing-data policies
Animation must not imply greater temporal resolution
than exists in the original measurements or simulation.
Interpolated frames should be identified when they
are generated between modeled time steps.
Four-dimensional visualization commonly refers to
three spatial dimensions plus time. It does not
eliminate the need for physical-model validation
or independent numerical analysis.
11. Numerical Validation of Rendered Data
The rendered geometry should be checked against the
original numerical arrays before a figure is
accepted as a scientific output.
At minimum, validate array dimensions, finite
values, units, range, coordinate ordering, and
expected mathematical invariants.
11.1 Relative Error
For reference values y and reconstructed values
y_hat, relative error may be defined as:
relative_error =
||y_hat - y||_2 / ||y||_2
This metric is undefined when the reference norm
is zero. In that case, use an appropriately scaled
absolute-error criterion.
11.2 Root Mean Squared Error
RMSE = sqrt(
(1/N) * sum((y_hat_i - y_i)^2)
)
RMSE measures numerical disagreement but does
not establish that a physical model is scientifically
valid. A model can reproduce its own numerical
output exactly while still being inconsistent
with independent observations.
11.3 Python Validation Example
import numpy as np
def validate_surface(reference, reconstructed):
reference = np.asarray(reference, dtype=float)
reconstructed = np.asarray(reconstructed, dtype=float)
if reference.shape != reconstructed.shape:
raise ValueError("Shape mismatch")
if not np.isfinite(reference).all():
raise ValueError("Invalid reference values")
if not np.isfinite(reconstructed).all():
raise ValueError("Invalid reconstructed values")
if reference.size == 0:
raise ValueError("Empty arrays are not valid")
error = reconstructed - reference
rmse = float(np.sqrt(np.mean(error**2)))
max_abs_error = float(np.max(np.abs(error)))
reference_norm = np.linalg.norm(reference)
relative_error = (
float(np.linalg.norm(error) / reference_norm)
if reference_norm > 0
else None
)
return {
"rmse": rmse,
"max_absolute_error": max_abs_error,
"relative_error": relative_error,
}
# Synthetic validation example
reference = np.array([
[1.0, 2.0],
[3.0, 4.0]
])
reconstructed = reference.copy()
metrics = validate_surface(reference, reconstructed)
assert np.isclose(metrics["rmse"], 0.0)
assert np.isclose(metrics["max_absolute_error"], 0.0)
print(metrics)
This example demonstrates numerical consistency
checks. Tolerances for real datasets must be
justified by measurement precision, numerical
methods, data transformations, and the intended
scientific use.
12. Reproducibility and Scientific Provenance
A research-grade 3D visualization should be
reproducible from its source dataset, computational
parameters, and rendering configuration.
The minimum provenance record should identify:
- Source dataset identifier and version
- Dataset origin, license, and access conditions
- Measurement units and coordinate reference system
- Data-cleaning and transformation procedures
- Interpolation, clipping, and smoothing settings
- Model version and numerical parameters
- Rendering engine and dependency versions
- Camera position, projection, and axis scaling
- Color-map definition and normalization range
- Generation timestamp and output artifact identifiers
12.1 Example Visualization Manifest
The following JSON illustrates a proposed provenance
manifest. It is not a verified Sustainable Catalyst
API contract or existing platform schema.
{
"schema_version": "example-1.0",
"visualization_type": "surface_3d",
"data_classification": "synthetic",
"source": {
"dataset_id": "synthetic-gaussian-001",
"version": "1.0",
"units": "synthetic_units"
},
"model": {
"equation": "A*exp(-(x*x+y*y)/(2*sigma*sigma))",
"parameters": {
"A": 10.0,
"sigma": 1.2
}
},
"rendering": {
"engine": "plotly",
"projection": "orthographic",
"aspect_mode": "data",
"color_scale": "Viridis",
"interpolation": "none",
"smoothing": "none"
},
"validation": {
"finite_values": true,
"shape_verified": true,
"physical_validation": false
},
"output": {
"format": "html",
"filename": "synthetic_gaussian_surface.html"
}
}
For production use, the manifest should additionally
record immutable input references, code revision
identifiers, dependency lockfiles, artifact
checksums, and validation evidence where available.
A manifest records how an output was produced.
It does not by itself certify the correctness
of the underlying science.
13. Sustainable Catalyst Research Workflow
Within the Sustainable Catalyst architecture,
three-dimensional scientific graphics are relevant
to research data management, computational modeling,
scientific analysis, and publication workflows.
A proposed cross-application workflow is:
-
Library:
Identify and retain source datasets, documentation,
references, licensing information, and provenance. -
Workspace:
Associate the visualization with a research project,
responsible owner, and defined research objective. -
Workbench and Lab:
Execute computational methods, construct model
outputs, inspect meshes, and perform numerical
validation. -
Site Intelligence:
Provide spatial context, georeferenced datasets,
and location-specific analysis where applicable. -
Decision Studio:
Use validated model outputs in appropriate
comparisons, scenarios, or decision analyses. -
Research:
Associate reproducible figures, methods, numerical
evidence, and citations with scientific outputs
and publications.
This sequence describes an intended integration
pattern, not an independently verified end-to-end
production workflow. Actual data contracts,
authorization boundaries, artifact persistence,
and publication controls must be checked in
the relevant deployed applications.
13.1 Visualization Engine Selection
Different visualization engines offer capabilities
appropriate to different research requirements.
| Technology | Typical Strength | Scientific Use |
|---|---|---|
| Plotly | Interactive browser-based scientific charts | Surface plots, 3D scatter, exploratory analysis |
| PyVista / VTK | Mesh and volumetric visualization | Simulation fields, geometry, finite-element results |
| CesiumJS | Geospatial 3D scenes and temporal visualization | Terrain, georeferenced objects, spatial models |
| MapLibre | Interactive geographic mapping | Map-based context and supported 3D map layers |
| Vega-Lite | Declarative statistical visualization | Linked 2D analysis and supporting statistical views |
These are technology options rather than confirmed
production integrations. Vega-Lite is primarily
intended for two-dimensional statistical graphics,
while MapLibre focuses on geographic map rendering
rather than general-purpose volumetric analysis.
14. Publication and Figure Acceptance
Before a 3D graphic is incorporated into a scientific
report, technical publication, or policy analysis,
verify the following requirements.
- The scientific question and plotted variables are explicit.
- All axes have correct units and documented coordinate systems.
- Geometry and aspect ratios are appropriate.
- Any visual exaggeration is disclosed.
- Interpolation, smoothing, and filtering are documented.
- Missing values and masked regions are handled transparently.
- Color scales represent the data appropriately.
- Numerical consistency checks have been completed.
- Uncertainty and model limitations are acknowledged.
- Source datasets and computational methods are traceable.
- Rendering parameters and dependency versions are retained.
- The figure can be regenerated from archived inputs.
- The caption distinguishes observations from simulations.
14.1 Example Scientific Figure Caption
Figure 1. Three-dimensional representation of a synthetic
Gaussian response surface generated using a regular numerical
grid. The surface follows z(x,y) = A exp[-(x²+y²)/(2σ²)],
with A = 10 and σ = 1.2. Orthographic projection and
data-proportional axis scaling are used. Values are
synthetic and are not derived from observed environmental
measurements. The figure demonstrates rendering and
numerical-validation methods only.
Captions should describe the represented quantity,
data origin, relevant model assumptions, coordinate
conventions, and transformations required for
correct scientific interpretation.
15. Troubleshooting 3D Model Graphics
Diagnose visualization errors by separating source-data failures, geometric transformation errors, renderer-state differences, and export failures. Preserve the original dataset and the configuration that produced the failed display.
| Symptom | Likely cause | Verification or safe correction |
|---|---|---|
| Surface appears vertically exaggerated | Equal display-box dimensions for unequal physical extents | Verify coordinate units, data aspect ratios, and recorded exaggeration factor. |
| Sharp features disappear | Excessive smoothing or coarse sampling | Compare with original values; report grid resolution and smoothing settings. |
| Color patterns change between figures | Automatic color normalization or differing bounds | Use comparable fixed value limits and explicit legends for comparable datasets. |
| Mesh has tears or unexpected faces | Connectivity, point ordering, or invalid cell geometry | Inspect cell topology and check representative coordinates before rendering. |
| Figure fails in headless execution | Unavailable graphics backend or host-specific rendering dependencies | Record renderer version and backend; test isolated off-screen rendering. |
| Animation implies smooth temporal continuity | Interpolated frames presented as observed time steps | Label simulated and interpolated frames; preserve original time stamps. |
| Export does not match interactive view | Uncaptured camera, clipping, color, or filter state | Record rendering configuration and compare exported artifact with the approved view. |
| Reconstructed numerical values differ | Unit, coordinate transform, indexing, or resampling error | Inspect selected point values and independent error metrics prior to publication. |
Safe Recovery
- Record source artifact identity, model revision, renderer configuration, and nonsecret diagnostic identifiers.
- Preserve the failed output and original numerical arrays.
- Reproduce with a minimal synthetic mesh or scalar field.
- Verify geometry, units, values, and transformation settings independently.
- Apply a documented correction in an isolated working copy.
- Regenerate and compare outputs, then attach the validation evidence to the revised figure.
16. Accessibility, Performance, and Export Integrity
Interactive three-dimensional figures should provide a meaningful text description, labeled numerical axes, units, and a static or tabular alternative for users unable to interact with WebGL content. Essential conclusions must not depend exclusively on mouse rotation, color discrimination, or animation.
For large meshes or volumes, preserve the authoritative full-resolution data while documenting any level-of-detail reductions, decimation, subsampling, or lossy compression used for interactive display. A fast preview must not be mistaken for a fully resolved simulation.
Publication exports should be checked for legibility of legends, axes, clipping planes, and captions. When archival reproducibility matters, retain both an inspectable numerical artifact and a fixed-view rendering or reproducible visualization specification.
Acceptance: A reviewer can determine the main scientific finding, source, units, assumptions, and limitations without requiring access to the same graphics hardware or interaction environment as the author.
17. Limitations and Verification Boundaries
Three-dimensional graphics can communicate spatial
relationships effectively, but they can also obscure
uncertainty, exaggerate geometry, or conceal
inconsistencies within computational models.
Visual inspection must therefore be supplemented
by numerical checks, scientific reasoning,
independent observations where available, and
documented model-validation procedures.
The examples in this article establish general
computational techniques. They do not establish
that Sustainable Catalyst currently supports
the demonstrated renderers, notebook execution,
mesh workflows, automated figure validation,
or end-to-end publication integration.
Release-specific technical documentation should
verify installed dependencies, supported execution
environments, authorized interfaces, output formats,
and reproducibility controls before these procedures
are presented as operational platform instructions.
18. Technical References
- NumPy documentation — numerical arrays and validation.
- Plotly Python 3D charts — browser-based surface and scatter visualization.
- PyVista documentation — VTK-based geometry and mesh inspection.
- VTK documentation — scientific visualization toolkit.
- W3C PROV-O — provenance representation.
- WCAG 2.2 — accessibility requirements relevant to interactive graphics.
These references are methodological resources, not evidence of installed integrations.
