CT66.A3 · Magic8
Type: F (fantasy / art). A Magic 8 Ball, asked by typing a question (three.js / WebGL, movie recorder, all local, no sound, no MIDI).
A glossy black 8 ball sits on a round table under a lamp, the 8 toward you. In the middle of the screen is a text box that says Ask Your Question of the Magic 8 Ball.
Click the box, type a yes-or-no question, and press Return. (An empty box does nothing. Without typing, Space still asks.)
- The box fades.
- The ball lifts off the table and turns to face you, window toward you.
- The answer is revealed: it floats up out of the dark blue liquid on a twenty-sided die.
- It holds for a few seconds (5 s by default; Hold − / + or
?hold= changes it).
- The ball turns again, 8 up, and lowers itself back to its place on the table; the box comes back, empty and ready for the next question.
Open index.html in Chrome or Edge (or serve the folder: python -m http.server). Open issues: ISSUES.md (html).






The request (CT66.A3)
- Review CT66.A2.Magic8/README.md.
- The magic 8 ball should sit on the table.
- There should be simple text middle of screen that says "Ask Your Question of the Magic 8 Ball".
- Then when the user hits return, the magic 8 ball lifts off the table, faces the user and the answer is revealed.
- Then a few seconds later, the ball turns again and lowers itself to the table.
- The box that says ask your question, you should click on it, type a question then hit return. Also it should not say "I have a question" in the panel to the right.
- Please remove the connection to MIDI, not necessary for this application, but there should be a record button of course.
- Unfortunately the question does not appear in the recording.
Note: the first A3 pass got item 8 wrong. It painted "Ask Your Question of the Magic 8 Ball" as words in the picture, not as a box you type into. Item 11 fixed that.
What changed from CT66.A2
A2 already had the ball on the table, the lift-and-turn, the answer, the hold and the turn-and-lower. A3 changes only the question and the panel:
- The question box. A2's gold carnival lettering is gone. In its place, in the middle of the screen, is a text box with the prompt "Ask Your Question of the Magic 8 Ball" (Georgia, off-white, on a dark translucent box). Click it, type, and press Return. Return in an empty box does nothing. Typing in the box never triggers the shortcut keys (8, R, Q, …).
- The box fades out while the ball is up and comes back, empty and focused, after the ball is set down.
- The box is drawn into the 3D picture (item 13), so movies show it: the box, the prompt, and the question as you type it. The real text box sits exactly on top but is see-through; only its typing cursor shows (and the cursor is not in movies).
- Panel: the "I have a question" button is gone. The Question group keeps the answer in words, Put back and Record.
- Space, Enter (when the box isn't focused) and Q still ask without a typed question, as in A2.
- MIDI removed (item 12): no MIDI scripts are loaded, there is no MIDI button or MIDI panel, and the page never asks the browser for MIDI. Record stays in the panel (and the R key).
- Files renamed from
CT66.A2.Magic8_* to CT66.A3.Magic8_*.
Liberties taken
- "A few seconds" was read as A2's 5 s hold, unchanged. Say if you want shorter (e.g. 3 s).
- The box's look (font, colour, size, translucent dark box) is my choice.
- The typed question is not used for the answer; the answer is random, as in A2, and the question is not shown anywhere else (confirmed by Michael, 2026-11-22).
- The typing cursor is not in movies: it belongs to the see-through text box on top, not the picture.
- The control panel is still open at start, as in A2 (harness 6 asks for info displays off at start; A2's corner info text is off, but the panel shows). Not changed, to keep the change minimal; noted in ISSUES.
The panel
| Group | Controls |
| Question | the answer in words, Put back, Record (you ask in the box in the middle of the screen) |
| Ball | hold − / + (seconds the answer is held), lamp − / + |
| Look | Front, ◀ ▶ ▲ ▼ (round the ball, higher / lower), zoom − / + |
| Setup | Info, the frame rate, help |
Keys
| Key | What it does |
| Return in the box | ask your typed question |
| Space, Enter, Q (box not focused) | ask without typing |
| 8 | put back now |
| R | record |
| 1 2 | lamp − / + |
| 3 4 | hold − / + |
| arrows | look round, higher / lower |
| - = | zoom out / in |
| 0 | front view |
| I | info |
| H or D | controls |
| ? | help |
URL options
| Option | What it sets |
?hold=5 | seconds the answer is held |
?light=1 | the lamp |
?yaw=0 ?pitch=12 ?dist=7.4 | the view |
?exposure=1 | exposure |
?fadein=2.5 | the fade up from black, in seconds |
?w=1920&h=1080 | a fixed picture size |
?fps=30 | the movie's frame rate (60 otherwise) |
?recw= ?rech= | the largest movie size |
Checked (2026-11-22, in the app's browser pane, 30 fps)
- At start: the ball on the table and the box in the middle of the screen. No "I have a question" in the panel.
- Clicking the box and pressing Return with it empty: nothing happens.
- Typing "Will 8 rainy days end soon?" (which contains 8 and r, the Put back and Record keys): no shortcut fired. Return lifted the ball, turned it to face the camera and revealed the answer.
- About 5 s later the ball turned 8 up and lowered to the table. The box came back, empty and focused.
- MIDI removed (2026-11-22): the page loads only three.js, mp4-muxer, the answers, the recorder and the main script; no MIDI button or panel.
- Record: started, asked a question, stopped. An .mp4 was saved (picture only).
- Item 13: a frame grabbed from the picture the same way the recorder grabs it (a VideoFrame of the canvas) shows the box with the typed question. The cursor lines up with the painted text.
- Not proven by a full movie here: the test browser pane was hidden, so it drew only a few frames and the test movies were 0.1–1.6 s long, with no frame from while the question was typed. Please record a question on your machine to confirm.
- No console errors.
Not done / to check
Files
| File | What it is |
index.html | the page: the panel, the question box, the help |
CT66.A3.Magic8_main.js | the scene, the text, the motion, buttons, keys, the recorder, the frame loop |
CT66.A3.Magic8_answers.js | the twenty answers (edit freely) |
CT66.A3.Magic8_midi.js, CT66.A3.Magic8_midimap.js | no longer used (MIDI removed); not loaded by the page, left on disk until you say to delete them |
CT66.A3.Magic8_rec.js | the movie recorder (picture only) |
CT66.A3.Magic8_lib/ | three.js r186, mp4-muxer 5.2.1 (all local); ct45midi.js and ct45.profiles.js are no longer used and not loaded |
ISSUES.md / ISSUES.html | open issues and questions |
images/ | pictures from the program |
© 2026 Michael Wahrman. All rights reserved.