Pine3D
A full 3D rendering engine for TradingView, powered by Pine Script v6, with meshes, transforms, perspective projection, lighting, shadows, depth sorting, culling, and data visualization primitives.
What is Pine3D?
Pine3D lets Pine developers describe what to draw while the library handles world transforms, camera math, projection, depth ordering, visibility, lighting, caching, and TradingView drawing limits.
It supports both scene composition and data visualization. The same engine can render a lit mesh scene, a dense contour surface, a categorical bar chart, a streaming oscillator ribbon, or a 500-point scatter cloud.
Rendering pipeline
- Transform local mesh vertices into world space.
- Move world geometry into camera space.
- Apply back-face and near-plane culling.
- Drop hidden geometry with sparse raster occlusion.
- Depth-sort visible faces and overlays.
- Apply diffuse lighting and shadow tests.
- Project 3D points into TradingView drawing coordinates.
- Emit polylines, lines, linefills, and labels.
Chainable, tag-addressable API
p3d.Mesh box = p3d.cube(40.0, color.orange)
.setTag("hero")
.rotateBy(0.0, 45.0, 0.0)
scene.add(box)
scene.lookAt("hero")
p3d.render(scene)Meshes and overlays can carry tags. Tags let you retrieve, target, animate, and remove scene objects without retaining a separate variable for every item.
Core capabilities
Where to go next
Pine3D is created by Alien_Algorithms. Import the published library with Alien_Algorithms/Pine3D/1.