3D rendering implementation to HTML made with three.js
<script src="https://unpkg.com/html3d"></script>
<html3d>
<!-- Your code will be here! -->
</html3d>
Note: By default its a 1x1x1 box and has mesh basic material with the color white.
<html3d>
<mesh></mesh>
</html3d>
Note: This will allow you to actually see the cube.
<html3d z="5">
<mesh></mesh>
</html3d>
<html3d z="5">
<mesh>
<mesh-basic-material color="red"></mesh-basic-material>
</mesh>
</html3d>
Note: This will allow you to move the camera object with your mouse.
<html3d z="5">
<mesh>
<mesh-basic-material color="red"></mesh-basic-material>
</mesh>
<trackball-controls></trackball-controls>
</html3d>
<html3d maximize z="5">
</html3d>
<html3d center z="5">
</html3d>
<html3d maximize center z="5">
</html3d>
Note: The origin of the world is 0-0-0.
<html3d maximize center z="5">
<point-light y="100"></point-light>
</html3d>
<html3d maximize center z="5">
<mesh>
<mesh-phong-material color="#156289" emissive="#072534" side="double"></mesh-phong-material>
</mesh>
<point-light y="200"></point-light>
<point-light x="100" y="200" z="100"></point-light>
<point-light x="-100" y="-200" z="-100"></point-light>
<trackball-controls></trackball-controls>
</html3d>
Changeable variables: x(position x), y, z, rx(rotation x), ry, rz, sx(scale x), sy, sz
Actions: **=
, |=
, &=
, +=
, -=
, *=
, /=
<html3d maximize center z="5">
<mesh behavior="rx += 0.01; ry += 0.01">
<mesh-phong-material color="#156289" emissive="#072534" side="double"></mesh-phong-material>
</mesh>
<point-light y="200"></point-light>
<point-light x="100" y="200" z="100"></point-light>
<point-light x="-100" y="-200" z="-100"></point-light>
<trackball-controls></trackball-controls>
</html3d>
- Plain code explanations
- Image explanations
- Video explanations
- Cube camera
- Perspective camera
- Orthographic camera
- Stereo camera
- Box geometry
- Capsule geometry
- Circle geometry
- Cone geometry
- Cylinder geometry
- Dodecahedron geometry
- Edges geometry
- Extrude geometry
- Icosahedron geometry
- Lathe geometry
- Octahedron geometry
- Plane geometry
- Polyhedron geometry
- Ring geometry
- Shape geometry
- Sphere geometry
- Tetrahedron geometry
- Torus geometry
- Torus Knot geometry
- Tube geometry
- Wireframe geometry
- Convex geometry
- Decal geometry
- Parametric geometry
- Text geometry
- Line basic material
- Line dashed material
- Mesh basic material
- Mesh depth material
- Mesh distance material
- Mesh lambert material
- Mesh metcap material
- Mesh normal material
- Mesh phong material
- Mesh physical material
- Mesh standard material
- Mesh toon material
- Points material
- Raw shader material
- Shader material
- Shadow material
- Sprite material
- Ambient light
- Ambient light probe
- Directional light
- Hemisphere light
- Hemisphere light probe
- Light probe
- Point light
- Rect area light
- Spotlight
- Fog
- FogExp2
- Arc ball controls
- Drag controls
- First person controls
- Fly controls
- Orbit controls
- Pointer lock controls
- Trackball controls
- Transform controls
- WebGL renderer
- WebGL1 renderer
- CSS 2D renderer
- CSS 3D renderer
- SVG renderer
- 3DM loader
- DRACO loader
- Font loader
- GLTF loader
- KTX2 loader
- LDraw loader
- MMD loader
- MTL loader
- OBJ loader
- PCD loader
- PDB loader
- PRWM loader
- SVG loader
- TGA loader
- Groups