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.)

  1. The box fades.
  2. The ball lifts off the table and turns to face you, window toward you.
  3. The answer is revealed: it floats up out of the dark blue liquid on a twenty-sided die.
  4. It holds for a few seconds (5 s by default; Hold − / + or ?hold= changes it).
  5. 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).

on the table

a question typed in the box

lifting and turning

the answer

turning and lowering

back on the table

The request (CT66.A3)

  1. Review CT66.A2.Magic8/README.md.
  2. The magic 8 ball should sit on the table.
  3. There should be simple text middle of screen that says "Ask Your Question of the Magic 8 Ball".
  4. Then when the user hits return, the magic 8 ball lifts off the table, faces the user and the answer is revealed.
  5. Then a few seconds later, the ball turns again and lowers itself to the table.
  6. 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.
  1. Please remove the connection to MIDI, not necessary for this application, but there should be a record button of course.
  1. 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:

Liberties taken

The panel

GroupControls
Questionthe answer in words, Put back, Record (you ask in the box in the middle of the screen)
Ballhold − / + (seconds the answer is held), lamp − / +
LookFront, ◀ ▶ ▲ ▼ (round the ball, higher / lower), zoom − / +
SetupInfo, the frame rate, help

Keys

KeyWhat it does
Return in the boxask your typed question
Space, Enter, Q (box not focused)ask without typing
8put back now
Rrecord
1 2lamp − / +
3 4hold − / +
arrowslook round, higher / lower
- =zoom out / in
0front view
Iinfo
H or Dcontrols
?help

URL options

OptionWhat it sets
?hold=5seconds the answer is held
?light=1the lamp
?yaw=0 ?pitch=12 ?dist=7.4the view
?exposure=1exposure
?fadein=2.5the fade up from black, in seconds
?w=1920&h=1080a fixed picture size
?fps=30the movie's frame rate (60 otherwise)
?recw= ?rech=the largest movie size

Checked (2026-11-22, in the app's browser pane, 30 fps)

Not done / to check

Files

FileWhat it is
index.htmlthe page: the panel, the question box, the help
CT66.A3.Magic8_main.jsthe scene, the text, the motion, buttons, keys, the recorder, the frame loop
CT66.A3.Magic8_answers.jsthe twenty answers (edit freely)
CT66.A3.Magic8_midi.js, CT66.A3.Magic8_midimap.jsno longer used (MIDI removed); not loaded by the page, left on disk until you say to delete them
CT66.A3.Magic8_rec.jsthe 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.htmlopen issues and questions
images/pictures from the program

© 2026 Michael Wahrman. All rights reserved.