- BSplineCurve
A curve evaluator object for a B-spline (basis spline) curve. - BSplineSurface
A surface evaluator object for a B-spline (basis spline) surface, whose edges are made up of B-spline curves. - BufferAccessor
Deprecated: It is planned to render this class obsolete and rely on three.js's BufferGeometry. - Curve
A curve evaluator object for a parametric curve. - CurveBuilder
An evaluator of curve evaluator objects for generating vertex attributes for a curve. - Global Members
- GraphicsPath
Represents a two-dimensional path. - H3DU
This is a library with classes and methods that were formerly in the Public Domain HTML 3D Library. - MathUtil
A collection of math functions for working with vectors, matrices, quaternions, and other mathematical objects of interest to three-dimensional graphics programming. - MeshBuffer
Deprecated: It is planned to render this class obsolete and rely on three.js's BufferGeometry. - Meshes
Contains methods that create meshes of various geometric shapes and solids, such as cubes, cylinders, and spheres. - PiecewiseCurve
A curve evaluator object for a curve made up of one or more individual curves. - Semantic
Deprecated: It is planned to render this class obsolete and rely on three.js's BufferGeometry. - ShapeGroup
Represents a grouping of shapes. - Surface
A surface evaluator object for a parametric surface. - SurfaceBuilder
An evaluator of surface evaluator objects for generating vertex attributes for a surface. - Transform
A class offering a convenient way to set a transformation from one coordinate system to another. - module:extras/camera
Theextras/camera.js
module. - module:extras/camera.Camera
A class for controlling the projection and view of a 3D scene, in the nature of an abstract "camera". - module:extras/camera.InputTracker
A class for tracking key press, mouse, touch, and mouse wheel events. - module:extras/createwasher
Theextras/createwasher.js
module. - module:extras/curvetube
Theextras/curvetube.js
module. - module:extras/curvetube.CurveTube
A surface evaluator object for a tube extruded from a parametric curve. - module:extras/derivedcurves
Additional curve evaluator and surface evaluator objects. - module:extras/evaluators
Theextras/evaluators.js
module. - module:extras/evaluators.Roulette
A curve evaluator object for a curve drawn by a curve that rolls along another curve whose position is fixed. - module:extras/evaluators.SurfaceOfRevolution
A surface evaluator object for a surface of revolution, which results by revolving a two-dimensional curve around an axis. - module:extras/fourierknot
Theextras/fourierknot.js
module. - module:extras/gradients
Theextras/gradients.js
module. - module:extras/marbleshader2
Theextras/marbleshader2.js
module. - module:extras/matrixstack
Theextras/matrixstack.js
module. - module:extras/matrixstack.MatrixStack
This class implements a stack of 4x4 transformation matrices. - module:extras/moresurfaces
Theextras/moresurfaces.js
module. - module:extras/moresurfaces.KleinBottle
Surface evaluator object for the Klein surface, also known as the "Klein bottle". - module:extras/moresurfaces.MoebiusStrip
Surface evaluator object for a Möbius strip. - module:extras/randompolygon
Contains a method to generate a simple polygon at random. - module:extras/starpolygon
Theextras/starpolygon.js
module. - module:extras/superellipsoid
Theextras/superellipsoid.js
module. - module:extras/superellipsoid.Supershape
TODO: Not documented yet. - module:extras/superellipsoid.Supertoroid
TODO: Not documented yet. - module:extras/tga
Theextras/tga.js
module. - module:extras/torusknot
Theextras/torusknot.js
module. - module:extras/torusknot.TorusKnot
A curve evaluator object for a torus knot or torus-knot-like curve.
- The "Camera" and Geometric Transforms
- Graphics Filters
- Older Version History
- Matrix Details
- Library Overview
- Creating Shapes
- Parametric Curves and Parametric Surfaces
Download source code: ZIP file
This is a public-domain library with classes and methods that were formerly in the Public Domain HTML 3D Library. Classes and methods that involved WebGL, shaders, or a 3D scene graph were removed, to make this library much more general-purpose. In any case, maintaining a 3D scene graph, textures, materials, and shaders is not trivial and is better handled by established 3D engines, such as three.js. The classes and methods remaining in this library don't assume the existence of a 3D rendering pipeline such as WebGL or OpenGL ES, or even the existence of an HTML DOM, and are thus more easily portable to other programming languages.
(Speaking of OpenGL ES, there are some things supported by some implementations that are strictly not necessary, since they can be implemented with shaders and clever mesh construction. These things include line primitives, triangle fans, triangle strips, and built-in antialiasing.)
API documentation is found at: https://peteroupc.github.io/html3dutil or https://github.com/peteroupc/html3dutil/blob/master/doc/index.md.
The file "h3du_min.js" is a minified single-file version of the library. Include it in your HTML as follows:
<script type="text/javascript" src="h3du_min.js"></script>
Source code is available in the project page.
To build, you will need a Java runtime environment and a JavaScript environment
that supports npm
.
- Put
compiler.jar
(the JAR file for the Closure Compiler) in thebuild
directory. - Install JSDoc and
rollup
vianpm
. - Run
npm run-script build
. This will generate the documentation and compile the library's source code into files calledh3du_min.js
andh3du_module.js
.
For detailed instructions on using this library and a summary of the library's features, visit:
https://peteroupc.github.io/html3dutil/tutorial-overview.html
See the history page to find information about what has changed in this library.
- Support "deg", "grad", "rad", and "turn" in CSS color hue parsing
Any copyright to this work is released to the Public Domain. In case this is not possible, this work is also licensed under the Unlicense: https://unlicense.org/