Video Cube V1
A spinning 3D cube in three render styles, from wireframe to points
- images
Video Cube V1 is a tiny software 3D renderer whose entire subject is one spinning cube. It builds the cube's vertices, rotates them in 3D, projects them with a real perspective camera (FOV, distance, the works), and draws each frame in one of three render styles - wireframe, solid, or points. No GPU, no model, no dependencies beyond numpy and cv2. It's the kind of node that looks like a toy until you want a reliable abstract rotating object in your compositing pipeline, at which point it's exactly right.
How it works
The math is textbook 3D graphics, done by hand:
- create_cube_vertices / create_cube_faces - the cube's 8 corners and 6 faces
- rotate_points - rotation about X, Y, and Z using the per-frame
rotation_x/y/zvalues (which are in radians per frame - 0.02–0.03 is a gentle spin, 0.1 is a tumble) - project_points - perspective projection using
fov(30–120) anddistance(2–20) to position the camera - render_frame - draws it as wireframe (edges only - the classic 80s demo look), solid (filled faces with per-face lighting), or points (just vertices - which looks fantastic as abstract motion)
- lighting_mode - basic, ambient, dynamic, or none, tinting faces by their normals
cube_size (0.1–5) sets the cube's scale; color_scheme (rainbow, monochrome, neon, pastel, cyberpunk) sets the palette.
Inputs and outputs
Required: width, height (128–4096, step 64), fps (1–60), max_frames (1–9999), cube_size, distance, fov, rotation_x/y/z, color_scheme, render_style, lighting_mode. Output: images - a max_frames-long IMAGE batch.
Where it sits in a workflow
Same playbook as the corridor and maze: this family of DJZ nodes is at its best as a camera-motion supplier. Render the spinning cube, then feed the frames into img2img with a prompt like "chrome cube on a pedestal" and you get an AI-styled object with mathematically perfect rotation - no struggling to coax a consistent camera move out of a video model. In points mode it's also a great abstract-texture source for compositing and motion backgrounds.
Install
Part of DJZ-Nodes by Drift Johnson. ComfyUI Manager → "DJZ-Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/DJZ-Nodes
cd DJZ-Nodes
pip install -r requirements.txt
Restart ComfyUI. numpy/torch/cv2 - nothing extra.
Gotchas
Rotation inputs are per-frame deltas, so the values you set are "how much it turns each frame," not a total. Because it's CPU vector math, 4096² runs at high max_frames will crawl - 512² is the sweet spot for speed, and you can always upscale. And distance interacts with fov: if the cube looks clipped or tiny, adjust distance before FOV, since they fight each other.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 512128–4096 | — |
| height | INT | 512128–4096 | — |
| fps | INT | 301–60 | — |
| max_frames | INT | 1201–9999 | — |
| cube_size | FLOAT | 1.00.1–5 | — |
| distance | FLOAT | 5.02–20 | — |
| fov | FLOAT | 7530–120 | — |
| rotation_x | FLOAT | 0.02-0.1–0.1 | — |
| rotation_y | FLOAT | 0.03-0.1–0.1 | — |
| rotation_z | FLOAT | 0.01-0.1–0.1 | — |
| color_scheme | COMBO | 5 options: rainbow, monochrome, neon, pastel, cyberpunk | |
| render_style | COMBO | 3 options: wireframe, solid, points | |
| lighting_mode | COMBO | 4 options: basic, ambient, dynamic, none |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |