Shapes that are built when you ask for them, with a texture coordinate for every corner of every face. Pick a shape below, change its sliders, and put a picture on it. Drag to turn it, scroll or pinch to zoom, and right-drag to move it.
Loading three.js. If this note stays, the browser could not load or start it (WebGL may be switched off: Settings > System > "Use graphics acceleration when available").
These are the primitives of my 2003 and 2007 VRML experiments, rebuilt as small functions in geometry/procedural-shapes.js. The cone, the cylinder and the torus were VRML PROTOs with a script that wrote the points, and the sphere folder held several ways of making a sphere. Each shape returns the fields of a VRML IndexedFaceSet: coord, coordIndex, and now also texCoord and texCoordIndex, which the old versions never had. The faces are real polygons: the sides of a cylinder are quads and its caps are one polygon each.
Nearly everything here is made by a single function, PROCEDURAL.sweep(). It takes a section (a closed or open curve in two coordinates) and a path (points in space, each with a frame saying which way is out and which way is up) and carries the section along the path. The texture's u runs along the path and v around the section, so every shape gets texture coordinates for free. A ring that shrinks to nothing, or a section point on the axis, becomes a pole. The options are small:
Paths come from a few builders: circlePath() is a circle round the vertical axis (a surface of revolution, which lathe(profile, ...) wraps up for you), curvePath() follows a closed curve and openPath() an open one, both carrying a frame along it so the tube does not twist. So a new shape is usually a few lines: pick a section, pick a path, say how it grows or turns.
The UV sphere is the one everybody knows, rings of latitude and segments of longitude with a point at each pole. The other spheres start from a solid and push it out onto a sphere: the cube sphere splits each face of a cube into squares, and the octahedron and icosahedron spheres split every triangle into four again and again, which is what the subdivision slider does (the octahedron one is the old Sphere.wrl and BetterSphere, and each step is a level of detail of LODSphere). The icosahedron one is the geodesic sphere, whose triangles are the most alike.
The spheres wear the picture the way a world map does: u runs east and v up, so the Earth picture lands in the right place. The hard part is the seam, where the picture ends and starts again: a face that crosses it gets texture coordinates that run on past 1 instead of racing back across the whole picture, and a corner at a pole takes the middle of its neighbors' u. The cube sphere shows the whole picture on each of its six sides, since a face with a pole inside cannot wear a world map.
This page was created with Claude Code.