Difference between revisions of "Planet Clock"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "== Planet Clock == '''Description:''' The following code utilizes ZCubes' `RENDER` function to make a clock where the 12, 3, 6, and 9 o'clock positions are represented by p...")
 
Line 1: Line 1:
 
== Planet Clock ==
 
== Planet Clock ==
 
+
[[File:AnalougeClockWithPlanets.png|thumb]]
 
'''Description:'''   
 
'''Description:'''   
 
The following code utilizes ZCubes' `RENDER` function to make a clock where the 12, 3, 6, and 9 o'clock positions are represented by planets.
 
The following code utilizes ZCubes' `RENDER` function to make a clock where the 12, 3, 6, and 9 o'clock positions are represented by planets.

Revision as of 20:25, 3 June 2025

Planet Clock

AnalougeClockWithPlanets.png

Description: The following code utilizes ZCubes' `RENDER` function to make a clock where the 12, 3, 6, and 9 o'clock positions are represented by planets.

clockscene = RENDER( 
    [
        ["type", "coordinates", "r", "fill", "count", "transform-origin", "stroke-width"],
        ["circle", [[100, 20, 0], [100, 180, 0], [180, 100, 0], [20, 100, 0]], 25, "https://photojournal.jpl.nasa.gov/jpeg/PIA02873.jpg", 4, [100, 100], 10]
    ]
);

clockscene = RENDER(
    [
        ["type", "coordinates", "r", "fill", "count", "transform-origin", "stroke-width"],
        ["circle", [[100, 20, 0], [100, 180, 0], [180, 100, 0], [20, 100, 0]], 25,
            [
                "https://photojournal.jpl.nasa.gov/jpeg/PIA02873.jpg",
                "https://images-assets.nasa.gov/image/PIA01253/PIA01253~small.jpg",
                "https://images-assets.nasa.gov/image/PIA16853/PIA16853~small.jpg",
                "https://images-assets.nasa.gov/image/PIA21430/PIA21430~medium.jpg"
            ], 4, [100, 100], 10]
    ]
);

RENDER(
    [
        ["id", "type", "coordinates", "fill", "transform-origin"],
        ["hour", "line", [110, 110, 110, 50], "blue", [110, 110]],
        ["minute", "line", [110, 110, 110, 40], "green", [110, 110]],
        ["second", "line", [110, 110, 110, 20], "red", [110, 110]]
    ],
    clockscene
);

RENDER(
    [
        ["id", "animate", "animationsettings"],
        ["hour", "animate", [["loop", "rotate", "duration", "easing"], [true, 360, 12 * 60 * 60 * 1000, "linear"]]],
        ["minute", "animate", [["loop", "rotate", "duration", "easing"], [true, 360, 60 * 60 * 1000, "linear"]]],
        ["second", "animate", [["loop", "rotate", "duration", "easing"], [true, 360, 60 * 1000, "linear"]]]
    ],
    clockscene
);