I had to introduce a delay(20); after each show to slow it down to what you see in the video.
I am struggling a bit to ‘dissect’ the sketch and would appreciate some help.
1st issue: The following definition #define NUM_PIXELS 0
I can’t understand why it works as many loops use NUM_PIXELS to draw and I am still getting nucleus and electrons with this set at 0 !?
2nd issue: Slowing down the electron spinning without the use of delay
I tried setting const uint8_t kFracs = 16; to higher values but it did not work well. Likely, I need to change the code in some other place(s) !?
3rd issue: Different rotational planes for electrons.
The electrons currently cross paths at the top and bottom of the cube, any suggestions on how I can have some electrons crossing paths on the front and back !? on the left and right sides !?
What about how to get some of them to spinning backwards within the same plane !?
Hi @Andrew_Tuline ,
No, I would prefer to have the fractional part of the pixel movement to be in 1/32 or 1/64 to slow it down with more movement steps !
Hi @Jason_Coon , changed from…
from… PHI_RES 30 to… PHI_RES 300
and it effectively slowed down the electrons spin to the point I could remove the delay !
Thanks!
Anywhere I can find info about these parameters !?
My other guess for slowing it down was going to be reducing the amount added to theta and phi each loop, but they’re currently ints, and only get incremented by 1 or -1 each loop. They would need to be changed to floats in order to be incremented fractionally.
Hi again @Jason_Coon , with that wiki on spherical coordinates, I was able to fix that 3rd issue by myself.
Now I am able to set electrons to spin about in any of the 3 X, Y Z axis AND reverse the rotation in all 3 cases !
Fun to learn something new… thanks again !!
That brings back memories of the paper I wrote in my high school pre-calculus class on 3-dimensional rotations in space, using Euler’s formulas. I wrote a program in BASIC on the Apple II (and also a version for the Radio Shack Color Computer I had at home) which displayed the XYZ coordinate axes, prompted you for the three rotation angles, then displayed a unit cube with the projected orientation.
It would have been way cooler with an LED cube, though.