This website contains a collection of examples building up to interactive 3D applications involving shadows.
Examples of basic HTML elements, scripting, interaction with elements on page.
Example 3D scene created with the three.js library;
includes shadow casting and wireframe helper objects
to illustrate direction and range of shadows.
This and the following examples use OrbitControls
to control the camera:
A scene with three orthogonal directional lights casting shadows of a rotating cone.
Example of Constructive Solid Geometry (CSG) calculations, using the libraries CSG.js and THREE-CSGMesh. Displays meshes that are the union, intersection, or difference of two other meshes (a sphere and a cube in this example).
The intersection of two hollow cylinders; original cylinders are rendered as translucent objects.
The intersection of two hollow frustums; original frustums are rendered as wireframe objects.
Creating three-dimensional text meshes.
Creating shapes (specified by points/lines/curves), extruding the shapes to make 3D objects, and normalizing each shape to fit exactly in a unit box.
A combination of 3D text and extruded shapes, all normalized to fit exactly in a unit box.
Three text meshes are rotated to orthogonal directions, then intersected to create a mesh.
A combination of the shape, CSG, and shadow examples above. This demo creates the intersection of meshes constructed from shapes extruded along perpendicular directions, and shadows are projection along the three perpendicular directions. URL supports parameter input to select three different shapes and an optional rotation speed. For example:
Transformation controls, similar to those found in digital content creation (DCC) tools such as Blender, applied to a mesh. See the official documentation and example for additional details.
Simple Drag-and-Drop controls applied to a mesh. The dragged object moves in a plane perpendicular to the forward direction of the camera.
Four views of a scene - top, front, right, and diagonal -
rendered at the same time, using perspective cameras.
(Similar to the "quad view" in Blender.)
Four views of a scene. Each quadrant includes a text label.
The top, front, and right views are rendered with
orthographic cameras, and code guarantees a square aspect ratio is preserved
when the window is resized.
OrbitControls are active for the perspective view and are enabled only when the mouse pointer
is dragged within the corresponding quadrant of the scene.
(Even more similar to the "quad view" in Blender.)
Four views of a scene, combined with a draggable sphere. Drag controls plugin modified to work correctly with viewports. Multiple drag controls required: one for each of the orthographic views, where dragging is enabled.
Viewports + Drag-and-Drop (version 2)
A more colorful version of the previous example.
Drag-and-Drop controls applied to three vertices of a triangle. Lines connecting the vertices are automatically updated.
The previous example extended to include a triangular mesh bounded by the three objects representing the vertices of the triangle.